GNOME Bugzilla – Bug 737979
Further geoURI extensions
Last modified: 2019-03-20 10:40:20 UTC
We already use one of the exensions used by Android, from here: https://developer.android.com/guide/components/intents-common.html geo:0,0?q=lat,lng(label) Show the map at the given longitude and latitude with a string label. Example: "geo:0,0?q=34.99,-106.61(Treasure)" ^^^ This one we use. A question about that. At the moment we only support a label with no whitespace in it. So "MyLocation" would work, but not "My Location". Should that be fixed? geo:0,0?q=my+street+address Show the location for "my street address" (may be a specific address or location query). Example: "geo:0,0?q=1600+Amphitheatre+Parkway%2C+CA" ^^^ Do we want to implement that one? So that we could search via an uri? The set_from_uri would then call out to a forward search I guess.
(In reply to comment #0) > We already use one of the exensions used by Android, from here: > https://developer.android.com/guide/components/intents-common.html > > geo:0,0?q=lat,lng(label) > Show the map at the given longitude and latitude with a string label. > > Example: "geo:0,0?q=34.99,-106.61(Treasure)" > > ^^^ > This one we use. A question about that. At the moment we only support a label > with no whitespace in it. So "MyLocation" would work, but not "My Location". > > Should that be fixed? It definitely should be. But it should be "My%20Location", not "My Location". > geo:0,0?q=my+street+address > Show the location for "my street address" (may be a specific address or > location query). > > Example: "geo:0,0?q=1600+Amphitheatre+Parkway%2C+CA" > > ^^^ > Do we want to implement that one? So that we could search via an uri? > The set_from_uri would then call out to a forward search I guess. That would also be very useful.
Created attachment 288734 [details] [review] location: Fix error handling in uri parsing At the moment calling set_from_uri with error as NULL will cause a segmentation fault. This is because the code assumes error will always be set.
Created attachment 288735 [details] [review] location: Unescape geo uri description Use g_uri_unescape on the description for geo uri formats such as: geo:0,0?q=lat,lon(description) This will allow us to have space in the description by using %20. Example: geo:0,0?q=lat,lon(My%20Location) The above will give a description of "My Location".
(In reply to comment #3) > Created an attachment (id=288735) [details] [review] > location: Unescape geo uri description > > Use g_uri_unescape on the description for geo uri formats > such as: > geo:0,0?q=lat,lon(description) > > This will allow us to have space in the description by > using %20. > > Example: > geo:0,0?q=lat,lon(My%20Location) > > The above will give a description of "My Location". This should go into a gnome-3-14 branch as well I guess.
Review of attachment 288734 [details] [review]: ::: geocode-glib/geocode-location.c @@ +249,2 @@ err: + if (error) { That's not necessary, from the g_set_error_literal docs: Does nothing if err is NULL; if err is non-NULL, then *err must be NULL. @@ +322,3 @@ err: + ret = FALSE; + if (error) { Ditto. @@ +416,3 @@ + if (!parse_geo_uri_parameters (loc, next_token, error)) + ret = FALSE; + You have a linefeed here. @@ +421,3 @@ next_token = end_ptr + 1; + if (!parse_geo_uri_special_parameters (loc, next_token, error)) + ret = FALSE; But not here. @@ +428,3 @@ err: + ret = FALSE; + if (error) { Ditto. @@ +463,3 @@ err: + if (error) { + g_set_error_literal (error, Again.
Review of attachment 288735 [details] [review]: Looks good.
Created attachment 288738 [details] [review] location: Fix error handling in uri parsing At the moment calling set_from_uri with error as NULL will cause a segmentation fault. This is because the code assumes error will always be set.
Review of attachment 288738 [details] [review]: Looks good otherwise. ::: geocode-glib/geocode-location.c @@ +428,3 @@ "Failed to parse geo URI"); + out: + return ret; I would return directly when the out label is used, and remove the out label.
Created attachment 288742 [details] [review] location: Fix error handling in uri parsing At the moment calling set_from_uri with error as NULL will cause a segmentation fault. This is because the code assumes error will always be set.
Review of attachment 288742 [details] [review]: Looks good.
Created attachment 288747 [details] [review] location: Add query extension to geo uri Add parsing support for an additional Geo URI extension from the Android world. Specification: geo:0,0?q=my+street+address Show the location for "my street address" (may be a specific address or location query). Example: "geo:0,0?q=1600+Amphitheatre+Parkway%2C+CA" The description of the location, after a successful call to geocode_location_set_from uri, will be the query parameter, unescaped.
Review of attachment 288747 [details] [review]: This makes geocode_location_new_with_description() blocking... GeocodeLocation should have a way of showing that the coords are unset, so that the front-end can do the search instead.
Comment on attachment 288742 [details] [review] location: Fix error handling in uri parsing Attachment 288742 [details] pushed as b571940 - location: Fix error handling in uri parsing
Comment on attachment 288735 [details] [review] location: Unescape geo uri description Attachment 288735 [details] pushed as fb95a42 - location: Unescape geo uri description
Created attachment 290504 [details] [review] location: Add is_unset function The GeocodeLocation::is_unset function will return TRUE if one of latitude or longitude is unset.
Created attachment 290505 [details] [review] location: Add query extension to geo uri Add parsing support for an additional Geo URI extension from the Android world. Specification: geo:0,0?q=my+street+address Show the location for "my street address" (may be a specific address or location query). Example: "geo:0,0?q=1600+Amphitheatre+Parkway%2C+CA" We will parse this URI, setting the query parameter as the description of the GeocodeLocation and leave the coordinates as unset. Then the application can find out that it needs to perform a forward search to lookup the query.
Created attachment 290506 [details] [review] location: Add is_unset function The GeocodeLocation::is_unset function will return TRUE if one of latitude or longitude is unset.
Created attachment 290507 [details] [review] location: Add query extension to geo uri Add parsing support for an additional Geo URI extension from the Android world. Specification: geo:0,0?q=my+street+address Show the location for "my street address" (may be a specific address or location query). Example: "geo:0,0?q=1600+Amphitheatre+Parkway%2C+CA" We will parse this URI, setting the query parameter as the description of the GeocodeLocation and leave the coordinates as unset. Then the application can find out that it needs to perform a forward search to lookup the query.
Created attachment 290895 [details] [review] location: Add has_coords function The GeocodeLocation::has_coords function will return FALSE if one of latitude or longitude is unset.
Created attachment 290896 [details] [review] location: Add query extension to geo uri Add parsing support for an additional Geo URI extension from the Android world. Specification: geo:0,0?q=my+street+address Show the location for "my street address" (may be a specific address or location query). Example: "geo:0,0?q=1600+Amphitheatre+Parkway%2C+CA" We will parse this URI, setting the query parameter as the description of the GeocodeLocation and leave the coordinates as unset. Then the application can find out that it needs to perform a forward search to lookup the query.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/geocode-glib/issues/14.