[OSM-talk] querying the postgis db

Alexandr Zeinalov shurik at sbin.ru
Tue Jul 26 07:20:36 BST 2011


> hi,
>
> I know that this sounds a bit of a dumb question:
>
> I have installed osm data in a postgis db, and would like to get a list
> of all localities within a particular city - can anyone give a hint on
> the sql required for this?

Something like:

SELECT a.osm_id,a.name,ST_X(a.way),ST_Y(a.way) FROM planet_osm_point
a,planet_osm_polygon b WHERE a.place='locality' AND b.osm_id='id of
boundary of particular city' AND a.way && b.way






More information about the talk mailing list