Opened 10 years ago

Closed 5 years ago

#3330 closed enhancement (fixed)

Provide GEO uri next to permalink on the map

Reported by: steelman Owned by: rails-dev@…
Priority: major Milestone:
Component: website Version:
Keywords: permalink geouri Cc:


RFC 5870 describes a "geo:" uri scheme that is design to point to geographic locations. This patch adds a GEO link next to Permalink in the lower right corner of the map.

The patch contains some comments around the JS code, which may of course be removed.

Attachments (1)

openstreetmap-geouri.diff (1.4 KB) - added by steelman 10 years ago.
geouri permalink on the map

Download all attachments as: .zip

Change History (12)

comment:1 Changed 10 years ago by Tom Hughes

Is there anything that actually uses such URIs though?

Changed 10 years ago by steelman

Attachment: openstreetmap-geouri.diff added

geouri permalink on the map

comment:2 Changed 10 years ago by steelman

I know of two pieces of software:

+ a Firefox extension + an extension to Emacs' org-mode

And I hope there will be more because geouri is the most convenient (well defined) way to exchange geographic coordinats between geo-aware applications. The org-mode extension, for example, accepts dropped geo links and sets GEO property on a note.

comment:3 Changed 10 years ago by steelman

Do not apply this patch yet. I need to make the uncertainty calculation take the rounding done at the beginning of the function into account properly. I'll tell you when it's ready.

comment:4 Changed 10 years ago by steelman

OK. Here is a piece of maths:

Let's assume Earth's average circumference is 40041455m

At zoom 0 one pixel corresponds 156412m (40041455m / 256px), and it is divided with every next zoom level by two. At zoom level 15 one pixel is 4.77m.

The degree uncertainty which lies in rounding:

decimals = Math.pow(10, Math.floor(zoom/3));
lat = Math.round(lat * decimals) / decimals;

with decimals equal 1 for zoom 0, starts at 111226m (40041455m / 360°). It drops tenfold every three zoom levels which is 2.15. This makes degree uncertainty always less than pixel uncertainty, hence the latter should be used. The pxunc variable is of arbitrary choice and specifies our assumption about how many pixels a human can miss while choosing a position.

PS. I consider uncertainty here as a maximum error (east-west on the equator, north-south everywhere assuming the Earth is e sphere) with a [ uniform distribution] (the RFC doesn't specify the distribution). The diagonal degree error (on the equator) is something about 157297m, while diagonal pixel error is 221200m.

comment:5 Changed 10 years ago by steelman

I mean: "which is 2.15 per one zoom level".

comment:6 Changed 10 years ago by steelman


comment:7 Changed 9 years ago by steelman


comment:8 Changed 9 years ago by Tom Hughes

I'm very reluctant to use up precious screen real estate for this while there are so few potential users for it.

The risk is that we will confuse people who will see this link but (in 99.999% of cases) find that nothing happens (or they get an error) when they click on it. I don't see that the benefits are currently sufficient to outweigh that downside.

comment:9 Changed 9 years ago by Tom Hughes

Owner: changed from Tom Hughes to rails-dev@…

comment:10 Changed 5 years ago by Tom Hughes

This was implemented in 6403cb9/rails.

comment:11 Changed 5 years ago by Tom Hughes

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.