Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Navmii SDK provides a set of classes responsible for representation of addresses an places of interest (POIs). The most basic classes to represent geographical entities are NMCity, NMState and , NMCountry and NMImage. NMCity contains the following information on a city:

  • name
  • transliterated name
  • city class (a an NSInteger taking values from -1 to 15 and representing the size of the city)
  • if the city is a capital
Code Block
languagecpp
themeEclipse
NSLog(@"city name - %@", city.name);
NSLog(@"transliterated city name - %@, city.transliteratedName");
NSLog(@"city class - %d", (int)city.cityClass);
NSLog(@"is capital - %d", (int)city.isCapital);

You can retrieve a state's

  • code
  • name

from NMState.

Code Block
languagecpp
themeEclipse
NSLog(@"state name %@", state.name);
NSLog(@"state code %@", state.code);

And from NMCountry you can fetch:

  • ISO 3 Code
  • name
  • extended info

Extended info for a an NMCountry is a an NMCountryInfoExtended instance containing in its turn the following information:

  • country's speed units
  • country's distance units
  • country's driving side
Code Block
languagecpp
themeEclipse
NSLog(@"country ISO 3 code - %@", country.iso3Code);
NSLog(@"country name - %@", country.name);
NSLog(@"country speed units - %d", country.extendedInfo.speedUnits);
NSLog(@"country distance units - %d", country.extendedInfo.distanceUnits);
NSLog(@"country driving side - %d", country.extendedInfo.drivingSide);


ADDRESSES

The NMCity, NMState and NMCountry classes are aggregated into NMAddress class. The NMAddress also provides:

  • county name
  • administrative hierarchy
  • street name
  • route number
  • house number
Code Block
languagecpp
themeEclipse
NSLog(@"county name - %@", address.country.name);
NSLog(@"state name - %@", address.state.name);
NSLog(@"county name - %@", address.county);
NSLog(@"city name - %@", address.state.name);
NSLog(@"administrative hierarchy - %@", address.adminHierarchy);
NSLog(@"street name - %@", address.street);
NSLog(@"route number - %@", address.routeNumber);
NSLog(@"house number - %@", address.houseNumber);


PLACES OF INTEREST

When working with Navmii SDK search services you will also meet NMPlace instances. They represent places of interest (POIs). A An NMPlace instance can provide you with the following info:

  • POI's name
  • place type
  • geographical location
  • POI's address
  • a BOOL value indicating if the address is approximated
  • POI data
  • images

POI data for a particular place is a an NMPoiData instance containing a an NSInteger indicating the place's primary category number and a an NSArray with numbers of all categories associated with the place.

Code Block
languagecpp
themeEclipse
NSLog(@"place name - %@", place.name);
NSLog(@"place type - %d", place.type);
NSLog(@"coordinates - %f lat, %f lon", place.coordinates.latitude, place.coordinates.longitude);
NSLog(@"address - %@, %@", place.address.street, place.address.houseNumber);
NSLog(@"is adress approximated - %d", place.isAddressApproximated);
NSLog(@"POI category - %d", place.poiData.primaryCategory);
//logs out all categories associated with the POI
for (NSNumber *category in place.poiData.categories) {
	NSLog("POI belongs to category %d", [category intValue]);
}


Images associated with a particular place can be retrieved via array of NMImage instances providing an access to image URL, thumbnail and image description. 

Code Block
languagecpp
themeEclipse
for (NMImage *image in place.images) {
	NSLog("Image url %@", image.url);
	NSLog("Image thumbnail %@", image.thumbnail);
	NSLog("Image image description %@", image.imageDescription);
}