[postgis-users] Calculating area / length of a geometry in openstreetmap(osm) x, y coordinates at a given zoomlevel,

Hemant Bist hemantbist at gmail.com
Fri May 12 16:58:34 PDT 2017


Hi,
I want to figure out how big a geometry (line, polygon) is in osm map for a
given zoomlevel. i.e. length of the line, area of the polygon.
The data is stored in  lan/lon coordinates (EPSG:4326). I know I can do
something like st_area(st_transform(geometry, 900913)) to get the
numbers in a other projections. But I am not sure if there is some magical
projection number for each osm zoomlevel.
I will appreciate any pointers for this.

1) I am not sure if there is a relation between area in 900913 projection
and x,y coordinates for osm.

2) If someone has written some pl/sql or any other language utilities to do
that,  I can use them as well. I am not necessarily looking for an
easy solution...

3) Here are actual functions that describe how to map the lat  lon to x, y
coordinates for a osm zoomlevel. If I remove the int rounding from the
following osm link, I would get the x,y coordiantes for a given lat/lon for
a given zoomlevel.
http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Python

Best regards,
Hemant Bist.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170512/1880f34a/attachment.html>


More information about the postgis-users mailing list