[OSM-talk] planet.osm powered "where am I"

Nick Burch openstreetmap at gagravarr.org
Sat Aug 5 15:34:11 BST 2006


On Sat, 5 Aug 2006, OJW wrote:
> On Tuesday 25 July 2006 08:10, Nick Burch wrote:
>> I've knocked up a little REST service for querying planet.osm for where 
>> you happen to be near.
>
> Can it do a search for the "centre" location?  e.g. items near bedford, 
> rather than items near 52.1,-0.5?

Did you intend this to work via an external gazetter service, or via 
finding a town called bedford in the planet.osm data, and then using that?

The latter shouldn't be too hard, despite needing two check two tags (join 
node_tags to node_tags, one for name=Bedford, the other for place=town or 
place=city, then grab the node for it)

> Can it include only large places (towns/cities) with a wider search 
> area? e.g. towns in the midlands, or cities in england?

I originally limited the search to 5km, as I didn't want to return too 
many points. If we can restrict the nodes in sql (eg place=town or 
place=city), then we can increase the search bbox without having a huge 
performance hit. You'd still need to give a lat, long and distance, but 
the distance could be much larger.

Oh, and we could use the wiki for building up nice queries, so people 
could suggest the best lat+long+distance for the east midlands :)

> Can it format the results as a GPX waypoints file, so that we can upload 
> the result to a GPS and see local towns or villages on it?

Sure, you can probably do that already with format=osm and a suitable 
xslt. Adding format=gpx shouldn't be too hard, if someone can suggest what 
tags we'd need for GPSs to be able to use it (an example file would be 
great!)


Otherwise, I'll see if I can tackle the first two tomorrow

Nick




More information about the talk mailing list