Skip to content

Instantly share code, notes, and snippets.

💭
merging your prs

Tom MacWright tmcw

💭
merging your prs
Block or report user

Report or block tmcw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tmcw
tmcw / xyz_vs_tms.md
Last active Sep 15, 2019
The difference between XYZ and TMS tiles and how to convert between them
View xyz_vs_tms.md

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

View gist:a5507b337d9fd05511ca50051ccd677e
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
View gist:97d3e1e8ddc413e6e784c71820206d4e
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
View gist:633f0c647088d6ffcadd8c6c635f9819
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
View gist:5ea7ba3decaa73d7992f2703e15bf116
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
View gist:59d9a0d0583d0ed80c051e1d22d87cd3
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
View gist:bec93b5b35d9a63f1c4a5c98411078b1
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
View gist:4ef41e39f2f0d20cfa17fb3006ef494f
(-------------List output---------- )
341 55
342 55
343 55
344 55
340 56
347 56
338 57
336 58
337 58
View gist:42e94c0da56f7e0c49746960fd7052ad
(-------------List output---------- )
0.187042 0.645075
0.193207 0.648417
0.199533 0.651622
0.206013 0.654685
0.212638 0.657603
0.219399 0.660371
0.226287 0.662985
0.233294 0.665442
0.24041 0.667738
View gist:0d4c357b1a5021b6df9fb7028ec3a740
(-------------List output---------- )
-0.00122166 -0.00773919
0.0583786 0.00420576
0.080896 0.00804865
0.0936988 0.0130573
0.100379 0.0424473
0.108123 0.0565801
0.101391 0.0665227
0.0921094 0.0633638
0.102654 0.084326
You can’t perform that action at this time.