geocodingreverse-geocodingnominatim

Nominatim reverse Geocoding not working Highway entrance/exit (motorway_link)


Hi I have nominatim installed on a ubuntu VM which I use for reverse geo-lookup. All is going well, but nominatim doesn't return the correct object when I do a reverse lookup for a highway entrance (motorway_link): enter image description here

I found a github issues thread from 2 years ago providing solutions. One of the solutions being changing the address rank for motorway_links from 27 to 26 and the other one being altering the style import file. None of these seem to work for me. Has anyone had any expierence with this? I'm using the latest version of nominatim.

This is the highway section of my Nominatim/settings/import-full.style file:

{
"keys" : ["highway"],
"values" : {
    "no" : "skip",
    "turning_circle" : "skip",
    "mini_roundabout" : "skip",
    "noexit" : "skip",
    "crossing" : "skip",
    "give_way" : "skip",
    "stop" : "skip",
    "street_lamp" : "main,with_name",
    "traffic_signals" : "main,with_name",
    "service" : "main,with_name",
    "cycleway" : "main,with_name",
    "path" : "main,with_name",
    "footway" : "main,with_name",
    "steps" : "main,with_name",
    "bridleway" : "main,with_name",
    "track" : "main,with_name",
    "byway": "main,with_name",
    "motorway_link" : "main",
    "trunk_link" : "main",
    "primary_link" : "main",
    "secondary_link" : "main",
    "tertiary_link" : "main",
    "" : "main"
}

Content of the highway section of nominatim/settings/import-address.style:

{
"keys" : ["highway"],
"values" : {
    "motorway" : "main",
    "trunk" : "main",
    "primary" : "main",
    "secondary" : "main",
    "tertiary" : "main",
    "unclassified" : "main",
    "residential" : "main",
    "living_street" : "main",
    "pedestrian" : "main",
    "road" : "main",
    "service" : "main,with_name",
    "cycleway" : "main,with_name",
    "path" : "main,with_name",
    "footway" : "main,with_name",
    "steps" : "main,with_name",
    "bridleway" : "main,with_name",
    "track" : "main,with_name",
    "byway": "main,with_name",
    "motorway_link" : "main",
    "trunk_link" : "main,with_name",
    "primary_link" : "main,with_name",
    "secondary_link" : "main,with_name",
    "tertiary_link" : "main,with_name"
}

highway section of nominatim/settings/address-levels.json:

   "highway" : {
      "" : 30,
      "service" : 27,
      "cycleway" : 27,
      "path" : 27,
      "footway" : 27,
      "steps" : 27,
      "bridleway" : 27,
      "motorway_link" : 26,
      "primary_link" : 27,
      "trunk_link" : 27,
      "secondary_link" : 27,
      "tertiary_link" : 27,
      "residential" : 26,
      "track" : 26,
      "unclassified" : 26,
      "tertiary" : 26,
      "secondary" : 26,
      "primary" : 26,
      "living_street" : 26,
      "trunk" : 26,
      "motorway" : 26,
      "pedestrian" : 26,
      "road" : 26,
      "construction" : 26
  },

Solution

  • So I have solved. If you look in the nominatim/settings/env.defaults file, you'll see the following lines of code:

    # Configuration file for OSM data import.
    # This may either be the name of one of an internal style or point
    # to a file with a custom style.
    # Internal styles are: admin, street, address, full, extratags
    NOMINATIM_IMPORT_STYLE=extratags
    

    This means that you'll need to alter the extratags-import.style file to allow unnamed motorway_links aswell.

    So change the highway section in nominatim/settings/extratags-import.style from this:

    {
    "keys" : ["highway"],
    "values" : {
        "no" : "skip",
        "turning_circle" : "skip",
        "mini_roundabout" : "skip",
        "noexit" : "skip",
        "crossing" : "skip",
        "give_way" : "skip",
        "stop" : "skip",
        "street_lamp" : "main,with_name",
        "traffic_signals" : "main,with_name",
        "service" : "main,with_name",
        "cycleway" : "main,with_name",
        "path" : "main,with_name",
        "footway" : "main,with_name",
        "steps" : "main,with_name",
        "bridleway" : "main,with_name",
        "track" : "main,with_name",
        "byway": "main,with_name",
        "motorway_link" : "main,with_name",
        "trunk_link" : "main,with_name",
        "primary_link" : "main,with_name",
        "secondary_link" : "main,with_name",
        "tertiary_link" : "main,with_name",
        "" : "main"
    }
    

    to this:

    {
    "keys" : ["highway"],
    "values" : {
        "no" : "skip",
        "turning_circle" : "skip",
        "mini_roundabout" : "skip",
        "noexit" : "skip",
        "crossing" : "skip",
        "give_way" : "skip",
        "stop" : "skip",
        "street_lamp" : "main,with_name",
        "traffic_signals" : "main,with_name",
        "service" : "main,with_name",
        "cycleway" : "main,with_name",
        "path" : "main,with_name",
        "footway" : "main,with_name",
        "steps" : "main,with_name",
        "bridleway" : "main,with_name",
        "track" : "main,with_name",
        "byway": "main,with_name",
        "motorway_link" : "main",
        "trunk_link" : "main",
        "primary_link" : "main",
        "secondary_link" : "main",
        "tertiary_link" : "main",
        "" : "main"
    }
    

    Altering these lines of code tells nominatim to not skipp unnamed motorway_links during import.

    So if you find yourself having the same issue. Do the following things:

    1. Go to the highway section in nominatim/settings/adress-levels.json and change the address rank of 'motorway_link' from 27 to 26
    2. In the highway section of the import style files (import-full.style, import-address.style, extratags-import.style) change "motorway_link" : "main,with_name" to "motorway_link" : "main"
    3. Reimport the data