GNOME Bugzilla – Bug 740957
Add osm-type property
Last modified: 2014-12-03 11:50:56 UTC
The osm id is only unique within an object type. It would be nice to add the osm-type property so that we can identify the result from a search to an osm object.
Created attachment 291869 [details] [review] place: Add osm-type property The osm type specifies if the place is a node a place or a relation. The osm id is only unique within the object type so this is needed in order for the osm-id to have a meaning.
Created attachment 291872 [details] [review] place: Add osm-type property The osm type specifies if the place is a node a place or a relation. The osm id is only unique within the object type so this is needed in order for the osm-id to have a meaning.
Created attachment 292046 [details] [review] place: Add osm-type property The osm type specifies if the place is a node a place or a relation. The osm id is only unique within the object type so this is needed in order for the osm-id to have a meaning.
Review of attachment 292046 [details] [review]: Looks fine otherwise. ::: geocode-glib/geocode-forward.c @@ +641,3 @@ + + if (g_str_equal (key, "osm_type")) { + if (g_str_equal (value, "node")) { As you've registered an enum, you should be able to do something like: GEnumClass *class = G_ENUM_CLASS(...); GEnumValue *evalue = g_enum_get_value_by_nick (class, value); if (evalue) g_object_set (G_OBJECT (place), "osm-type", evalue->value, NULL); else g_warning ("Unsupported osm-type %s", value); ::: geocode-glib/geocode-place.h @@ +147,3 @@ + * @GEOCODE_PLACE_OSM_TYPE_NODE: Defines a point in space. + * @GEOCODE_PLACE_OSM_TYPE_RELATION: Used to explain how other elements work together. + * @GEOCODE_PLACE_OSM_TYPE_WAY: Defines a linear feature and area boundries. boundaries
Review of attachment 292046 [details] [review]: Thanks for review!
Created attachment 292062 [details] [review] place: Add osm-type property The osm type specifies if the place is a node a place or a relation. The osm id is only unique within the object type so this is needed in order for the osm-id to have a meaning.
Review of attachment 292062 [details] [review]: Looks good to commit after the ref leak fix. ::: geocode-glib/geocode-forward.c @@ +641,3 @@ + + if (g_str_equal (key, "osm_type")) { + gpointer ref = g_type_class_ref (geocode_place_osm_type_get_type ()); Don't forget g_type_class_unref()