[Geocoding] Why Places over using OSM objects
Sarah Hoffmann
lonvia at denofr.de
Thu Sep 5 20:26:51 UTC 2019
Hi,
On Fri, Sep 06, 2019 at 01:38:39AM +0530, MAYANK SINGAL wrote:
> Why nominatim and similar systems creates a Place object over directly
> working on OSM objects? I am assuming Place is just a view model with no
> data being stored by itself. Is there a good document to read more about
> it?
A Nominatim Place object is essentially an OSM object with some pre-procesing
on top. Tags that are relevant for geocoding are saved separately (e.g. names
or address tags) etc.
If you are asking why Nominatim is always working with place_ids instead of
simply using OSM ids, the answer is twofold. For one thing, OSM ids are only
unique in the combination of type (node, way, relation) and id. That means
internally we'd need to work with composite keys, which is not always the
most efficient in Postgresql. More importantly, however, a single OSM object
may actually be represented by more than one Place. The reason for this is
that each Place has a unqiue type (class/type) which corresponds to a single
tag of the OSM tag. Nominatim identifies a list of 'main keys' that define
the type of an OSM object, like highway, amenity or landuse. Sometimes an OSM
object has multiple main tags (for example, a bridge has the main tags 'bridge'
and 'highway'). Nominatim creates a separate Place object for each main tag
then. The main tags can be configured in the import style, see
http://nominatim.org/release-docs/latest/develop/Import/#configuring-the-import
Kind regards
Sarah
More information about the Geocoding
mailing list