Class AddressConverter
java.lang.Object
com.JesacaLin.GrubGoblin_v13.util.AddressConverter
Utility class for converting an address to geographic coordinates.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
convertAddress
(String address) Converts an address to geographic coordinates using the Google Geocoding API.
-
Constructor Details
-
AddressConverter
public AddressConverter()
-
-
Method Details
-
convertAddress
Converts an address to geographic coordinates using the Google Geocoding API.- Parameters:
address
- the address to convert- Returns:
- a double array with two elements: the latitude and the longitude
- Throws:
IllegalArgumentException
- if the API key is not setRuntimeException
- if an error occurs during geocoding
-