Java SDK for 2D
 All Classes Namespaces Functions Variables Pages
ApiLocation Class Reference

Static Public Member Functions

static String getLocationAddressInfo (Position location, int maxTime) throws InvalidLocationException
 Returns address corresponding to given location. More...
 
static RoadInfo getLocationRoadInfo (Position location, int maxTime) throws InvalidLocationException
 Returns road info corresponding to given location. More...
 
static Position locationFromAddress (String address, boolean postal, boolean valueMatch, int maxTime) throws GeneralException
 Returns gps location corresponding to a given address. More...
 
static ArrayList< WayPointlocationFromAddressEx (String address, boolean postal, int maxTime) throws GeneralException
 Returns location corresponding to taken address. More...
 
static ArrayList< WayPointlocationFromAddressEx (String address, boolean postal, boolean fuzzySearch, int maxTime) throws GeneralException
 Returns location corresponding to taken address. More...
 
static WayPoint showHierarchyDialog (String iso, String city, String street, boolean postal, int maxTime) throws GeneralException
 Shows hierarchy dialog and returns location of taken address. More...
 
static ArrayList< WayPointgetAddressList (String address, boolean postal, int maxCount, int maxTime) throws GeneralException
 Returns list of founded items from NameHierarchy. More...
 
static Position getCoordinatesFromOffset (String iso, long offset, int maxTime) throws GeneralException
 Gets the coordinates from offset. More...
 

Member Function Documentation

static ArrayList<WayPoint> getAddressList ( String  address,
boolean  postal,
int  maxCount,
int  maxTime 
) throws GeneralException
static

Returns list of founded items from NameHierarchy.

Parameters
addressAddress in format "Country,City/ZIP,Street"
postalFlag determining whether second address parameter represents city or ZIP code.
  • true - ZIP code
  • false - City
maxCountMaximum count of founded items.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
ArrayList of retrieved model.WayPoint items
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), Api.getService(), and WayPoint.readBundle().

static Position getCoordinatesFromOffset ( String  iso,
long  offset,
int  maxTime 
) throws GeneralException
static

Gets the coordinates from offset.

Parameters
isoISO code of map (country) where address is located. This parameter is obligatory.
offsetthe offset
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
model.Position instance of location
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

static String getLocationAddressInfo ( Position  location,
int  maxTime 
) throws InvalidLocationException
static

Returns address corresponding to given location.

Parameters
locationmodel.Position instance which contains location for which is the address searched.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
String instance which contains found address in format: "ISO,city,street,house number".
Exceptions
InvalidLocationExceptionthe invalid location exception

References Api.getInstance(), and Api.getService().

static RoadInfo getLocationRoadInfo ( Position  location,
int  maxTime 
) throws InvalidLocationException
static

Returns road info corresponding to given location.

Parameters
locationmodel.Position instance which contains location for which is the address searched.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
model.RoadInfo instance which contains information about the road on that position.
Exceptions
InvalidLocationExceptionthe invalid location exception

References Api.getInstance(), Api.getService(), and RoadInfo.readBundle().

static Position locationFromAddress ( String  address,
boolean  postal,
boolean  valueMatch,
int  maxTime 
) throws GeneralException
static

Returns gps location corresponding to a given address.

Parameters
addressthe address string in the format "ISO,city,street,house number" or "ISO,zip code,street,house number"
postalFlag determining whether second address parameter represents city or ZIP code.
  • true - ZIP code.
  • false - City.
valueMatchDetermines whether the result will be the exact match or the best value match (true for fuzzy search of address).
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
Position instance represented by GPS coordinates

Notes:
Address parameter house number is optional. If you do not want to fill it write address like this:
"SVK,Bratislava,Einsteinova,"
Second address parameter can represent city name or ZIP code.
The list of ISO codes can be found at http ://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html.

Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

static ArrayList<WayPoint> locationFromAddressEx ( String  address,
boolean  postal,
int  maxTime 
) throws GeneralException
static

Returns location corresponding to taken address.

Parameters
addressthe address of the location in format: "ISO,city,street,house number".
postalFlag determining whether second address parameter represents city or ZIP code.
  • true - ZIP code.
  • false - City.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
ArrayList of retrieved model.WayPoint items.

Notes:
The function returns location corresponding to taken address. In some cases there can be more cities with the same name in one country or more streets with the some name in one city.
If there are more results corresponding to taken address LocationFromAddressEx stores the results into array of model.WayPoint.
If you want to strictly specify address you can fill optional address parameters of address - extra city and extra street.
Extra city strictly defines region in country where city is situated. It should be set to province or canton of the country.
locationFromAddressEx function always fills extra city and extra street parts of address so if there are more results you can choose which one is that you meant.
If you do not want to fill optional street parameters make address like this:
"SVK,Bratislava,Einsteinova,1,,"
Optional address paramters are extra city, extra street and house number.
The list of ISO codes can be found at http ://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html .

Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), Api.getService(), and WayPoint.readBundle().

static ArrayList<WayPoint> locationFromAddressEx ( String  address,
boolean  postal,
boolean  fuzzySearch,
int  maxTime 
) throws GeneralException
static

Returns location corresponding to taken address.

Parameters
addressthe address of the location in format: "ISO,city,street,house number".
postalFlag determining whether second address parameter represents city or ZIP code.
  • true - ZIP code.
  • false - City.
fuzzySearchDetermines whether the result will be the exact match or the best value match (true for fuzzy search of address).
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
ArrayList of retrieved model.WayPoint items.

Notes:
The function returns location corresponding to taken address. In some cases there can be more cities with the same name in one country or more streets with the some name in one city.
If there are more results corresponding to taken address LocationFromAddressEx stores the results into array of model.WayPoint.
If you want to strictly specify address you can fill optional address parameters of address - extra city and extra street.
Extra city strictly defines region in country where city is situated. It should be set to province or canton of the country.
LocationFromAddressEx function always fills extra city and extra street parts of address so if there are more results you can choose which one is that you meant.
If you do not want to fill optional street parameters make address like this:
"SVK,Bratislava,Einsteinova,1,,"
Optional address paramters are extra city, extra street and house number.
The list of ISO codes can be found at http ://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html .

Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), Api.getService(), and WayPoint.readBundle().

static WayPoint showHierarchyDialog ( String  iso,
String  city,
String  street,
boolean  postal,
int  maxTime 
) throws GeneralException
static

Shows hierarchy dialog and returns location of taken address.

Parameters
isoISO code of map (country) where address is located. This parameter is obligatory.
cityName of city or postal code of the city in taken country.
streetStreet in taken city.
postalFlag determining whether second address parameter represents city or ZIP code.
  • true - ZIP code.
  • false - City.
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
model.WayPoint instance which determines location of taken address.
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), Api.getService(), and WayPoint.readBundle().