How to fix these issues with routing to specific address?

Okay - so routing to “an address” is a multiple step approach.

  1. You do a “Geocoding” of that address. Typically you get a building outline. As routing does not work to an “area” but just a point we take the Geometric Center of the building outline.
  2. The router tries to match the address point you just got (The center of the building) to the nearest point on the routable network (Here typically ONLY the roads for your type of transport are taken into account - so in case you are using Car Transport footways are not considered)
  3. You are beeing sent to that location on the road network.

So now multiple things may go wrong and are in parts unsolvable with the current OSM Data Model.

a) In case you have huge buildings the geometric center may be not the optimal point to use.
This can be solved by not putting all the Address/POI information on the building outline but on a node within the building outline
b) The nearest road to the point you try to reach is on a road which does not have access to your destination. Typically the “alley” is nearer to the center of the building than the front road. So you get sent to the backyard alley road.
This is basically unfixable without “faking” data.
c) Excessive access tagging like putting an access=private on all driveways complicates the situation as those roads are “inaccessible” for the “nearest point on the usable road network”

I started multiple discussions about this in the past that for some corner cases we will need a relation to model the “destination/mode of transport → route to this exact point”
But this is 10 years in the future when more people discover these issues.

Here is a visualisation for addresses in Nortrhine-Westfalia - a part of Germany. The pin is the address and the line points to the nearest point on the usable road network (Generated with OSRM nearest call)

Scroll around a bit and you’ll find the nearest point be in motorways, on the other side of canals, railway lines etc.

https://osm.zz.de/dbview/?db=addresses-nrw&layer=routeable#51.42571,7.31147,17z

Flo