Class CountryOfOriginServiceImpl
- java.lang.Object
-
- org.genesys.geotools.service.impl.CountryOfOriginServiceImpl
-
- All Implemented Interfaces:
CountryOfOriginService
public class CountryOfOriginServiceImpl extends Object implements CountryOfOriginService
Polygons used here are derived from OSM data, © OpenStreetMap contributors.
-
-
Constructor Summary
Constructors Constructor Description CountryOfOriginServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()After properties set.doubledistanceToBorder(float longitude, float latitude, String origCty)Get distance from georeference to closest point on border of specified countryStringgetCountries(float longitude, float latitude, String origCty, int allowedDistanceMargin)Gets the countries.voidprintCache()Prints the cache.voidsetDataFolderPath(String dataFolderPath)
-
-
-
Method Detail
-
setDataFolderPath
public void setDataFolderPath(String dataFolderPath)
-
afterPropertiesSet
public void afterPropertiesSet() throws MalformedURLException, IOExceptionAfter properties set.- Throws:
MalformedURLException- the malformed url exceptionIOException- Signals that an I/O exception has occurred.
-
getCountries
public String getCountries(float longitude, float latitude, String origCty, int allowedDistanceMargin) throws Exception
Description copied from interface:CountryOfOriginServiceGets the countries.- Specified by:
getCountriesin interfaceCountryOfOriginService- Parameters:
longitude- the longitudelatitude- the latitudeorigCty- the orig ctyallowedDistanceMargin- the allowed distance margin- Returns:
- the countries
- Throws:
Exception- the exception
-
distanceToBorder
public double distanceToBorder(float longitude, float latitude, String origCty) throws ExceptionDescription copied from interface:CountryOfOriginServiceGet distance from georeference to closest point on border of specified country- Specified by:
distanceToBorderin interfaceCountryOfOriginService- Parameters:
longitude- the longitudelatitude- the latitudeorigCty- the country ISO code- Returns:
- distance to closest point on country border or -1 if not found
- Throws:
Exception- the exception
-
printCache
public void printCache()
Prints the cache.
-
-