- All Known Implementing Classes:
OpenStreetMapGeoCoder
public interface IGeocodingService
Interface defining the geocoding service used within the application.
It provides methods to convert addresses into geographic coordinates,
generate address suggestions for user input, and perform reverse geocoding
to obtain readable addresses from latitude and longitude values.
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]geocodeAddress(String address) Converts an address string into geographic coordinates.getAddressSuggestions(String query) Returns address suggestions based on a partial search query.reverseGeocode(double lat, double lon) Converts latitude and longitude coordinates into a human-readable address.
-
Method Details
-
geocodeAddress
Converts an address string into geographic coordinates.- Parameters:
address- the address string to geocode- Returns:
- a double array of length 2 where index 0 is latitude and index 1 is longitude
- Throws:
Exception- if the address cannot be found or the request fails
-
getAddressSuggestions
Returns address suggestions based on a partial search query.- Parameters:
query- the partial address string typed by the user- Returns:
- a list of matching address strings, or an empty list if none found
- Throws:
Exception- if the request fails
-
reverseGeocode
Converts latitude and longitude coordinates into a human-readable address.- Parameters:
lat- the latitude coordinate to reverse geocodelon- the longitude coordinate to reverse geocode- Returns:
- a readable address string, or a formatted coordinate string if lookup fails
- Throws:
Exception- if the request fails
-