Skip to content

Add Reverse Geocoding API #373

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

Merged
merged 2 commits into from
Feb 21, 2023
Merged

Add Reverse Geocoding API #373

merged 2 commits into from
Feb 21, 2023

Conversation

jpaye
Copy link
Contributor

@jpaye jpaye commented Feb 17, 2023

Clients are interested in using the reverse geocoding API to convert lat/long pairs to Gro regions

We already have a geocoding API, here we're just making it accessible in the client

  • Adds the reverse_geocode_points method
    • Takes a list of points to geocode, returns a list of Gro regions
  • Adds tests in both client_test.py and lib_test.py

Tested locally:

>>> client = GroClient()
>>> client.reverse_geocode_points([[33.4484, -112.0740], [42.3314, -83.0458], [-8.8742, 125.7275]])
[{'latitude': 33.4484, 'longitude': -112.074, 'l5_id': 136859, 'l5_name': 'Maricopa', 'l4_id': 13053, 'l4_name': 'Arizona', 'l3_id': 1215, 'l3_name': 'United States'}, {'latitude': 42.3314, 'longitude': -83.0458, 'l5_id': 138067, 'l5_name': 'Wayne', 'l4_id': 13073, 'l4_name': 'Michigan', 'l3_id': 1215, 'l3_name': 'United States'}, {'latitude': -8.8742, 'longitude': 125.7275, 'l5_id': 134452, 'l5_name': 'Turiscai', 'l4_id': 12774, 'l4_name': 'Manufahi', 'l3_id': 1199, 'l3_name': 'East Timor'}]

@jpaye jpaye requested a review from a team as a code owner February 17, 2023 20:11
@jpaye jpaye merged commit 409b2a8 into development Feb 21, 2023
@jpaye jpaye deleted the GAIA-17707-add-geocoding branch February 21, 2023 14:40
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

Successfully merging this pull request may close these issues.

2 participants