[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Maposmatic-dev] Questions on Nominatim and administrative boundarie
Re: [Maposmatic-dev] Questions on Nominatim and administrative boundaries + osm2pgsql
Sun, 20 Dec 2009 12:18:36 +0100
Thunderbird 18.104.22.168 (Windows/20090812)
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.