rikkitikkitumbo
rikkitikkitumbo

Reputation: 976

get lat lng from planet_osm_polygon.way in postgresql osm db

I've downloaded some osm data into a postgresql db. I'm trying to get lat lng coords from the 'planet_osm_polygon' table... field name 'way'.

I got pretty close with:

select ST_Y(ST_TRANSFORM(st_centroid(planet_osm_polygon.way),4626))

But it's not quite right, it gives me a result that's about 10 blocks off.

Upvotes: 0

Views: 238

Answers (1)

Jendrusk
Jendrusk

Reputation: 813

EPSG:4626 is local geodetic CRS for Madagaskar... I think you ment 4326...

select ST_Y(ST_TRANSFORM(st_centroid(way),4326))
from planet_osm_polygon

Upvotes: 3

Related Questions