Constructor and Description |
---|
GazetteerGeoCoder() |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getCountryCode(String locationWKT,
int radius)
Retrieves the country code for a given location.
|
GeoResult |
getLocation(String location)
Takes a query for a place and returns the most relevant result.
|
NearbyLocation |
getNearbyCity(String location) |
void |
setGeoEntryQueryable(GeoEntryQueryable geoEntryQueryable) |
public void setGeoEntryQueryable(GeoEntryQueryable geoEntryQueryable)
@Nullable public GeoResult getLocation(String location)
GeoCoder
getLocation
in interface GeoCoder
location
- a string representing a simple placename query, such as "Washington, D.C." or
"France" (i.e. the string just contains search terms, not query logic)GeoResult
most relevant to the query, null if no results were found@Nullable public NearbyLocation getNearbyCity(String location) throws GeoEntryQueryException
getNearbyCity
in interface GeoCoder
location
- - a WKT string describing the area to searchGeoEntryQueryException
- if an exception occurs while querying the GeoNames resourcepublic Optional<String> getCountryCode(String locationWKT, int radius)
GeoCoder
locationWKT
is a polygon.getCountryCode
in interface GeoCoder
locationWKT
- WKT location for which to get the country code ofradius
- Radius in kilometers to search from the center of locationWKT
This work is licensed under a Creative Commons Attribution 4.0 International License.