### Search by coordinates The `Amplify.Geo.searchByCoordinates()` API is a reverse Geocoder that takes a coordinate point and returns information about what it finds at that point on the map. The returned object is the same shape as `Amplify.Geo.searchByText()` API. ```java Coordinates position = new Coordinates(47.6153, -122.3384); Amplify.Geo.searchByCoordinates(position, result -> { for (final Place place : result.getPlaces()) { Log.i("MyAmplifyApp", place.toString()); } }, error -> Log.e("MyAmplifyApp", "Failed to reverse geocode " + position, error) ); ``` ```kotlin val position = Coordinates(47.6153, -122.3384) Amplify.Geo.searchByCoordinates(position, { for (place in it.places) { Log.i("MyAmplifyApp", place.toString()) } }, { Log.e("MyAmplifyApp", "Failed to reverse geocode $position", it) } ) ``` ```kotlin val position = Coordinates(47.6153, -122.3384) try { val result = Amplify.Geo.searchByCoordinates(position) for (place in result.places) { Log.i("MyAmplifyApp", place.toString()) } } catch (error: GeoException) { Log.e("MyAmplifyApp", "Failed to reverse geocode $position", error) } ``` ```java Coordinates position = new Coordinates(47.6153, -122.3384); RxAmplify.Geo.searchByCoordinates(position).subscribe( result -> { for (final Place place : result.getPlaces()) { Log.i("MyAmplifyApp", place.toString()); } }, error -> Log.e("MyAmplifyApp", "Failed to reverse geocode " + position, error) ); ``` Restrict your search results by specifying following parameters inside `GeoSearchByCoordinatesOptions`: - `maxResults` - to limit the maximum result set (defaults to 50) ```java GeoSearchByCoordinatesOptions options = GeoSearchByCoordinatesOptions.builder() .maxResults(1) .build(); ``` ```kotlin val options = GeoSearchByCoordinatesOptions.builder() .maxResults(1) .build() ``` ```kotlin val options = GeoSearchByCoordinatesOptions.builder() .maxResults(1) .build() ``` ```java GeoSearchByCoordinatesOptions options = GeoSearchByCoordinatesOptions.builder() .maxResults(1) .build(); ```