-
Notifications
You must be signed in to change notification settings - Fork 6
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
Strange size of tiles #13
Comments
Most likely, it is tile serving logic that relies on WMS backend:
Most likely image from openstreetmap.org is indexed png, and the one you get on the first request is not. Could be fixed by checking tile-fetching flow and calling fetcher right after looking in cache if there's no reason to fall back on WMS flow, and leaving things as they are for other cases. |
I try call fetch earlier in twms_main() in same place where tile checked in cache and read, but fetch function return TIL image and you need covert it to string for web.py answer. So anyway after this convertation image size changed. |
Well, probably the best solution is to separate tile downloading logic from fetcher. Probably some flag, that indicates that there's no need to decode image, and it just should be fetched into cache. Then you can check for a tile in cache, call fetcher with that flag, check again, and fall back to calling fetcher without that flag. |
@Komzpa Ok, I think I can do it. Actually I already do same logic in function get_tile_from_db https://github.com/alff0x1f/twms/commit/ef0ae7ea460e68c61b156112fea16953aeffd287 It is offtopic here, but can you explain some additional extensions? For tile 1234.png, code check file like 1234.ups.png and 1234.tne. I did't realize that moment. |
1234.tne - Tile Not Exists. For cases when dataset is sparse, and you don't want to hammer the upstream server to get the tile that just isn't there. 1234.ups.png - scaled version of tile. some datasets may contain only higher zooms, and lower ones are generated by stitching four tiles together and cropping them. |
twms disk cache format is directly compatible with directories from SAS.Planet, http://sasgis.ru/sasplaneta/ |
Twms version: 4692d81
New installed twms without any cache. Let's get tile:
Size: 2934 bits. But if we look at our cache, we notice another size of tile:
Size of tile 1872 bits. And on next gets (with cache and after restart) it return 2934 bite. (work wrong always)
At my local machine I fix issue #11 and after restart I get this (with empty cache dir):
First tile bigger, but after that it return smaller tile from cache (work wrong only first time when cache empty). Original OSM tile size 1872:
Both Images look same, with my eye I did't see difference.
Ah, yes, and twms save 4 tiles cache, even I get only one (I don't know why):
I don't know bug this or feature. In code there some "magic" which i not completely understand. So I think I don't fix this, only leave this issue for other people. May be it will be useful for somebody.
The text was updated successfully, but these errors were encountered: