-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
geotiler performance note #35
Comments
Thanks for all the information. I am not sure if you are aware, but GeoTiler support caching, example: https://wrobell.dcmod.org/geotiler/usage.html#caching. But there might be need for GeoTiler be smarter here, i.e. cache whole map and allow to pan it around. Something to dwell on! |
Hi yes - however the existing caching only caches the image data - not the image object. Each time the tile is retrieved from the cache, the image object is recreated.... at least that's what i saw - perhaps I'm making an error. Cheers! |
This caches tile objects: https://github.com/wrobell/geotiler/blob/master/geotiler/cache.py. Tile object references existing image object. In theory, you just need a similar function to "redis_downloader" function in the cache module, and then use that function the same way as in the documentation example. |
Tile objects don't contain a PIL.Image they contain file data - like a PNG file. |
Good point. I see the problem now. This is something to reconsider. Thanks. |
hiya - thanks for your library, it is very nice, and I use it in https://github.com/time4tea/gopro-dashboard-overlay
as the rendering code in my project gets called a lot - i was looking for places that I could make some easy gains in performance - so i ran the rendering code in viztracer.
I got the following trace:

as you can see there is quite some time spent in PIL imagedecode - this seems to be because the cache in the system caches the data files, but there is no image cache in the library. When drawing maps in my program we reuse map tiles a lot, as the map is moving pixel by pixel around the place.
i couldn't find a good place to put an image cache in, so i kind of bodged it, and ended up with a trace that looks like this:
you can see that the time to create the image is much reduced - from about 7.5ms to about 1ms - assuming a cached tile.
The code is smashed in right now, so no prizes for quality - but you are welcome to it if it is useful for you.
https://github.com/time4tea/gopro-dashboard-overlay/blob/geotiler-perf/gopro_overlay/geo_render.py
It is a "drop-in" replacement for the geotiler.render_map (at least how I use it)
Hope this is useful/interesting - anyhow thanks for making a nice library.
Cheers!
James
The text was updated successfully, but these errors were encountered: