GNOME Bugzilla – Bug 705112
Reverse geocoding functions should return GeocodePlace object
Last modified: 2013-07-30 13:07:36 UTC
Instead of returning a hashtable, reverse geocoding functions should return a GeocodePlace instance.
Created attachment 250417 [details] [review] lib: Separate function to determine place type Separate out code to determine place type from attributes in to a separate function: get_place_type_from_attributes().
Created attachment 250418 [details] [review] lib: One dedicated function to create GeocodePlace object We already have a function to create the GeocodePlace instance from Nominatim attributes, create_place_from_attributes(). We should initialize all props of these instances from within that function, rather than doing it soon after calling it.
Created attachment 250419 [details] [review] lib: Export create_place_from_attributes library-wide Make create_place_from_attributes available to other files by exporting it library-wide as _geocode_create_place_from_attributes().
Created attachment 250420 [details] [review] lib: Add new place getter/setters to symbols file
Created attachment 250421 [details] [review] lib: geocode_reverse_resolve*() now returns GeocodePlace Instead of returning a hashtable, reverse geocoding functions now return a GeocodePlace instance.
Created attachment 250422 [details] [review] lib: Remove now redundant code Remove now redundant code to translate Nominatim to XEP attributes.
Review of attachment 250417 [details] [review]: Looks fine.
Review of attachment 250418 [details] [review]: Looks good.
Review of attachment 250419 [details] [review]: Looks good.
Review of attachment 250420 [details] [review]: Yes.
Review of attachment 250421 [details] [review]: ::: geocode-glib/geocode-reverse.c @@ +323,3 @@ + GeocodePlace *place; + + place = _geocode_create_place_from_attributes (result); are you leaking the result hashtable here? @@ +509,3 @@ g_object_unref (query); + place = _geocode_create_place_from_attributes (result); Same comment about leaking the hashtable.
Review of attachment 250422 [details] [review]: Success.
Created attachment 250463 [details] [review] lib: geocode_reverse_resolve*() now returns GeocodePlace v2: Don't leak hashtables.
Review of attachment 250463 [details] [review]: Looks good.
Attachment 250417 [details] pushed as d72aee7 - lib: Separate function to determine place type Attachment 250418 [details] pushed as 8ba11ad - lib: One dedicated function to create GeocodePlace object Attachment 250419 [details] pushed as 26093f2 - lib: Export create_place_from_attributes library-wide Attachment 250420 [details] pushed as 40d2d51 - lib: Add new place getter/setters to symbols file Attachment 250422 [details] pushed as d64d4f1 - lib: Remove now redundant code Attachment 250463 [details] pushed as fad7155 - lib: geocode_reverse_resolve*() now returns GeocodePlace