After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726367 - Add osm_id as an unique id to GeocodePlace
Add osm_id as an unique id to GeocodePlace
Status: RESOLVED FIXED
Product: geocode-glib
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: geocode-glib maintainer(s)
geocode-glib maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-03-14 19:22 UTC by Jonas Danielsson
Modified: 2014-03-17 11:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
place: Add osm_id as unique id (5.29 KB, patch)
2014-03-14 19:22 UTC, Jonas Danielsson
needs-work Details | Review
place: Add osm-id property (5.37 KB, patch)
2014-03-16 18:45 UTC, Jonas Danielsson
committed Details | Review

Description Jonas Danielsson 2014-03-14 19:22:35 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.
Comment 1 Jonas Danielsson 2014-03-14 19:22:55 UTC
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.
Comment 2 Zeeshan Ali 2014-03-15 10:50:33 UTC
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.
Comment 3 Jonas Danielsson 2014-03-16 18:45:50 UTC
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.
Comment 4 Jonas Danielsson 2014-03-16 18:50:27 UTC
(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.
Comment 5 Zeeshan Ali 2014-03-16 19:35:03 UTC
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
Comment 6 Jonas Danielsson 2014-03-17 11:38:38 UTC
Attachment 272083 [details] pushed as bb25e20 - place: Add osm-id property