From singal.mayank at gmail.com Thu Sep 5 20:08:39 2019 From: singal.mayank at gmail.com (MAYANK SINGAL) Date: Fri, 6 Sep 2019 01:38:39 +0530 Subject: [Geocoding] Why Places over using OSM objects Message-ID: 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? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lonvia at denofr.de Thu Sep 5 20:26:51 2019 From: lonvia at denofr.de (Sarah Hoffmann) Date: Thu, 5 Sep 2019 21:26:51 +0100 Subject: [Geocoding] Why Places over using OSM objects In-Reply-To: References: Message-ID: <20190905202651.5aolqor6aeoa7p44@denofr.de> 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