osm-search / Nominatim

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

Query data by longitude and latitude, admin results lack city level #3437

Closed xdxTao closed 3 months ago

xdxTao commented 3 months ago

Hi

I first used address parsing, and then went to reverse geocoding after getting the longitude and latitude, but the result of reverse geocoding was missing level 5 data in the admin.

https://nominatim.openstreetmap.org/search?1=1&q=合肥市&format=geocodejson&addressdetails=1&accept-language=zh&limit=1 https://nominatim.openstreetmap.org/reverse?format=geocodejson&lat=31.8665676&lon=117.281428&addressdetails=1&accept-language=zh&limit=1

image


There are similar questions: [120.264405,30.24526]、[87.51623,43.767755].



  1. I want to import data to my own server now. I want to know how to choose the right data source? Currently, the data I downloaded from https://download.geofabrik.de/asia.html and https://download.openstreetmap.fr/extracts/asia/ for China is not very accurate.

  2. I would like to ask, if I download data for a larger area, will it be more accurate? For example, the whole of Asia. Can you tell me where the data source used by the nominatim online API is downloaded from? Or is it directly imported from the entire planet's 75G?

  3. If I encounter similar data problems in the subsequent use, how should I fix it myself?

The problem of incorrect data has troubled me for a week. I look forward to your reply. Thank you again

mtmail commented 3 months ago

I don't know if that helps you enough, but you can add &zoom=6 to the /reverse search and it shows a level5 entry for me.

Importing Asia is a good idea. The issue you had with Tibet was the southern China boundaries and importing more should help in that case. Alternatively you can also create your own extract (https://docs.osmcode.org/osmium/latest/osmium-extract.html) but then updating it later is a bit harder.

nomimatim.openstreetmap.org imported the whole planet many months ago and updates itself with minutely updates.

If I encounter similar data problems in the subsequent use, how should I fix it myself?

Check if there are other users of Chinese OSM data who might have had similar issues. https://openstreetmap.community/ lists some contact channels. I had an issue with the admin levels in the format=geocodejson myself and only changing my Nominatim code (Python programming language) helped.

xdxTao commented 3 months ago

Indeed, when I added the &zoom parameter, the abnormal data returned to normal.

But my self-built service still doesn't work, so I think it's because there is a problem with the data I imported.


nomimatim.openstreetmap.org imported the whole planet many months ago and updates itself with minutely updates.

Can I understand that your data is the same as the data of the entire planet, but it is not the latest. But in essence, you have not processed the data twice.



Thank you very much for your prompt reply, which solved my problem.