I don’t believe lookup by place id is recommended practice since the placeid can change per installation , iiuc. I am looking for how to get this data doing a node_id lookup - if there is no way to do it then I guess I will give up and use the placeid - anyone know what’s going on ?
I am trying to get extra details about certain nodes from nominatim . For instance for cities in south america , I would like details such as containing district, country, altnames, etc.
To get a list of nodes e.g. representing s. america cities I can use osmfilter on the relevant .osm file.
With this list of nodes I can programmatically query nominatim to get the info I am after , to end up with a list of cities and containing districts.
I am looking for the data about the node that nominatim sometimes provides and osm usually provides, for instance within which city/state/country the node resides, alt names, etc.
Yes, the is_in is in the node tags (and is not always provided) ; in this case I misspoke and am looking for the extra computed info ; containing county/district/country etc. (computed information in the style of the is_in tags, namely what objects contain the node) .
There is a fundamental question here , namely why nominatim returns ‘cannot geocode’ for many nodes when using the api node lookup functions (lookup and reverse) . I wonder what is going on behind the scenes at the openstreetmap.org lookup , if it is augmenting nominatim somehow?
Node 54 for instance representing the major city Novosibirsk has no place id and thus the nominatim node id search returns nothing.
I suppose what I need to do for such cases is search by name and area and hope to find other entities (ways/relations) that do have place ids; this is somewhat annoying since then I have to disambiguate the potential multiple results; the nice thing about a node lookup is the node serves as uid.
It seems somewhat more involved than necessary; is there some reason not every node tagged ‘city’ gets the honor of a place id (or alternately why nominatim will not return anything but items with place id?)
Now that i think of it I suppose in my original osmfilter run I should find not only nodes but also ways and relations tagged as city , and perhaps of those at least one will have a place id and thus be found in nominatim.
In any case thanks for your help, this has been useful.
Just in case it might help: In the mkgmap project (1) we compute a file bounds.zip which contains the admin boundaries in a way that allows
to retrieve the wanted information for any position. In mkgmap it is used to fill search indexes.
You can use this functionality to produce a file that contains the osm id and the enclosing boundaries.