mediagis / nominatim-docker

100% working container for Nominatim
Creative Commons Zero v1.0 Universal
1.08k stars 443 forks source link

Insufficient Data #583

Open AIML-ankit opened 3 days ago

AIML-ankit commented 3 days ago

Describe the bug I Build the OWN OSM by below command build successfully but it's not giving information for class, type, place_rank and importance column.

Command to Build -

docker run -it -e PBF_URL=https://download.geofabrik.de/north-america/us/illinois-latest.osm.pbf -e REPLICATION_URL=https://download.geofabrik.de/north-america/us/illinois-updates/ -e IMPORT_WIKIPEDIA=true -e IMPORT_US_POSTCODES=true -e IMPORT_STYLE=extratags -e IMPORT_TIGER_ADDRESSES=true --shm-size=30g -p 8080:8080 --name nominatim mediagis/nominatim:4.4

Expected behavior 'class': 'type': 'place_rank': 'importance':

Above columns data should be there but not present in OWN OSM server. i tested for 1000 records, same issue. .

Screenshots & Logs

Local server Test

from shapely.geometry import Point from geopy.geocoders import Nominatim point = Point(-88.27359644571939,42.21781794230143) geo_locator = Nominatim(domain=local_server, scheme='http') res = geo_locator.reverse((point.y, point.x), exactly_one=True) res.raw

{'place_id': 1310910, 'licence': 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright', 'osm_type': 'way', 'osm_id': 255773224, 'lat': '42.2170837', 'lon': '-88.27399593831584', 'display_name': 'Sage Products, New Haven Drive, Cambria, Cary, McHenry County, 60013, United States', 'address': {'building': 'Sage Products', 'road': 'New Haven Drive', 'residential': 'Cambria', 'town': 'Cary', 'county': 'McHenry County', 'postcode': '60013', 'country': 'United States', 'country_code': 'us'}, 'boundingbox': ['42.2162802', '42.2185722', '-88.2754137', '-88.2725732']}

Nominatim server -

from shapely.geometry import Point from geopy.geocoders import Nominatim point = Point(-88.27359644571939,42.21781794230143) geo_locator = Nominatim(user_agent="message is not") res = geo_locator.reverse((point.y, point.x), exactly_one=True) res.raw

{'place_id': 324241635, 'licence': 'Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright', 'osm_type': 'way', 'osm_id': 363362535, 'lat': '42.21902048769007', 'lon': '-88.27359799251208', 'class': 'highway', 'type': 'tertiary', 'place_rank': 26, 'importance': 0.10000999999999993, 'addresstype': 'road', 'name': 'Three Oaks Road', 'display_name': 'Three Oaks Road, Cary, McHenry County, Illinois, 60013, United States', 'address': {'road': 'Three Oaks Road', 'town': 'Cary', 'county': 'McHenry County', 'state': 'Illinois', 'ISO3166-2-lvl4': 'US-IL', 'postcode': '60013', 'country': 'United States', 'country_code': 'us'}, 'boundingbox': ['42.2190180', '42.2190210', '-88.2738994', '-88.2720590']}

Desktop / Server (please complete the following information):

Additional context Please share if i missed anything while building the server or i need to run any additional command. i want class,type,place_rank and importance date in local API query.

mtmail commented 3 days ago

nominatim.openstreetmap.org runs Nominatim 4.5. It's output is generated by the new Python frontend. The Docker Nominatim 4.4 is still using the legacy PHP frontend.

Try setting the format to jsonv2 https://nominatim.org/release-docs/latest/api/Output/ Looking at the geopy source code I don't see that's possible, it hardcodes json.

https://geocoder.readthedocs.io/providers/OpenStreetMap.html#nominatim-server uses jsonv2 it seems