Local plus codes(shorter) from Global plus codes

18 views
Skip to first unread message

Om Patel

unread,
Jun 20, 2024, 3:06:13 AM (9 days ago) Jun 20
to Plus Codes Community Forum
I have to get the local plus codes from Global plus codes. My Team has made a Flask-API to convert global plus codes to coordinates(latitude, longitude). But as most users would use local plus code, I have to find the solution.

for eg: user input = "2H8G+H6 Ahmedabad, Gujarat, India"
should be identified or processed as "7JMJ2H8G+H6".

Rasťo Šrámek

unread,
Jun 20, 2024, 3:41:10 AM (9 days ago) Jun 20
to Om Patel, Plus Codes Community Forum
You need some sort of way to convert Ahmedabad, Gujarat, India into a lat/long, and then you can call one of the OLC libraries to recover the full code from short code + lat/long. The lat/long doesn't need to be precise, it can be off to up to half a degree of latitude and longitude, so any point in Ahmedabad will do.

Or, depending on the setting you could do things like call the android geocoder for instance if this is happening on a phone.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "Plus Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/open-location-code/a52da832-a734-4247-b46b-bf0e248b2c67n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages