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

Python implementation needs documentation, examples #557

Open
nealmcb opened this issue Apr 2, 2023 · 0 comments
Open

Python implementation needs documentation, examples #557

nealmcb opened this issue Apr 2, 2023 · 0 comments

Comments

@nealmcb
Copy link

nealmcb commented Apr 2, 2023

An easy way to start this is via some docstrings, in combination with #417.

Here are a few tips for those who peruse issues, in the meantime.

Some of the main functions, with defaults:

  • openlocationcode.encode(latitude, longitude, codeLength=10)
  • openlocationcode.decode(code)

Examples:

>>> from openlocationcode import openlocationcode as olc

>>> olc.encode(40,-105)
'85GQ2222+22'
>>> olc.decode('85GQ2222+22')
[40.0, -105.0, 40.000125, -104.999875, 40.0000625, -104.9999375, 10]
>>> olc.encode(40,-105, codeLength=4)
'85GQ0000+'
>>>olc.decode('85GQ0000+')
40.0, -105.0, 41.0, -104.0, 40.5, -104.5, 4]
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

1 participant