I’d like to implement reverse geocoding from OSM database.
From lat,lon → node
Node → way (Current_way_nodes table)
From Way Id, I can get some tags from current_way_tags.
My questions is how can I composite these tags into a complete address.
May be the format are like ‘door number, street, city, state(province), country’.
The current_way_nodes have ‘name’ tag, some time the name is a street name, other time it will be a city name. How do I know them exactly.
First of all Openstreetmap lacks data, it’s especially sparse on:
house numbers
postal codes
postal addresses
even countries
Just so you know, you can stil build this in areas where you have good OSM coverage, but you will still have problems like wether something is in the US or Mexico.
What do you mean? Many objects in OSM have names, nodes as well as ways, usually nodes are places like cities and musuems, and the ways represents streets…
Streets are usually ways tagged highway=“somthing”
Places nodes tagged with place=“something”.
House numbers,postal code have no good standard that I know of.