SITPoint

Objective-C

@interface SITPoint : NSObject <SITMapperProtocol>

Swift

class SITPoint : NSObject, SITMapperProtocol

Associate geographical coordinate (Location) with Building and Floor (Cartography) and cartesian coordinate relative to that building.

Initializers

  • Create an indoor point

    Declaration

    Objective-C

    - (instancetype _Nonnull)
         initWithCoordinate:(CLLocationCoordinate2D)coordinate
         buildingIdentifier:(NSString *_Nonnull)buildingIdentifier
            floorIdentifier:(NSString *_Nonnull)floorIdentifier
        cartesianCoordinate:(SITCartesianCoordinate *_Nonnull)cartesianCoordinate;

    Swift

    init(coordinate: CLLocationCoordinate2D, buildingIdentifier: String, floorIdentifier: String, cartesianCoordinate: SITCartesianCoordinate)

    Parameters

    coordinate

    Geographical coordinate of the point

    buildingIdentifier

    unique identifier of the building

    floorIdentifier

    unique identifier of the floor

    cartesianCoordinate

    coordinate in cartesian coordinate system

    Return Value

    initialized indoor point

  • Create an outdoor point

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithCoordinate:(CLLocationCoordinate2D)coordinate
                             buildingIdentifier:
                                 (NSString *_Nonnull)buildingIdentifier;

    Swift

    init(coordinate: CLLocationCoordinate2D, buildingIdentifier: String)

    Parameters

    coordinate

    Geographical coordinate of the point

    buildingIdentifier

    unique identifier of the building

    Return Value

    initialized outdoor point

  • Create an outdoor point with a coordinate

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWihtCoordinate:(CLLocationCoordinate2D)coordinate;

    Swift

    init(wihtCoordinate coordinate: CLLocationCoordinate2D)

    Parameters

    coordinate

    Geographical coordinate of the point

    Return Value

    initialized point

  • Create a point placed indoors. The geographical coordinate is calculated using the building

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithBuilding:(SITBuilding *_Nonnull)building
                              floorIdentifier:(NSString *_Nonnull)floorIdentifier
                          cartesianCoordinate:
                              (SITCartesianCoordinate *_Nonnull)cartesianCoordinate;

    Swift

    init(building: SITBuilding, floorIdentifier: String, cartesianCoordinate: SITCartesianCoordinate)

    Parameters

    building

    Building

    floorIdentifier

    unique identifier of the floor

    cartesianCoordinate

    coordinate in cartesian coordinate system

    Return Value

    initialized point

  • Create a point placed indoors. The cartesian coordinate is calculated using the building

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithBuilding:(SITBuilding *_Nonnull)building
                              floorIdentifier:(NSString *_Nonnull)floorIdentifier
                                   coordinate:(CLLocationCoordinate2D)coordinate;

    Swift

    init(building: SITBuilding, floorIdentifier: String, coordinate: CLLocationCoordinate2D)

    Parameters

    building

    Building

    floorIdentifier

    unique identifier of the floor

    coordinate

    Geographical coordinate of the point

    Return Value

    initialized point

Properties

  • Unique identifier of the SITBuilding.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *_Nonnull buildingIdentifier;

    Swift

    var buildingIdentifier: String { get set }
  • Unique identifier of the SITFloor.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *_Nonnull floorIdentifier;

    Swift

    var floorIdentifier: String { get set }
  • Returns cartesian coordinate (in meters) relative to the bounds of building’s base.

    Declaration

    Objective-C

    @property (nonatomic, strong) SITCartesianCoordinate *_Nullable cartesianCoordinate;

    Swift

    var cartesianCoordinate: SITCartesianCoordinate? { get set }
  • Name associated with the point (can be nil).

    Declaration

    Objective-C

    @property (nonatomic, strong) NSString *_Nullable name;

    Swift

    var name: String? { get set }

Methods

  • Check if the point refers to an indoor position.

    Declaration

    Objective-C

    - (BOOL)isIndoor;

    Swift

    func isIndoor() -> Bool

    Return Value

    BOOL value that indicates if the point is indoor (YES) or not (NO).

  • Check if the point refers to an outdoor position.

    Declaration

    Objective-C

    - (BOOL)isOutdoor;

    Swift

    func isOutdoor() -> Bool

    Return Value

    BOOL value that indicates if the point is outdoor (YES) or not (NO).

  • Compute the horizontal distance between two points.

    Declaration

    Objective-C

    - (float)distanceToPoint:(SITPoint *_Nonnull)point;

    Swift

    func distance(to point: SITPoint) -> Float

    Parameters

    point

    the point to compute the distance to.

    Return Value

    distance between points (in meters).

  • Geographical coordinate

    Declaration

    Objective-C

    - (CLLocationCoordinate2D)coordinate;

    Swift

    func coordinate() -> CLLocationCoordinate2D

    Return Value

    CLLocationCoordinate2D struct