[OSM-talk] querying the postgis db

kenneth gonsalves lawgon at thenilgiris.com
Wed Jul 27 13:58:34 BST 2011


On Wed, 2011-07-27 at 07:41 -0400, Richard Weait wrote:
> > 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?
> 
> Here's a hint. ;-)
> 
> Find locality points inside any Toronto polygon (includes Toronto,
> Iowa (Ohio, NSW AU, etc)
> 
> gis=# select p.name from planet_osm_point p, planet_osm_polygon g
> where p.place='locality' AND ST_Within(p.way,g.way) AND
> g.name='Toronto'; 

works like a charm. But it is not a 'hint', you are putting my ball
instead of teaching me to putt ;-) Thanks anyway.




More information about the talk mailing list