[OSM-dev] [Maposmatic-dev] Questions on Nominatim and administrative boundaries + osm2pgsql

Lennard ldp at xs4all.nl
Sun Dec 20 11:18:36 GMT 2009

David MENTRE wrote:

> Is this the right way to do it? Can we assume that, when nominatim
> returns an entry with class="boundary" type="administrative" and
> osm_type="relation", then we can safely query the planet_osm_line
> table with the _opposite_ of osm_id?

A _way_ will be in the tables with a positive osm_id, where a _relation_ 
will always have a negative osm_id. This is due to non-unique numbering 
between OSM object classes.

Nominatim tells you* whether you got back a relation or a way, and you 
can then search for the negative or positive osm_id in 
planet_osm_polygon, for relations or closed ways, respectively.

* At least, it does so in 
http://nominatim.openstreetmap.org/details.php?place_id=49949948 but I 
don't know what the bare API result looks like.


More information about the dev mailing list