[openstreetmap/openstreetmap-website] Add geo tag to OSM website search options (#2104)

Peter notifications at github.com
Wed Jan 9 11:04:56 UTC 2019


The [geo URI](https://en.wikipedia.org/wiki/Geo_URI_scheme) standard is free, is neutral  and is a consensus... By other hand  the only consensual feature at issue #1807 is to point a "location context" for the search... All users will be happy with the approximated lat-long coordinates. Summary: 

Search string box today | With `geo:`|Effect with `geo:`
-------------------|-----------------------|----
Pronto Socorro Maria | Pronto Socorro Maria geo:-23.55,-46.63| The result will be near São Paulo center, even when user is not browsing at Brasil 
Pronto Socorro Maria | Pronto geo:-23.55,-46.63 Socorro Maria|  (identical)
Champs-Élysées | Champs-Élysées geo:48,2 | Ensures the Paris reference

**Illustrative Scenario**: suppose an user of the Openstreetmap's website   entering a string "Pronto Socorro Maria". It is  a `http://OSM.ORG/search?query=Pronto+Socorro+Maria`  query.  The result is something-aleatory, any hospital can be showed.  Now suppse the same user have some positional reference to say "nearst this point", how to say to the search engine?  

The syntax to say is using the tag `geo:` with coordinates. If the user need to check the neighborhoods of `geo:-23.55,-46.63`  (that is a standard RFC 5870 string) can concatenate this string into the query,   `http://OSM.ORG/search?query=Pronto+Socorro+Maria+geo:-23.55,-46.63`. Simple, only it.

The [javascript regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) for `geo:` tag is 

```
/(^|\s)geo:(\-?\d+(?:\.\d*)?,\-?\d+(?:\.\d*)?)(\s|$)/
```

## Step2. option to geocodes as OLC

After implemented the `geo:`  tag and OSM community accepted the new feature.... We can suggest a little adaptation, the `geo:{geocodeSchema}:`. The main motivation is to entering pluscodes, that   is, the [OLC geocode-schema](https://github.com/google/open-location-code/wiki/Supporting-OLC-in-your-app), but not only it: there are an "open door" to implement in the future other geocode-schemas, without any privilege for Google's preferred scheme.

Will be a new consensus process, the "step2 consensus", if sucess the `geo:olc:{olcCode}`  will be implemented ([the implemetation is near ready](https://github.com/openstreetmap/openstreetmap-website/pull/1818)!) .  The javascript regular expression for OLC (named "global codes") is 

```
/(^|\s)geo:olc:([23456789C][23456789CFGHJMPQRV][23456789CFGHJMPQRVWX]{6}\+[23456789CFGHJMPQRVWX]{2,3})(\s|$)/
```

## Step3. Option for loose-OLC

A testing feature can be solicitated,  to interpretate and expand a loose OLC.  For example  “588MC9X8+RC” in the search box text will be expanded to “geo:olc:588MC9X8+RC” in the real search. At implementation in  the search engine, it  can be a [pre-parsing](https://en.wikipedia.org/wiki/Preprocessor) to simplify the work.

Will be a new consensus process, the "step3 consensus",  and only a "testing mode" feature to be implemented... Suggesting "step4 consensus" to be definitive implementation.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/2104
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190109/39a99212/attachment.html>


More information about the rails-dev mailing list