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 737979 - Further geoURI extensions
Further geoURI extensions
Status: RESOLVED OBSOLETE
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-10-06 08:23 UTC by Jonas Danielsson
Modified: 2019-03-20 10:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
location: Fix error handling in uri parsing (6.47 KB, patch)
2014-10-17 09:45 UTC, Jonas Danielsson
needs-work Details | Review
location: Unescape geo uri description (2.45 KB, patch)
2014-10-17 09:45 UTC, Jonas Danielsson
committed Details | Review
location: Fix error handling in uri parsing (6.09 KB, patch)
2014-10-17 10:13 UTC, Jonas Danielsson
accepted-commit_now Details | Review
location: Fix error handling in uri parsing (5.83 KB, patch)
2014-10-17 10:35 UTC, Jonas Danielsson
committed Details | Review
location: Add query extension to geo uri (5.77 KB, patch)
2014-10-17 13:04 UTC, Jonas Danielsson
needs-work Details | Review
location: Add is_unset function (3.01 KB, patch)
2014-11-12 12:33 UTC, Jonas Danielsson
none Details | Review
location: Add query extension to geo uri (5.91 KB, patch)
2014-11-12 12:33 UTC, Jonas Danielsson
none Details | Review
location: Add is_unset function (3.49 KB, patch)
2014-11-12 12:40 UTC, Jonas Danielsson
none Details | Review
location: Add query extension to geo uri (5.97 KB, patch)
2014-11-12 12:40 UTC, Jonas Danielsson
none Details | Review
location: Add has_coords function (3.48 KB, patch)
2014-11-18 08:30 UTC, Jonas Danielsson
none Details | Review
location: Add query extension to geo uri (6.00 KB, patch)
2014-11-18 08:31 UTC, Jonas Danielsson
none Details | Review

Description Jonas Danielsson 2014-10-06 08:23:16 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.
Comment 1 Bastien Nocera 2014-10-16 10:56:46 UTC
(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.
Comment 2 Jonas Danielsson 2014-10-17 09:45:28 UTC
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.
Comment 3 Jonas Danielsson 2014-10-17 09:45:32 UTC
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".
Comment 4 Jonas Danielsson 2014-10-17 09:45:59 UTC
(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.
Comment 5 Bastien Nocera 2014-10-17 09:49:25 UTC
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.
Comment 6 Bastien Nocera 2014-10-17 09:51:12 UTC
Review of attachment 288735 [details] [review]:

Looks good.
Comment 7 Jonas Danielsson 2014-10-17 10:13:17 UTC
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.
Comment 8 Bastien Nocera 2014-10-17 10:16:11 UTC
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.
Comment 9 Jonas Danielsson 2014-10-17 10:35:46 UTC
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.
Comment 10 Bastien Nocera 2014-10-17 10:39:10 UTC
Review of attachment 288742 [details] [review]:

Looks good.
Comment 11 Jonas Danielsson 2014-10-17 13:04:03 UTC
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.
Comment 12 Bastien Nocera 2014-10-17 13:29:53 UTC
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 13 Jonas Danielsson 2014-10-20 17:42:12 UTC
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 14 Jonas Danielsson 2014-10-20 17:44:43 UTC
Comment on attachment 288735 [details] [review]
location: Unescape geo uri description

Attachment 288735 [details] pushed as fb95a42 - location: Unescape geo uri description
Comment 15 Jonas Danielsson 2014-11-12 12:33:37 UTC
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.
Comment 16 Jonas Danielsson 2014-11-12 12:33:41 UTC
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.
Comment 17 Jonas Danielsson 2014-11-12 12:40:13 UTC
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.
Comment 18 Jonas Danielsson 2014-11-12 12:40:16 UTC
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.
Comment 19 Jonas Danielsson 2014-11-18 08:30:56 UTC
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.
Comment 20 Jonas Danielsson 2014-11-18 08:31:06 UTC
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.
Comment 21 GNOME Infrastructure Team 2019-03-20 10:40:20 UTC
-- 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.