Loading...
Searching...
No Matches

Class is used for storing sublocation parameters: identifier, name, width, heigth, etc. More...

#include <com/navigine/idl/objc/NCSublocation.h>

Inherits NSObject.

Instance Methods

(nullable UIImage *) - getImage:
 Method is used to obtain origin sublocation image with specified maxTextureSize.
 
(nonnull NCLocationPoint *) - globalToLocal:
 
(nonnull NCGlobalPoint *) - localToGlobal:
 Method is used for converting the local sublocation coordinates to the global geographic coordinates (latitude and longitude) using the geographic binding of the sublocation.
 
(nullable NCGraph *) - getGraph:
 Method is used to obtain graph (within the current sublocation) with the specified identifier or null if no such graph.
 
(nullable NCVenue *) - getVenueById:
 Method returns the venue (within the current sublocation) with the specified identifier or null if no such venue exists.
 
(nullable NCZone *) - getZoneById:
 Method returns the zone (within the current sublocation) with the specified identifier or null if no such zone exists.
 

Properties

int32_t id
 sublocation's identifier.
 
int32_t location
 location's identifier to which the sublocation belongs.
 
NSString * name
 sublocation's name.
 
float width
 sublocation's width in meters.
 
float height
 sublocation's height in meters.
 
NSNumber * altitude
 sublocation's altitude in meters if specified.
 
float azimuth
 sublocation's azimuth in degrees clockwise.
 
NCGlobalPointoriginPoint
 sublocation's center point in WGS84 coordinates GlobalPoint.
 
NSString * levelId
 sublocation's levelId.
 
NSString * externalId
 sublocation's externalId.
 
NSArray< NCBeacon * > * beacons
 List of beacons, attached to this sublocation Beacon.
 
NSArray< NCEddystone * > * eddystones
 List of eddystones, attached to this sublocation Eddystone.
 
NSArray< NCWifi * > * wifis
 List of wifis, attached to this sublocation Wifi.
 
NSArray< NCVenue * > * venues
 List of venues, attached to this sublocation Venue.
 
NSArray< NCZone * > * zones
 List of zones, attached to this sublocation Zone.
 

Detailed Description

Class is used for storing sublocation parameters: identifier, name, width, heigth, etc.

The list of sublocations for the current location can be obtained from Location class using public method getSublocations.

Referenced from Location.

Definition at line 29 of file NCSublocation.h.

Method Documentation

◆ getGraph:

- (nullable NCGraph *) getGraph: (nonnull NSString *) tag

Method is used to obtain graph (within the current sublocation) with the specified identifier or null if no such graph.

Parameters
taggraph tag.
Returns
found graph or null Graph.

Swift code snippet:

// Get graph
let graph = sublocation.getGraph()
if let graph = graph {
demonstrateGraphUsage(graph)
}

Objective C code snippet:

// Get graph
NCGraph *graph = [sublocation getGraph];
if (graph != nil) {
[self demonstrateGraphUsage:graph];
}

◆ getImage:

- (nullable UIImage *) getImage: (nullable NSNumber *) maxTextureSize

Method is used to obtain origin sublocation image with specified maxTextureSize.

Parameters
maxTextureSizemaximum texure size to render.
Returns
platform image.

Swift code snippet:

// Get sublocation image
if let image = sublocation.getImage(1024) { // max texture size 1024
print("Sublocation image obtained with max texture size 1024")
}

Objective C code snippet:

// Get sublocation image
NCImageWrapper *image = [sublocation getImage:@1024]; // max texture size 1024
if (image != nil) {
NSLog(@"Sublocation image obtained with max texture size 1024");
}

◆ getVenueById:

- (nullable NCVenue *) getVenueById: (int32_t) id

Method returns the venue (within the current sublocation) with the specified identifier or null if no such venue exists.

Parameters
idvenue unique identifier.
Returns
found venue object or null Venue.

Swift code snippet:

// Get venue by ID
if !venues.isEmpty {
if let venueById = sublocation.getVenueById(venues.first!.getId()) {
print("Found venue by ID: \‍(venueById.getId())")
demonstrateVenueUsage(venueById)
}
}

Objective C code snippet:

// Get venue by ID
if (venues.count > 0) {
NCVenue *venueById = [sublocation getVenueById:[venues.firstObject getId]];
if (venueById != nil) {
NSLog(@"Found venue by ID: %d", [venueById getId]);
[self demonstrateVenueUsage:venueById];
}
}

◆ getZoneById:

- (nullable NCZone *) getZoneById: (int32_t) id

Method returns the zone (within the current sublocation) with the specified identifier or null if no such zone exists.

Parameters
idzone unique identifier.
Returns
found zone object or null Zone.

Swift code snippet:

// Get zone by ID
if !zones.isEmpty {
if let zoneById = sublocation.getZoneById(zones.first!.getId()) {
print("Found zone by ID: \‍(zoneById.getId())")
demonstrateZoneUsage(zoneById)
}
}

Objective C code snippet:

// Get zone by ID
if (zones.count > 0) {
NCZone *zoneById = [sublocation getZoneById:[zones.firstObject getId]];
if (zoneById != nil) {
NSLog(@"Found zone by ID: %d", [zoneById getId]);
[self demonstrateZoneUsage:zoneById];
}
}

◆ globalToLocal:

- (nonnull NCLocationPoint *) globalToLocal: (nonnull NCGlobalPoint *) globalPoint

Method is used for converting the global geographic coordinates (latitude and longitude) to the local sublocation coordinates (x and y) using the geographic binding of the sublocation

Parameters
globalPointpoint in WGS84 coordinates GlobalPoint
Returns
point in metrics coordinates LocationPoint.

Swift code snippet:

// Convert global coordinates to local coordinates
let globalPoint = NCGlobalPoint(lat: 55.7558, lon: 37.6176) // Moscow coordinates
let localPoint = sublocation.globalToLocal(globalPoint)
print("Global point \‍(globalPoint.getLat()), \‍(globalPoint.getLon()) converted to local: \‍(localPoint.getX()), \‍(localPoint.getY())")

Objective C code snippet:

// Convert global coordinates to local coordinates
NCGlobalPoint *globalPoint = [[NCGlobalPoint alloc] initWithLat:55.7558 lon:37.6176]; // Moscow coordinates
NCLocationPoint *localPoint = [sublocation globalToLocal:globalPoint];
NSLog(@"Global point %.6f, %.6f converted to local: %.2f, %.2f",
[globalPoint getLat], [globalPoint getLon], [localPoint getX], [localPoint getY]);

◆ localToGlobal:

- (nonnull NCGlobalPoint *) localToGlobal: (nonnull NCLocationPoint *) localPoint

Method is used for converting the local sublocation coordinates to the global geographic coordinates (latitude and longitude) using the geographic binding of the sublocation.

Parameters
localPointpoint in metrics coordinates LocationPoint
Returns
point in WGS84 coordinates GlobalPoint.

Swift code snippet:

// Convert local coordinates to global coordinates
let localPoint2 = NCLocationPoint(x: 100.0, y: 200.0)
let globalPoint2 = sublocation.localToGlobal(localPoint2)
print("Local point \‍(localPoint2.getX()), \‍(localPoint2.getY()) converted to global: \‍(globalPoint2.getLat()), \‍(globalPoint2.getLon())")

Objective C code snippet:

// Convert local coordinates to global coordinates
NCLocationPoint *localPoint2 = [[NCLocationPoint alloc] initWithX:100.0 y:200.0];
NCGlobalPoint *globalPoint2 = [sublocation localToGlobal:localPoint2];
NSLog(@"Local point %.2f, %.2f converted to global: %.6f, %.6f",
[localPoint2 getX], [localPoint2 getY], [globalPoint2 getLat], [globalPoint2 getLon]);

Property Documentation

◆ altitude

- (NSNumber*) altitude
readnonatomicassign

sublocation's altitude in meters if specified.

Swift code snippet:

// Get sublocation altitude in meters
if let altitude = sublocation.getAltitude() {
print("Sublocation altitude: \‍(altitude) meters")
}

Objective C code snippet:

// Get sublocation altitude in meters
NSNumber *altitude = [sublocation getAltitude];
if (altitude != nil) {
NSLog(@"Sublocation altitude: %.2f meters", [altitude doubleValue]);
}

Definition at line 209 of file NCSublocation.h.

◆ azimuth

- (float) azimuth
readnonatomicassign

sublocation's azimuth in degrees clockwise.

Swift code snippet:

// Get sublocation azimuth in degrees
let azimuth = sublocation.getAzimuth()
print("Sublocation azimuth: \‍(azimuth) degrees")

Objective C code snippet:

// Get sublocation azimuth in degrees
double azimuth = [sublocation getAzimuth];
NSLog(@"Sublocation azimuth: %.2f degrees", azimuth);

Definition at line 222 of file NCSublocation.h.

◆ beacons

- (NSArray<NCBeacon *>*) beacons
readnonatomicassign

List of beacons, attached to this sublocation Beacon.

Swift code snippet:

// Get beacons
let beacons = sublocation.getBeacons()
print("Number of beacons: \‍(beacons.count)")

Objective C code snippet:

// Get beacons
NSArray<NCBeacon *> *beacons = [sublocation getBeacons];
NSLog(@"Number of beacons: %lu", (unsigned long)beacons.count);

Definition at line 274 of file NCSublocation.h.

◆ eddystones

- (NSArray<NCEddystone *>*) eddystones
readnonatomicassign

List of eddystones, attached to this sublocation Eddystone.

Swift code snippet:

// Get Eddystone beacons
let eddystones = sublocation.getEddystones()
print("Number of Eddystone beacons: \‍(eddystones.count)")

Objective C code snippet:

// Get Eddystone beacons
NSArray<NCEddystone *> *eddystones = [sublocation getEddystones];
NSLog(@"Number of Eddystone beacons: %lu", (unsigned long)eddystones.count);

Definition at line 287 of file NCSublocation.h.

◆ externalId

- (NSString*) externalId
readnonatomicassign

sublocation's externalId.

Swift code snippet:

// Get sublocation external ID
let externalId = sublocation.getExternalId()
print("Sublocation external ID: \‍(externalId)")

Objective C code snippet:

// Get sublocation external ID
NSString *externalId = [sublocation getExternalId];
NSLog(@"Sublocation external ID: %@", externalId);

Definition at line 261 of file NCSublocation.h.

◆ height

- (float) height
readnonatomicassign

sublocation's height in meters.

Swift code snippet:

// Get sublocation height in meters
let height = sublocation.getHeight()
print("Sublocation height: \‍(height) meters")

Objective C code snippet:

// Get sublocation height in meters
double height = [sublocation getHeight];
NSLog(@"Sublocation height: %.2f meters", height);

Definition at line 196 of file NCSublocation.h.

◆ id

- (int32_t) id
readnonatomicassign

sublocation's identifier.

Swift code snippet:

// Get sublocation ID
let sublocationId = sublocation.getId()
print("Sublocation ID: \‍(sublocationId)")

Objective C code snippet:

// Get sublocation ID
int32_t sublocationId = [sublocation getId];
NSLog(@"Sublocation ID: %d", sublocationId);

Definition at line 144 of file NCSublocation.h.

◆ levelId

- (NSString*) levelId
readnonatomicassign

sublocation's levelId.

Swift code snippet:

// Get sublocation level ID
let levelId = sublocation.getLevelId()
print("Sublocation level ID: \‍(levelId)")

Objective C code snippet:

// Get sublocation level ID
NSString *levelId = [sublocation getLevelId];
NSLog(@"Sublocation level ID: %@", levelId);

Definition at line 248 of file NCSublocation.h.

◆ location

- (int32_t) location
readnonatomicassign

location's identifier to which the sublocation belongs.

Swift code snippet:

// Get location ID
let locationId = sublocation.getLocation()
print("Sublocation location ID: \‍(locationId)")

Objective C code snippet:

// Get location ID
int32_t locationId = [sublocation getLocation];
NSLog(@"Sublocation location ID: %d", locationId);

Definition at line 157 of file NCSublocation.h.

◆ name

- (NSString*) name
readnonatomicassign

sublocation's name.

Swift code snippet:

// Get sublocation name
let sublocationName = sublocation.getName()
print("Sublocation name: \‍(sublocationName ?? "nil")")

Objective C code snippet:

// Get sublocation name
NSString *sublocationName = [sublocation getName];
NSLog(@"Sublocation name: %@", sublocationName);

Definition at line 170 of file NCSublocation.h.

◆ originPoint

- (NCGlobalPoint*) originPoint
readnonatomicassign

sublocation's center point in WGS84 coordinates GlobalPoint.

Swift code snippet:

// Get sublocation origin point in WGS84 coordinates
let originPoint = sublocation.getOriginPoint()
print("Sublocation origin point: \‍(originPoint.getLat()), \‍(originPoint.getLon())")

Objective C code snippet:

// Get sublocation origin point in WGS84 coordinates
NCGlobalPoint *originPoint = [sublocation getOriginPoint];
NSLog(@"Sublocation origin point: %.6f, %.6f", [originPoint getLat], [originPoint getLon]);

Definition at line 235 of file NCSublocation.h.

◆ venues

- (NSArray<NCVenue *>*) venues
readnonatomicassign

List of venues, attached to this sublocation Venue.

Swift code snippet:

// Get venues
let venues = sublocation.getVenues()
print("Number of venues: \‍(venues.count)")

Objective C code snippet:

// Get venues
NSArray<NCVenue *> *venues = [sublocation getVenues];
NSLog(@"Number of venues: %lu", (unsigned long)venues.count);

Definition at line 319 of file NCSublocation.h.

◆ width

- (float) width
readnonatomicassign

sublocation's width in meters.

Swift code snippet:

// Get sublocation width in meters
let width = sublocation.getWidth()
print("Sublocation width: \‍(width) meters")

Objective C code snippet:

// Get sublocation width in meters
double width = [sublocation getWidth];
NSLog(@"Sublocation width: %.2f meters", width);

Definition at line 183 of file NCSublocation.h.

◆ wifis

- (NSArray<NCWifi *>*) wifis
readnonatomicassign

List of wifis, attached to this sublocation Wifi.

Swift code snippet:

// Get WiFi access points
let wifis = sublocation.getWifis()
print("Number of WiFi access points: \‍(wifis.count)")

Objective C code snippet:

// Get WiFi access points
NSArray<NCWifi *> *wifis = [sublocation getWifis];
NSLog(@"Number of WiFi access points: %lu", (unsigned long)wifis.count);

Definition at line 300 of file NCSublocation.h.

◆ zones

- (NSArray<NCZone *>*) zones
readnonatomicassign

List of zones, attached to this sublocation Zone.

Swift code snippet:

// Get zones
let zones = sublocation.getZones()
print("Number of zones: \‍(zones.count)")

Objective C code snippet:

// Get zones
NSArray<NCZone *> *zones = [sublocation getZones];
NSLog(@"Number of zones: %lu", (unsigned long)zones.count);

Definition at line 332 of file NCSublocation.h.


The documentation for this class was generated from the following file: