osm-search / Nominatim

Open Source search based on OpenStreetMap data
https://nominatim.org
GNU General Public License v3.0
2.98k stars 701 forks source link

Place returned by Overpass not found with Nominatim `Search By ID` #3452

Closed GniLudio closed 2 weeks ago

GniLudio commented 2 weeks ago

What did you search for?

When I use the following query in Overpass for the german state Schleswig-Holstein (Link)

[out:csv(::id)];
relation['de:amtlicher_gemeindeschluessel'='01'];
out;

it returns two relations which represent roughly the same area (51529, 62775)

@id
51529
62775

If I use the second ID for Search By ID in Nominatim (Link), I get an error:

No place with that OSM ID found. 

What result did you get?

No place with that OSM ID found.

What result did you expect?

The details of the relation with ID 62775: Relation 62775 on OpenStreetMap

Further details

None.

mtmail commented 2 weeks ago

Nominatim by default doesn't import boundary=land_area (https://github.com/osm-search/Nominatim/blob/master/settings/import-extratags.lua near line 85). As you've seen it often leads to duplicates with boundary-administrative of the same name.

What did you hope to be able to do with the result data?

GniLudio commented 2 weeks ago

Nominatim by default doesn't import boundary=land_area (https://github.com/osm-search/Nominatim/blob/master/settings/import-extratags.lua near line 85). As you've seen it often leads to duplicates with boundary-administrative of the same name.

What did you hope to be able to do with the result data?

I want to get the GeoJSON of places in germany by their 'de:amtlicher_gemeindeschluessel' and 'de:regionalschluessel'. So I get the IDs from Overpass and then tried to get the GeoJSON from Nominatim, but that didn't work for this one.

But now I know that I should just ignore land_areas.

mtmail commented 2 weeks ago

https://github.com/tyrasd/osmtogeojson can convert Overpass output to geojson. There are many (https://github.com/tmcw/awesome-geojson), some even have the same name, but this one worked for me on a similar project.