[OSM-talk] How to georeference OSM Mapnik tiles?
Robert (Jamie) Munro
rjmunro at arjam.net
Fri Nov 30 12:08:19 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Rahkonen Jukka wrote:
>> Lähettäjä: Martijn van Oosterhout [mailto:kleptog at gmail.com]
>> <Jukka.Rahkonen at mmmtike.fi> wrote:
>>> I would like to convert some OSM tiles to geotiff format,
>> but I wonder
>>> how can I get the georeferencing information I need for it. What I
>>> would need to know is:
>>> - Which projection the tiles are in (EPSG code or projection
>>> parameters)
>> It's not as official projection, though people refer to it as
>> EPSG:90013. It's also known as spherical mercator, the same
>> as google uses. The usual definition is:
>> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
>> +x_0=0.0 y_0=0
>> ++k=1.0 +units=m +nadgrids=@null +no_defs
>
> Thanks, that's exactly what I needed.
>
>>> - Pixel size for each zoom level
>> Zoom 0 is 256x256, each zoomlevel down is twice as big as the
>> previous in each dimension
>
> Sorry for being unclear, I meant to ask "What are the dimensions of a single pixel (width and heighth) in geographical units in the real world?" The unit seem to be meter according to the definition above.
It's much simpler than most projections cartographers are used to. At
zoom level 0, 360 degrees longitude = 256 pixels.
To work out latitude, translate pixels into degrees as above, which
gives you "mercator degrees", then use the simple formulas here:
http://en.wikipedia.org/wiki/Mercator_projection#Mathematics_of_the_projection
>>> - What is the anchor point of the tile and its corresponding
>>> coordinates
>> Zoom 0 has 1x1 tiles, Each zoomlevel down has twice as many
>> in each direction
>
> Here I meant to ask what is the most natural point to use as
> reference point, for example the top-left corner of top-left
> pixel of each tile. But I think I will be able to solve this
> by the reference you sent.
Top left. It becomes obvious when you look at tile 0,0 at zoom 1.
http://b.tah.openstreetmap.org/Tiles/tile.php/1/0/0.png
Robert (Jamie) Munro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHT/0wz+aYVHdncI0RAkhIAJ9v8LKiXlTzCFzmXiMo25+0aZCrcQCfVXn2
D5wSJ6s89F9hUot7P13X2F4=
=bHUm
-----END PGP SIGNATURE-----
More information about the talk
mailing list