Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Codes #575

Closed
codel00ps opened this issue Apr 11, 2024 · 8 comments
Closed

Custom Codes #575

codel00ps opened this issue Apr 11, 2024 · 8 comments

Comments

@codel00ps
Copy link

Hello, I am new to this technology, and would like to know if I can create my own code structure and not use the existing ones that are found in the demo site

@bocops
Copy link
Contributor

bocops commented Apr 17, 2024

Depends on what you mean by custom code.

In practical terms, every point on earth's surface has its unique plus code, and you can get these codes from the plus.codes map, Google Maps, or by using the code in this reposiotory to generate plus codes from latitude/longitude coordinates.

If your question is about something along the lines of vanity phone numbers, then no. There's no way to, say, make "C0DEL00P+" point to the location of your business.

@codel00ps
Copy link
Author

codel00ps commented Apr 17, 2024 via email

@bocops
Copy link
Contributor

bocops commented Apr 17, 2024

Plus codes are basically just a different encoding of lat/long coordinate pairs.

You can of course map these codes to others, or just have a completely different encoding in the first place - but then the resulting codes would no longer be "plus codes" that can be parsed by the code in this repository, or any of the places that implement plus codes.

Is there a specific use case you have in mind?

@codel00ps
Copy link
Author

codel00ps commented Apr 17, 2024 via email

@bocops
Copy link
Contributor

bocops commented Apr 17, 2024

Ah, I see. Open Location Code includes the concept of short codes, which might be helpful in your case. It allows to drop a code prefix if you instead provide a reference location relative to which the short code will be interpreted. Let's look at an example:

  1. The full plus code of the National Museum in Beirut, Lebanon seems to be 8G5QVGH8+82.
  2. If you have a look at Google Maps, it provides the short code VGH8+82 Beirut, Lebanon instead for the museum. Four characters of the code have been replaced with the string "Beirut, Lebanon".
  3. If you search for the short code in Google Maps, what happens is that the code VGH8+82 is interpreted in the context of the coordinates returned by geocoding the string "Beirut, Lebanon".

The string used to identify the reference location can be anything you like, but you are responsible for the whole process of (reverse) geocoding. Considering that the whole of Lebanon is spread across just four different 4-letter prefixes (8G5Q, 8G5R, 8G6Q, 8G6R), you would even get away with something very simple like "SW", "SE", "NW", "NE", but using city names ("Beirut") or unique abbreviations based on city names (e.g. "BRT") would make the codes more easily understood.

If you pack your reference locations more densely, you might even achieve dropping two additional characters from the plus code. In that case, the code for the museum might become something like H8+82 BRT Central.

@tigger6
Copy link

tigger6 commented Apr 17, 2024

Could you please reach out to drinckes@google.com and sramek@google.com? There is a long context for plus codes adoption in Lebanon/LibanPost. Some of the things you're trying to do could even already exist.

@codel00ps
Copy link
Author

codel00ps commented Apr 17, 2024 via email

@drinckes
Copy link
Contributor

We're in discussion via email, I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants