I’m currently using the pic-layer-plugin excessively with JOSM, but when I open .tif files it’s getting ridiculously slow, even worse than with .jpg files. I’m using a EPSG 25832 map projection, which already adds some render delay to regular imagery. My machine is a Ryzen 9 5900X with 64 GB of RAM, if it’s somehow related to that.
Is there any way to speed this up? Everything in JOSM is creeping now, not only moving the map, but also drawing on it. It’s like everything has 2FPS, it’s hardly usable at all.
I found the piclayer plugin much slower than tiles when I tried to use it. You also can’t adjust to match GPS traces etc. For me the solution was to render the parts of the image I was interested in out to tiles with QMetatikls in QGIS and reference those from JOSM.
TBH, I’d probably import the image into something like GeoServer, and use that instead of trying to load the image into JOSM.
Based off of my profiling, it looks like it is due to the Java2D pipeline making a copy of the image in memory every time it paints the image. This is a two-fold performance hit: first, when making the copy, and second when GC has to pause the JVM to clean up the copy in memory.
In order to fix this, we would have to rewrite the piclayer plugin to tile the image. This would not be a small task.
I don’t know how many people use the PicLayer plugin, so I don’t know if it is worth it to spend the time trying to fix the performance, especially when there is software that is specifically made for serving imagery.
Oh yes, that is already much better. However, the images aren’t pre-generated, so moving around is still slow. Is there a way to have GeoServer pre-fill the tiling cache?
Yes, this is the problem. But I suppose that’s not a problem after using the server for a bit, it was just initially. Pre-filling the cache somehow doesn’t work for me - no worker spawned. Well … whatever. That’s already so much better than piclayer! Thanks!
I’m not sure if it is documented but you can reference local file paths in JOSM custom imagery layers with the relevant URL prefix as you would use to browse to that file in e.g. Chrome (at least you can on Windows, YMMV).
Just point JOSM at the top level folder for the tiles as if it’s a TMS source and it will fetch them. Any missing files will cause an error but you can just render that bit again and get right click to load error tiles.
It helps to set the max and min zooms for the layer to what you have actually rendered. If I know what zoom I will be mapping at I just render that level, zoom to it, and untick to option to autozoom map tiles on the right click menu. There are limits to how much JOSM will let you zoom out from the correct zoom level but it can be quite handy.