Open hbruch opened 6 years ago
Nominatim place_ids are unique, but Photon currently does not import places from Nominatim's location_postcode
table.
Postcodes are complicated. Usually there is no single object in OSM which describes a single postcode, so when Nominatim returns a postcode result, it is from the location_postcode
tables of artificial postcode centroids. They do have a unique place id, but no separate details page, i.e. when you ask for details you get those of the parent boundary. You can think about importing location_postcode
but you should consider de-duplicating the postcodes which do have an OSM object first.
As for the UK, it is treated a bit special because Nominatim can use an external postcode source for it to augment the location_postcode
table with postcodes that are missing in OSM. Same is true for the US.
Note that the introduction of the location_postcode
table means a bit of a regression for photon because the artificial postcodes used to be in the placex
table and therefore be imported.
Given that geolocation from post codes using open data is a now a solved problem, as demonstrated postcodes.io, which is itself is an open source (see #593), is there something blocking Photon from duplicating postcodes.io's approach, or otherwise implementing complete GB post code geolocation?
The current GB geolocation capabilities of Photon make for a very poor downstream experience in applications like GNOME Maps.
As usually with these things: the main blocker is a lack of people willing to make PRs.
The following Photon UK postcode searches return better matches in Nominatim.
When I view the Nominatim result's html source, I see the search finds a place:postcode, e.g.
However, the details link for the above place_id=181154732 does not show the expected place:postcode but a boundary:administrative.
The reverse geocoding request in Photon neither returns the expected place.
Seems to me, that the Nominatim place_id is not unique (@lonvia, could you confirm this?).
Should this hold true, Photon will overwrite Nominatim places, as the ES document UId is deduced from the Nominatim place id and hence the place:postcode would not exist in the Photon index.