Loading...
Searching...
No Matches

Polygon on the location view in WGS84 coordinates. More...

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

Inherits NSObject.

Instance Methods

(nonnull instancetype) - initWithPoints:sublocationId:innerRings:
 Default constructor for class NCLocationPolygon.
 

Class Methods

(nonnull instancetype) + locationPolygonWithPoints:sublocationId:innerRings:
 Factory method for class NCLocationPolygon.
 

Properties

NSArray< NCGlobalPoint * > * points
 Outer ring vertices in WGS84 GlobalPoint.
 
NSNumber * sublocationId
 Floor this polygon is attached to, or null for the outdoor map.
 
NSArray< NSArray< NCGlobalPoint * > * > * innerRings
 Holes. Each ring is WGS84 GlobalPoint. Empty means a solid polygon.
 

Detailed Description

Polygon on the location view in WGS84 coordinates.

points is the outer ring. innerRings are holes (as in GeoJSON: first ring outer, the rest holes). An empty list is a solid polygon.

Swift code snippet:

let ring = [
NCGlobalPoint(latitude: 55.751, longitude: 37.617),
NCGlobalPoint(latitude: 55.752, longitude: 37.618),
NCGlobalPoint(latitude: 55.751, longitude: 37.619),
]
let holes = [[
NCGlobalPoint(latitude: 55.7512, longitude: 37.6174),
NCGlobalPoint(latitude: 55.7514, longitude: 37.6176),
NCGlobalPoint(latitude: 55.7512, longitude: 37.6178),
]]
let locationPolygon = NCLocationPolygon(points: ring, sublocationId: 7, innerRings: holes)
print("LocationPolygon: sublocation \‍(locationPolygon.sublocationId ?? -1), vertices \‍(locationPolygon.points.count), holes \‍(locationPolygon.innerRings.count)")

Objective C code snippet:

NSArray<NCGlobalPoint *> *ring = @[
[[NCGlobalPoint alloc] initWithLatitude:55.751 longitude:37.617],
[[NCGlobalPoint alloc] initWithLatitude:55.752 longitude:37.618],
[[NCGlobalPoint alloc] initWithLatitude:55.751 longitude:37.619],
];
NSArray<NSArray<NCGlobalPoint *> *> *holes = @[
@[
[[NCGlobalPoint alloc] initWithLatitude:55.7512 longitude:37.6174],
[[NCGlobalPoint alloc] initWithLatitude:55.7514 longitude:37.6176],
[[NCGlobalPoint alloc] initWithLatitude:55.7512 longitude:37.6178],
],
];
NCLocationPolygon *locationPolygon = [[NCLocationPolygon alloc] initWithPoints:ring
sublocationId:@(7)
innerRings:holes];
NSLog(@"LocationPolygon: sublocation %@, vertices %lu, holes %lu",
locationPolygon.sublocationId,
(unsigned long)locationPolygon.points.count,
(unsigned long)locationPolygon.innerRings.count);

Definition at line 30 of file NCLocationPolygon.h.

Method Documentation

◆ initWithPoints:sublocationId:innerRings:

- (nonnull instancetype) initWithPoints: (nonnull NSArray< NCGlobalPoint * > *) points
sublocationId: (nullable NSNumber *) sublocationId
innerRings: (nonnull NSArray< NSArray< NCGlobalPoint * > * > *) innerRings 

Default constructor for class NCLocationPolygon.

◆ locationPolygonWithPoints:sublocationId:innerRings:

+ (nonnull instancetype) locationPolygonWithPoints: (nonnull NSArray< NCGlobalPoint * > *) points
sublocationId: (nullable NSNumber *) sublocationId
innerRings: (nonnull NSArray< NSArray< NCGlobalPoint * > * > *) innerRings 

Factory method for class NCLocationPolygon.

Property Documentation

◆ innerRings

- (NSArray<NSArray<NCGlobalPoint *> *>*) innerRings
readnonatomicassign

Holes. Each ring is WGS84 GlobalPoint. Empty means a solid polygon.

Definition at line 66 of file NCLocationPolygon.h.

◆ points

- (NSArray<NCGlobalPoint *>*) points
readnonatomicassign

Outer ring vertices in WGS84 GlobalPoint.

Definition at line 51 of file NCLocationPolygon.h.

◆ sublocationId

- (NSNumber*) sublocationId
readnonatomicassign

Floor this polygon is attached to, or null for the outdoor map.

Definition at line 58 of file NCLocationPolygon.h.


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