LaPingvino / olc-tools

Apache License 2.0
0 stars 1 forks source link

Purpose and usage should be made clearer #1

Open ppKrauss opened 5 years ago

ppKrauss commented 5 years ago

Hi, seems good (!), can you show a demo or describe examples at README?

LaPingvino commented 5 years ago

I just created this today. It will really help me if you explain here what remains unclear!

dhiegov commented 5 years ago

I understand what @ppKrauss means, I think. I imagine that the "final" and concrete product would be something like a search engine with special forms (or even syntax) to search for, say, a ride from place A to place B. That would be an example.

At the moment, at least as I see it, you only talk about a hashtag idea and how it would be useful, but you don't present an example query that searches for the above ride, for example.

ppKrauss commented 5 years ago

Thanks @LaPingvino and @dhiegov. Ok, this repository is only a backup "various tools to work with Open Location Codes", and fragment of tools... It is a good first step, and perhaps the only one that all us have time to do. In this context a suggestion to add something more: datasets. Algorithms + Data Structures = Programs. So, "software tools", that are programs, sometimes need datasets to be complete...

What datasets do we need? See this example of Cape Verde, the only contry where OLC is the official geocode:

There are a black-box in the back-end of the plus.codes, that is the "translate to local code" software. It is not OLC. The translation is a black-box for us (the public). We can do some reengineering and determine the magic software... It is a typical "Algorithm + Data Structure" software, it is not a pure algorithm, need a dataset for each country. We can start with Cape Verde (the only stable and official one). The final dataset is perhaps a GeoJSON, but is possible to obtain it, analysing the pattern with a simple spreadsheet.

Let's start the spreadsheet (a CSV file in this repository)?

LaPingvino commented 5 years ago

@ppKrauss the short codes work with a reference location, which can be and often is outside of the actual location pointed to. E.g. if you use https://whenwhere.cf, you can go to the location mentioned together with the short code, which can be a train station, a town center, anything that is easy to find, and then navigate from there. Of course for implementation in OSM, it would be very cool if we can enable the most useful reference points possible. I will write a blog post today on my OSM account to stir a bit of discussion, backed up with actual use cases.

LaPingvino commented 5 years ago

@dhiegov you comment here about the OLN idea. whenever I have enough energy I try to work that out further, details are also slightly changing in my mind. Do check back later when hopefully I will have worked that out more!

LaPingvino commented 5 years ago

I added purpose elements to the README, please comment if that helps or not!

ppKrauss commented 5 years ago

@ppKrauss the short codes work with a reference location,

Not works, your assertion is false, please demonstrate if not... There are two conceptual problems where we must to pay attention:

  1. "Search" is not "resolve", when you search in Nominatim, the responponse is not exact (no guarantee and more tham 1 result). When you use the Plus.codes it is (supposed) exact (guarantee and unicity).

  2. Perhaps you don't understand, "local code" is not "global code". The site whenwhere.cf not resolve local codes, only the site PlusCodes. Examples of local codes: 2.1. WFW4+PQ Praia, Cape Verde 2.2. C8QV+CJ São Paulo, State of São Paulo, Brazil

(...) which can be and often is outside of the actual location pointed to. E.g. if you use https://whenwhere.cf, you can go to the location mentioned together with the short code, which can be a train station, a town center, anything that is easy to find, and then navigate from there. Of course for implementation in OSM, it would be very cool if we can enable the most useful reference points possible. I will write a blog post today on my OSM account to stir a bit of discussion, backed up with actual use cases.

It is a big confusion, I am talking about "local code", a standard string that is translated to a exact point.

PS: it is the only thing which gives the guarantee that a letter arrives at its destination by traditional mail in Cape Verde, where plusCodes is the official code.

LaPingvino commented 5 years ago

You don't understand correctly how short codes work. I cite from https://plus.codes/howitworks:

If the location is within or near a town, the area code isn't needed. In rural locations, even if the nearest town is up to 25 kilometers away, the area code isn't needed. You can use the local code together with the name of the town.

and described in the official definition papers on https://github.com/google/open-location-code/blob/master/docs/olc_definition.adoc:

Shortening Open Location Codes

We are accustomed to providing different levels of detail in a street address depending on who we give it to. People far away usually require the full address including the country. Within the country, we may give state-level information, while people in the same neighbourhood may not even require the city name. Information can be omitted because it is obvious from the context.

Similarly, by providing a locality name as context (that can be geocoded to a latitude and longitude) the leading digits of an Open Location Code can be omitted. The original code can be recovered using the provided context, or even with different but nearby coordinates.

For example, the Nairobi Youth Sports Organization and Information Centre in Kibera, Nairobi, has the Open Location Code "6GCRMQPX9G". Using the location of Nairobi, the code can be shortened to "MQPX9G".

This method of shortening the code only requires that the location of the code, and the location of the place, are within approximately 40-50km of each other. It works because the correct location is the nearest one that includes the short code, "MQPX9G".

This means that the Nairobi Youth Sports Organization and Information Centre can use the full, global address "MQPX9G Nairobi, Kenya". Within Nairobi, a person can just use "MQPX9G" and find the correct location.

When combined with the town or neighbourhood name, most people will only have to remember from four to seven digits of their code.

(note than in this example, the + should be inserted after the X to get a plus code as we know them.)

Importantly, the actual definition of short codes is geocode-provider-agnostic and imprecision-tolerant. Let me give you an example for the bus stops at the train station in my home town. The following codes all work (please try!):

I think some of those might pose a challenge for Nominatim, but that's okay. You would usually use a code that you know the person should be able to find. When you are in the region, just 2MHF+C2 is enough, because the reference point is where you are. This is what https://whenwhere.cf implements, because it's for local walking navigation: it doesn't make sense to walk in a rough direction for many, many kilometers.

LaPingvino commented 5 years ago

To comment on "https://whenwhere.cf doesn't support short codes", it does, it just doesn't support a named reference location. It takes your current location as reference point, which means that if you are close enough to the reference location, the short code will be right. I only note down 4+2 length codes when I go somewhere, that's enough, and my tool does support that just fine.

ppKrauss commented 5 years ago

The focus here is the exact resolution of an offcial postal code. The "local_code + string_place" is a global code. The string_place, that is a "named reference location", when is official is a black-box as I demonstrated there.

PS: the exact resolution of an official postal code is the serious and important application, for all people of specific country (like Cape Verde), and people that must send a letter to there, or manage a database of official addresses of the country, etc.


It's subtle I'm sorry, I had not realized before how subtle they are ...

Answering: I agree that my GPS position is a good context, where the short local code make sense; and also agree that PlusCodes solve synonymous... But the subject of discussion is not a language to point "near to me" things (that is fine a good language but not the subject).

Suggestion: let's wait another person to read and check this discussion of subtle concepts... I am talking about another subject, about "official code resolution", not the free choice of a context.

LaPingvino commented 5 years ago

I sent you a message on Telegram. We can try to figure this out together before making a huge mess of this issue.

LaPingvino commented 5 years ago

I think I get now what you mean: it's about how to get the post to the correct sorting office etc. In the case of Cabo Verde, I think that happens on country level: there is one post office. They can sort out further sub-distribution fully on the actual letters in the short code. The reference point system used is based on what people in regions without street names actually use: often visible reference points in the neighborhood. Of course it can be useful to kinda standardize these over time to make post sorting easier, and with OSM implementation this can probably be easily done by just using region polygons where these are available, so it comes down to mapping accuracy over time. Postal codes do work differently per location. E.g. Belgium has a postal code per municipality, while the Netherlands has a postal codes on sub-street level, which are generally unique with a street number to a house. Brazilian postal codes are kinda in-between. Because OLC is fully unaware of country, province and city borders, this cannot be used other than by convention, and while it is good to standardize this over time where code usage becomes stronger, I think the correct way to do this would be e.g. adding an OSM tag indicating that a location is used as an official OLC reference point, maybe for a specific region, not trying to decide that for people ahead of time.

ppKrauss commented 5 years ago

Ok, that is other point: each country have its official geocode. That is correct: every country is sovereign in choosing it ... Not Google. Ireland choice in 2015 was the Eircode, Cape Verde choice in 2016 the PlusCode, ...
It is slow and difficult to open postcodes, but some countries are analisyng and OpenStreetMap can help contry-community to test and analyse geocode options.


We (a OSM interest group) are preparing a solution for OSM community, but need more 1 month to finish the basic work... The proposal is to be "generic official resolver" (not a search engine but exact resolver), and you can use it also to redirect global geocodes. Examples running in the first draft:

Other geocode, e.g. Geohash: http://osm.codes/ghs:e6xkc594c or ghs:e6xkc5 or etc.

Maybe we can join initiatives, what do you think?

LaPingvino commented 5 years ago

I also reacted to you about this on mail, and I sent you a message on Telegram (@lapingvino).

ppKrauss commented 5 years ago

Thanks @LaPingvino , plugged by e-mail. ;-)

About my spreadsheets suggestion (above), to open the PlusCode's black-box, see this link here (we can edit!).

PS: it is not necessary to be complete, it is only to test with other non-Google engines, like Nominatim, to simulate PlusCode functionality.