Skip to content
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

404 Not Found when Coordinate Changes Significantly #2

Closed
daniel-j-h opened this issue Dec 1, 2015 · 3 comments
Closed

404 Not Found when Coordinate Changes Significantly #2

daniel-j-h opened this issue Dec 1, 2015 · 3 comments
Assignees

Comments

@daniel-j-h
Copy link

How is the global availability of tiles determined? My mental model was something like this: tiles are generated globally and then stored and cached or rendered on-demand. Is the 404 I'm seeing coming from tiles simply not being available as in not rendered / cached, or is this a bug in wallmapper?

See this example, with different coordinates:

daniel@x1c /t/wallmapper> python wallmapper.py --zoom 16 --basemap mapbox.dc-nightvision --width 2560 --height 1440 --latitude 52.500385 --longitude 13.419779
Generating wallpaper...
This zoom level has this many tiles in total 65536
The central tile is (35210, 21498)
This is the tile set we will assemble ([35205, 35206, 35207, 35208, 35209, 35210, 35211, 35212, 35213, 35214, 35215], [21495, 21496, 21497, 21498, 21499, 21500, 21501])
The total number of required tiles is 77
The raw width before cropping is 2816
The raw height before cropping is 1792
Error: HTTP Error 404: Not Found
daniel@x1c /t/wallmapper> python wallmapper.py --zoom 16 --basemap mapbox.dc-nightvision --width 2560 --height 1440
Generating wallpaper...
This zoom level has this many tiles in total 65536
The central tile is (18741, 25067)
This is the tile set we will assemble ([18736, 18737, 18738, 18739, 18740, 18741, 18742, 18743, 18744, 18745, 18746], [25064, 25065, 25066, 25067, 25068, 25069, 25070])
The total number of required tiles is 77
The raw width before cropping is 2816
The raw height before cropping is 1792
Done.
@zugaldia zugaldia self-assigned this Dec 1, 2015
@zugaldia
Copy link
Owner

zugaldia commented Dec 1, 2015

I believe that in this case the problem you're having is that you're trying to download tiles for an area where the map doesn't have tiles. Note that you're setting the mapbox.dc-nightvision basemap (a Washington DC map) but giving it Berlin coordinates.

For example, if you try the same coordinates, with the mapbox.control-room basemap, the image gets rendered with no problems (but, definitely, we could provide better error messages):

$ python wallmapper.py --zoom 8 --basemap mapbox.control-room --width 2560 --height 1440 --latitude 52.500385 --longitude 13.419779
Generating wallpaper...
This zoom level has this many tiles in total 256
The central tile is (137, 83)
This is the tile set we will assemble ([132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142], [80, 81, 82, 83, 84, 85, 86])
The total number of required tiles is 77
The raw width before cropping is 2816
The raw height before cropping is 1792
Done.

wallmapper

Also, note I changed the zoom level to 8 as not all basemaps support all zoom levels. For example, check it here.

@daniel-j-h
Copy link
Author

Ah! My mental model of the base map having tiles available globally was wrong --- thanks for your explanation, I had no idea that there could be tiles for a specific area only.

@zugaldia
Copy link
Owner

zugaldia commented Dec 2, 2015

You learn something new every day, I did the hard way :)

@zugaldia zugaldia closed this as completed Dec 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants