@ NonNull public List < Address > getFromLocation ( final double latitude , final double longitude , final int maxResults , final boolean parseAddressComponents ) throws GeocoderException { if ( latitude < - 90.0 || latitude > 90.0 ) { throw new IllegalArgumentException ( "latitude == " + latitude ) ; } if ( longitude < - 180.0 || longitude > 180.0 ) { throw new IllegalArgumentException ( "longitude == " + longitude ) ; } if ( isLimitExceeded ( ) ) { throw GeocoderException . forQueryOverLimit ( ) ; } final Uri . Builder uriBuilder = buildBaseRequestUri ( ) . appendQueryParameter ( "sensor" , "true" ) . appendQueryParameter ( "latlng" , latitude + "," + longitude ) ; final byte [ ] data ; try { data = download ( uriBuilder . toString ( ) ) ; } catch ( IOException e ) { throw new GeocoderException ( e ) ; } return Parser . parseJson ( data , maxResults , parseAddressComponents ) ; }
Returns an array of Addresses that are known to describe the area immediately surrounding the given latitude and longitude . The returned addresses will be localized for the locale provided to this class s constructor .