[OSM-talk] calculating lon/lat bounds from tilename
Daniel Would
daniel at demigoth.org
Thu Jun 21 23:19:41 BST 2007
Hi, not sure if this is the right place to post this question, so
forgive me if it's off topic...
I've been working on a script that takes a lon/lat position, zoom level
and a size of grid to capture.
and it retrieves all the tiles in a grid of your size centered around
the lon/lat provided.
so I might say zoom=15, gridsize=4 and it will get me a 4x4 grid of
tiles at that zoom level around my lon/lat.
Now I'm doing this to use with TrekBuddy which is very cool. And I want
a script that will build me the Atlas inputs it requires using the
openstreetmap images.
Everything works great.. however I need to generate a file that
specifies the lon/lat of the top left corner and bottom right corner of
my grid. I have no idea how to do that (I stole the calculation for
lon/lat -> mercator tile from the osm page that contained a perl
example.
Any one have any ideas? I'm really keen to make it simple to use open
streetmap data in trekbuddy so that I can see what currenty exists on
the map as I walk around new places, to avoid going mapping stuff
already there.
Thanks for any assistance, even if only to point me at a better place to
ask the question!
Sincerely
Daniel Would
More information about the talk
mailing list