NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi everyone,

I installed locally nominatim via docker image, using the following docker-compose

services:
  nominatim:
    container_name: nominatim
    image: mediagis/nominatim:4.2
    volumes:
      - ./volumes/sources:/nominatim/sources
      - nominatim-data:/var/lib/postgresql/14/main
    environment:
      - PBF_PATH=/nominatim/sources/freiburg-regbez-latest.osm.pbf
      - REVERSE_ONLY=true
    ports:
      - "8080:8080"
    restart: always
    shm_size: 4gb

the image is the latest available and the pbf file is fresh new.

I realized that the query https://nominatim.openstreetmap.org/reverse?lat=48.45851286058211&lon=7.885465667596962&format=json&accept-language=en online shows the field "address.state" and enriches also the "display_name" with the same information, while the local one doesn't.

Online response:

{
  "place_id": 181685288,
  "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
  "osm_type": "way",
  "osm_id": 318873074,
  "lat": "48.45858375",
  "lon": "7.8852782999999995",
  "display_name": "12, Vogesenstraße, Schutterwald, Verwaltungsgemeinschaft Offenburg, Ortenaukreis, Baden-Württemberg, 77746, Germany",
  "address": {
    "house_number": "12",
    "road": "Vogesenstraße",
    "village": "Schutterwald",
    "municipality": "Verwaltungsgemeinschaft Offenburg",
    "county": "Ortenaukreis",
    "state": "Baden-Württemberg",
    "ISO3166-2-lvl4": "DE-BW",
    "postcode": "77746",
    "country": "Germany",
    "country_code": "de"
  },
  "boundingbox": [
    "48.4585076",
    "48.4586599",
    "7.8851729",
    "7.8853837"
  ]
}

Local response:

{
  "place_id": 814300,
  "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
  "osm_type": "way",
  "osm_id": 318873074,
  "lat": "48.45858375",
  "lon": "7.8852782999999995",
  "display_name": "12, Vogesenstraße, Schutterwald, Verwaltungsgemeinschaft Offenburg, Ortenaukreis, 77746, Germany",
  "address": {
    "house_number": "12",
    "road": "Vogesenstraße",
    "village": "Schutterwald",
    "municipality": "Verwaltungsgemeinschaft Offenburg",
    "county": "Ortenaukreis",
    "postcode": "77746",
    "country": "Germany",
    "country_code": "de"
  },
  "boundingbox": [
    "48.4585076",
    "48.4586599",
    "7.8851729",
    "7.8853837"
  ]
}

Does anybody know why I'm missing the "state" information locally? I double-checked on the general configuration of the docker image, but I couldn't find anything relevant related to Germany addresses.

Thanks for your help! Roberto

asked 22 Dec '22, 16:15

RMeloni00's gravatar image

RMeloni00
16113
accept rate: 0%

edited 22 Dec '22, 16:15


The extract you are using doesn't have the full state boundary of Baden-Würtemberg. That is why it doesn't show up in the result. Use http://download.geofabrik.de/europe/germany/baden-wuerttemberg-latest.osm.pbf and you should be fine.

permanent link

answered 22 Dec '22, 16:51

lonvia's gravatar image

lonvia
6.2k25789
accept rate: 40%

Hi lonvia,

thank you very much for your answer, indeed it was that.

Out of curiosity, where can I find some doc to better understand how it works? I mean...that extract doesn't have the full boundary of Germany either, but the country is displayed anyway. Of course, it's the country, so that might be differently handled but still I'm curious of how it works!

Thanks again for your help!

(23 Dec '22, 10:18) RMeloni00
1

Nominatim has a fallback for countries but that's all. For any other boundaries, you either need to make sure your extract covers all of it or manually add the boundaries to the extract before import. Sadly, the latter requires some level of insight into how OSM works. I can't offer a simple solution.

(23 Dec '22, 11:16) lonvia

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×689
×85
×10

question asked: 22 Dec '22, 16:15

question was seen: 1,419 times

last updated: 23 Dec '22, 11:16

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum