OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2019-01-24 13:08:57

jeremy_rutman
Member
Registered: 2019-01-14
Posts: 18

difference between nominatim lookup and osm lookup

I am puzzling over the following:

https://nominatim.openstreetmap.org/loo … 1271595261  produces no results while
https://www.openstreetmap.org/node/1271595261 gives results - why would this be ? I need to do this programmatically and thus the nominatim is necessary, I believe.

Offline

#2 2019-01-24 14:21:00

kocio
Administrator
From: Warszawa
Registered: 2013-09-04
Posts: 3,177
Website

Re: difference between nominatim lookup and osm lookup

Maybe because this node does not carry any tags? Try it with this one for example:

https://www.openstreetmap.org/node/4360749904
https://nominatim.openstreetmap.org/loo … 4360749904

Offline

#3 2019-01-24 14:52:26

jeremy_rutman
Member
Registered: 2019-01-14
Posts: 18

Re: difference between nominatim lookup and osm lookup

yes I suppose that would explain it, thank you

Offline

#4 2019-01-24 15:11:34

jeremy_rutman
Member
Registered: 2019-01-14
Posts: 18

Re: difference between nominatim lookup and osm lookup

jeremy_rutman wrote:

yes I suppose that would explain it, thank you

whoops , not so fast hmm

https://nominatim.openstreetmap.org/loo … =N32870515

and

https://www.openstreetmap.org/node/32870515

belie this otherwise-alluring explanation

Offline

#5 2019-01-24 15:44:20

TZorn
Member
From: Leverkusen
Registered: 2015-06-02
Posts: 601

Re: difference between nominatim lookup and osm lookup

The node is certainly known to Nominatim: https://nominatim.openstreetmap.org/det … _id=194799

I wonder if it has to do with the one node being part of a relation and the other not? Just guessing.

But I seriously wonder how a city can simultaneously be a water tower. https://www.openstreetmap.org/node/32870515

Offline

#6 2019-01-26 14:32:11

jeremy_rutman
Member
Registered: 2019-01-14
Posts: 18

Re: difference between nominatim lookup and osm lookup

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 ? sad

Last edited by jeremy_rutman (2019-02-04 09:38:55)

Offline

#7 2019-02-03 13:24:08

jeremy_rutman
Member
Registered: 2019-01-14
Posts: 18

Re: difference between nominatim lookup and osm lookup

can someone with the requisite knowledge weigh in here? I seem to be forced to lookup by place id, is this standard practice?

Offline

#8 2019-02-03 14:01:47

GerdP
Member
Registered: 2015-12-18
Posts: 631

Re: difference between nominatim lookup and osm lookup

I don't understand why you ask nominatim when you already know the node id.

Offline

#9 2019-02-03 23:16:28

SomeoneElse
Member
Registered: 2010-10-13
Posts: 991

Re: difference between nominatim lookup and osm lookup

jeremy_rutman wrote:

can someone with the requisite knowledge weigh in here? I seem to be forced to lookup by place id, is this standard practice?

What is it you are actually trying to do?  If people can understand that they might be able to help.

Offline

#10 2019-02-04 09:17:33

jeremy_rutman
Member
Registered: 2019-01-14
Posts: 18

Re: difference between nominatim lookup and osm lookup

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.

However nominatim (https://nominatim.openstreetmap.org) will in many cases return nothing for a node, while the openstreetmap site (https://www.openstreetmap.org/node/) will at least recognize the node and further show some of the details that I am interested in.

I would like to get the node and extra information usually available from nominatim but am not clear why no results are forthcoming from a simple lookup for many nodes (eg 
https://nominatim.openstreetmap.org/loo … xtratags=1  returns nothing , and
https://nominatim.openstreetmap.org/rev … ormat=json returns 'unable to geocode',
while the osm lookup
https://www.openstreetmap.org/node/32870515  returns the node details plus extra information such as is_in info ).

In other cases nominatim does fine, eg.
https://nominatim.openstreetmap.org/loo … xtratags=1

Last edited by jeremy_rutman (2019-02-04 10:24:29)

Offline

#11 2019-02-04 09:20:26

jeremy_rutman
Member
Registered: 2019-01-14
Posts: 18

Re: difference between nominatim lookup and osm lookup

GerdP wrote:

I don't understand why you ask nominatim when you already know the node id.

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.

Last edited by jeremy_rutman (2019-02-04 11:14:47)

Offline

#12 2019-02-04 10:35:29

GerdP
Member
Registered: 2015-12-18
Posts: 631

Re: difference between nominatim lookup and osm lookup

jeremy_rutman wrote:

while the osm lookup
https://www.openstreetmap.org/node/32870515  returns the node details plus extra information such as is_in info ).

Risking to state the obvious: The is_in information is not computed, it is a tag of the node added by a mapper.

Offline

#13 2019-02-04 11:16:04

jeremy_rutman
Member
Registered: 2019-01-14
Posts: 18

Re: difference between nominatim lookup and osm lookup

GerdP wrote:
jeremy_rutman wrote:

while the osm lookup
https://www.openstreetmap.org/node/32870515  returns the node details plus extra information such as is_in info ).

Risking to state the obvious: The is_in information is not computed, it is a tag of the node added by a mapper.

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?

Last edited by jeremy_rutman (2019-02-04 11:25:25)

Offline

#14 2019-02-04 11:24:27

GerdP
Member
Registered: 2015-12-18
Posts: 631

Re: difference between nominatim lookup and osm lookup

I guess that nominatim doesn't store the information for all nodes in the OSM db, only for those which have a place_id.

Offline

#15 2019-02-04 11:35:47

jeremy_rutman
Member
Registered: 2019-01-14
Posts: 18

Re: difference between nominatim lookup and osm lookup

GerdP wrote:

I guess that nominatim doesn't store the information for all nodes in the OSM db, only for those which have a place_id.

It seems to be true.

Node 54 for instance representing the major city Novosibirsk has no place id and thus the nominatim node id search returns nothing. hmm 
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.

Last edited by jeremy_rutman (2019-02-04 11:45:21)

Offline

#16 2019-02-04 11:47:54

GerdP
Member
Registered: 2015-12-18
Posts: 631

Re: difference between nominatim lookup and osm lookup

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.

Edit: I described this here: https://forum.openstreetmap.org/viewtop … 00#p692800

(1) http://www.mkgmap.org.uk/

Last edited by GerdP (2019-02-04 11:50:33)

Offline

Board footer

Powered by FluxBB