Nominatim/Development overview
Contents |
Overview
Nominatim comprises of:
- osm2pgsql output routine
- postgresql module
- set of plpgsql functions
- php management / interface
Nominatim indexes all named features and a selection of points of interest and provides search, reverse geocoding and some gazetteer functionality.
Tags Processed
The following name tags are currently imported
Names
- ref
- iata
- icao
- pcode:1
- pcode:2
- pcode:3
- un:pcode:1
- un:pcode:2
- un:pcode:3
- name
- name:*
- int_name
- int_name:*
- nat_name
- nat_name:*
- reg_name
- reg_name:*
- loc_name
- loc_name:*
- old_name
- old_name:*
- alt_name
- alt_name:*
- official_name
- official_name:*
- commonname
- commonname:*
- common_name
- common_name:*
- place_name
- place_name:*
- short_name
- short_name:*
(This list was extended on 25/2/2010 but no existing data was re-imported)
Country
- country_code_iso3166_1_alpha_2
- country_code_iso3166_1
- country_code_iso3166
- country_code
- iso3166-1
- ISO3166-1
- iso3166
- is_in:country_code
- addr:country (if 2 char long)
- addr:country_code
Postcodes
- postal_code
- post_code
- postcode
- addr:postcode
Is In
- is_in
- is_in:*
- addr:country (if longer than 2 char)
- addr:county
- addr:city
- addr:state
House Numbers
- addr:housenumber
- addr:interpolation
Street
- addr:street
Indexing / Address Calculation
Country to Street level
All indexed features are converted to a simple heirachy (rank) of importance with points scored between 0 and 30 (where 0 is most important). Rank takes account of differences in interpretation between different countries but is generally calculated as:
- For administrative boundaries: admin_level * 2
- Continent, Sea: 2
- Country: 4
- State: 8
- Region: 10
- County: 12
- City: 16
- Island, Town, Moor, Waterways : 17
- Village, Hamlet, Municipality, District, Borough, Airport, National Park: 18
- Suburb, Croft, Subdivision, Farm, Locality, Islet: 20
- Hall of Residence, Neighbourhood, Housing Estate, Landuse (polygon only): 22
- Airport, Street, Road: 26
- Paths, Cycleways, Service Roads, etc.: 27
- House, Building: 28
- Postcode: 11 - 25, Depends on country
- Other: 30
For each feature down to level 26 (street level) a list of parents are calculated using the following algorithm:
- All polygon / multi-polygon areas which contain this feature (in order of size)
- All items by name listed in the is_in are searched for within the current country (in no particular order)
- The nearest feature for each higher rank, and all others within 1.5 times the distance to the nearest (in order of distance)
and a list of keywords are generated from those features.
During the indexing process an address is also calculated using the first feature found for each level. Where an is_in value is provided it is used to filter the address.
Building Indexing
Buildings, houses and other lower than street level features (i.e. Bus Stops, Phone Boxes, etc) are indexed by relating them to their most appropriate nearby street.
The street is calculated as:
- the street member of an associatedStreet relation
- if the node is part of a way:
- if this way is street level, than that street
- the street member of an associatedStreet relation that this way is in
- a street way with 50/100 meters and parallel with the way we are in
- a nearby street with the name given in addr:street of the feature we are in or the feature we are part of
- the nearest street (up to 3 miles)
- not linked
All address information is then obtained from the street. As a result addr:* tags on low level features are not processed (except as above).
For interpolated ways simple numerical sequences are extrapolated (alpha numerical sequences are not currently handled) and additional building nodes are inserted into the way by duplicating the first (lowest) house number in the sequence.
Search Algorithm
TODO