I am trying to develop an address lookup API (possibly in Json format) from an Openstreetmap extract for my current project. My preferred language is C#.
If anyone can explain me the data/node relationship of osm.pbf extract. I have read the wiki but was unable to figure out the relationship or structure therefore couldn't do much with omssharp either.
So if someone could explain me or give me an example in any language (i just need to understand the logic/relation) how I can search/query based on building name/address string/postcode and get relevant rows in return. As google address lookup works you type an address and it gives you suggestion.
If someone can help me to figure out the data relation, I would prefer any indexing method such as lucene for faster query rather than putting load on SQL Server.
Also, if possible, a logic to find out the driving distance/route between two addresses would be excellent.
FYI: I am using great_britain.osm.pbf (985mb compressed), I have full access to Ubuntu server, can install pgSql. Tried importing in SQL server Express from a workstation with 24gb Memory, 2x6 core 2.9ghz cpu and 1tb SSD but it gives out of memory exception using osm2sql.
Any help would be greatly appreciated.
Thanks
Raw OSM data is only of limited use for geocoding. You will have to preprocess this data first.
The reason is that addresses in OSM don't have to be specified in full format. For example with the widely used Karlsruhe Schema it is sufficient to specify the house number and street name to define a single address. Other information such as city, postcode and country can be left empty. This approach works because in OSM there are separate administrative boundaries for defining municipalities, counties, countries and so on.
Most OSM-based geocoders perform a precalculation step while importing OSM data into their database. This step calculates full address hierarchies by comparing individual address tags against the administrative boundaries they are contained in.
Don't reinvent the wheel. Creating a good geocoder is really hard. Use one of the existing OSM-based geocoders instead.