Lat Long to Plus Code Mapping in Python

720 views
Skip to first unread message

Pankaj Raina

unread,
Jun 6, 2020, 7:00:35 AM6/6/20
to Plus Codes Community Forum
Hi can someone please help me with the python Code for Lat/Long to PlusCode conversion.

Barry Hunter

unread,
Jun 6, 2020, 7:05:02 AM6/6/20
to Pankaj Raina, Plus Codes Community Forum
Did you check the main plus codes repository? It has a Python implementation/library:


 If you have a specific question about for example using the library, well need to ask the more specific question. 

On Sat, Jun 6, 2020 at 12:00 PM Pankaj Raina <pankajr...@gmail.com> wrote:
Hi can someone please help me with the python Code for Lat/Long to PlusCode conversion.

--
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/b44574e2-60c5-4e99-89b6-eb9200950613o%40googlegroups.com.

Pankaj Raina

unread,
Jun 6, 2020, 7:09:57 AM6/6/20
to Plus Codes Community Forum
Hi Barry,

Yes actually i tried fetching the code but its not working. Can u help me with a simple example.

taking a set of lat long and getting Plus code.



On Saturday, June 6, 2020 at 4:35:02 PM UTC+5:30, Barry Hunter wrote:
Did you check the main plus codes repository? It has a Python implementation/library:


 If you have a specific question about for example using the library, well need to ask the more specific question. 

On Sat, Jun 6, 2020 at 12:00 PM Pankaj Raina <pankajr...@gmail.com> wrote:
Hi can someone please help me with the python Code for Lat/Long to PlusCode conversion.

--
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-code+unsub...@googlegroups.com.

Barry Hunter

unread,
Jun 6, 2020, 7:17:10 AM6/6/20
to Pankaj Raina, Plus Codes Community Forum
The 'test' file is typically a good place to look for an example


 
Firstly need

from openlocationcode import openlocationcode as olc
You trying to encode, so checkout the  TestEncoding function

The active bit is 

olc.encode(td['lat'], td['lng'], codelength)) 

The testfunction actully uses it inside a loop for making a number of conversions (even loading it from a CSV )


On Sat, Jun 6, 2020 at 12:09 PM Pankaj Raina <pankajr...@gmail.com> wrote:
Hi Barry,

Yes actually i tried fetching the code but its not working. Can u help me with a simple example.

taking a set of lat long and getting Plus code.



On Saturday, June 6, 2020 at 4:35:02 PM UTC+5:30, Barry Hunter wrote:
Did you check the main plus codes repository? It has a Python implementation/library:


 If you have a specific question about for example using the library, well need to ask the more specific question. 

On Sat, Jun 6, 2020 at 12:00 PM Pankaj Raina <pankajr...@gmail.com> wrote:
Hi can someone please help me with the python Code for Lat/Long to PlusCode conversion.

--
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.

--
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/42467c86-94c6-4b88-84d2-e8a4cbe1628fo%40googlegroups.com.

Pankaj Raina

unread,
Jun 6, 2020, 7:18:11 AM6/6/20
to Plus Codes Community Forum
Thanks a ton!
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.

--
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-code+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages