Add Amazon Location Service V2 (GeoPlaces) Lookup#1
Open
Conversation
added 3 commits
March 24, 2026 14:38
…e class - Use code_2 instead of code_3 for country_code to match geocoder conventions - Pass result to super(result) so Base#data is properly set - Update fixture, mock, and tests accordingly
- Map AccessDeniedException to Geocoder::RequestDenied - Map ThrottlingException to Geocoder::OverQueryLimitError - Map ValidationException to Geocoder::InvalidRequest - Map InternalServerException to Geocoder::ServiceUnavailable - Catch-all ServiceError maps to Geocoder::Error - Respects always_raise configuration - Returns empty array on error (gem convention) - Add tests for all error types with and without always_raise
sujamkatel
reviewed
Mar 26, 2026
sujamkatel
left a comment
There was a problem hiding this comment.
Changes look good, Few recommendations:
- Should we also include a codeowner file and assign to speed? Right now anyone can create and merge PRs in this repo.
- Can we also add the issue link in the PR description for posterity on what prompted us to create this new repo.
Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Amazon Location Service V2 (GeoPlaces) Lookup
Adds a new geocoding lookup for the Amazon Location Service Places V2 API (GeoPlaces), the successor to the original Amazon Location Service Places API.
Key differences from v1 (
:amazon_location_service)aws-sdk-geoplacesgem instead ofaws-sdk-locationserviceindex_name— the v2 API removed this conceptclient.geocode/client.reverse_geocodeinstead ofsearch_place_index_for_text/search_place_index_for_positioncountry.code_2state(full name) andstate_code(abbreviation), improving on v1 which returned the full name for bothWhat's included
lib/geocoder/lookups/amazon_location_service_v2.rb): Forward and reverse geocoding viaAws::GeoPlaces::Client, with language configuration support and AWS credential handling (explicit keys or default credential chain)lib/geocoder/results/amazon_location_service_v2.rb): Parses v2 API responses into standard geocoder result attributes (coordinates,address,city,state,state_code,postal_code,country,country_code,neighborhood,route,place_id)RequestDenied,OverQueryLimitError,InvalidRequest,ServiceUnavailable), respectsalways_raiseconfiguration, returns[]on erroralways_raise)README_API_GUIDE.mdentry with configuration examples, supported parameters, and credential setupFiles changed
lib/geocoder/lookup.rb— Register new lookup instreet_servicesandall_services_with_http_requestslib/geocoder/lookups/amazon_location_service_v2.rb— Lookup implementationlib/geocoder/results/amazon_location_service_v2.rb— Result parsertest/fixtures/amazon_location_service_v2_madison_square_garden— Test fixturetest/test_helper.rb— Mock client and AWS error classestest/unit/lookup_test.rb— Exclude from query URL testtest/unit/lookups/amazon_location_service_v2_test.rb— Unit testsREADME_API_GUIDE.md— API documentation entryEnd-to-end validation
This lookup was tested end-to-end against the live Amazon Location Service V2 API using an AWS Lambda (Ruby 3.3) deployed in a VPC with a
com.amazonaws.us-east-1.geo.placesVPC endpoint. Both forward geocoding (QueryText) and reverse geocoding (QueryPosition) were validated against real API responses, confirming correct result parsing, coordinate handling, and credential chain behavior (Lambda IAM role, no explicit keys).