C++ SDK

◆ LocationFromAddressEx() [2/2]

static int CApplicationAPI::LocationFromAddressEx ( LpError  lpError,
LPCTSTR  lpszAddress,
BOOL  bPostal,
BOOL  bFuzzySearch,
SWayPoint *&  lpPositions,
int &  nCount,
DWORD  dwMaxTime = DEFAULT_MAX_TIME 
)
static

The function returns location corresponding to taken address.

Parameters
lpErrorAdditional error information returned from Drive.
lpszAddressAddress in "ISO,city/ ZIP,street,house number,extra city,extra street" format.
bPostalFlag determining whether second address parameter represents city or ZIP code.
true - ZIP code.
false - City.
bFuzzySearchFlag determining whether the result will be the exact match or the best value match (true for fuzzy search of address)
lpPositionsArray of SWayPoint which contains retrieved items.
nCountSize of the lpPositions array
dwMaxTimeMaximum time (in milliseconds) function can take. If dwMaxTime=0 function execution is not time limited.
Returns
1 if successful, other value otherwise.

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 SWayPoint.

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.
Extra street strictly defines part of city where street is situated so set this parameter to part of city.

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 parameters are extra city, extra street and house number.

See Coordinates conversion section in TROUBLESHOOTING page.
The list of ISO codes can be found at http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html.
ISO code of United States of America consists of character "U" plus code of state. E.g New York has ISO code UNY.
Indian states ISO codes can be found at http://devforum.sygic.com/viewtopic.php?f=15&t=2925&p=3646&hilit=I01&sid=354efb86bb92dc0dcdfcc1bb8d656c20#p3646

Possible error codes returned from Drive are:

  • 0 - Function not succeeded.
  • 1 - Function succeeded.
  • 2 - Drive not succeeded.
  • 3 - Function reached timeout.