GNOME Bugzilla – Bug 726367
Add osm_id as an unique id to GeocodePlace
Last modified: 2014-03-17 11:38:42 UTC
In order to keep places apart that can get the same name from search in GeocodeForward and to be able to edit a place we have found with openstreetmap APIs I want to add the osm_id to GeocodePlace as an "id" property.
Created attachment 271943 [details] [review] place: Add osm_id as unique id Ee can end up with places that have the same name when we search using geocode-forward. It would help to be able to keep them apart. Thus we introduce an unique id. Using the osm_id will also make it possible to reference the place to OpenStreetMap for editing purpopses.
Review of attachment 271943 [details] [review]: While I think its a good idea to have it exposed it as just 'id' otherwise, your mention of apps relying on it to access/modify the place in OSM db makes me thing otherwise. I think this should be exposed as 'osm-id'. We could also provide 'id', which for now can be the same as 'osm-id' but we should document that apps should not rely on them being the same.
Created attachment 272083 [details] [review] place: Add osm-id property We can end up with places that have the same name when we search using geocode-forward. It would help to be able to keep them apart. Having the OpenStreetMap id as a property will also make it possible to reference the place to OpenStreetMap dbs for editing purpopses.
(In reply to comment #2) > Review of attachment 271943 [details] [review]: > > While I think its a good idea to have it exposed it as just 'id' otherwise, > your mention of apps relying on it to access/modify the place in OSM db makes > me thing otherwise. I think this should be exposed as 'osm-id'. We could also > provide 'id', which for now can be the same as 'osm-id' but we should document > that apps should not rely on them being the same. Yeah I agree. About I thought about using "place_id" which is returned from Nominatim, but I am not sure. I haven't found any solid documentation about what exactly it is. I found a question in OSM Help: https://help.openstreetmap.org/questions/21542/nominatim-place-id Where the answer is: "The place_id has no relevance for OSM, it is only an internal Nominatim identifier. Between different Nominatim instances, the place_id for the same OSM object may differ." And since what I want to use the Id for in Maps is making sure the places stored like favorites and recently visited are unique it might not be sufficient. We might want to switch Nominatim instance sometime. But this might be over thinking it a bit.
Review of attachment 272083 [details] [review]: good otherwise. ::: geocode-glib/geocode-place.c @@ +545,3 @@ + */ + pspec = g_param_spec_string ("osm-id", + "OSM Id", Id -> ID @@ +546,3 @@ + pspec = g_param_spec_string ("osm-id", + "OSM Id", + "The OpenStreetMap id of the place", id -> ID @@ +1197,3 @@ + * @place: A place + * + * Gets the OpenStreetMap id of the @place. same here. @@ +1199,3 @@ + * Gets the OpenStreetMap id of the @place. + * + * Returns: The osm id of the @place. and here
Attachment 272083 [details] pushed as bb25e20 - place: Add osm-id property