SITCoordinateConverter
Objective-C
@interface SITCoordinateConverter : NSObject
Swift
class SITCoordinateConverter : NSObject
Utility class to convert between cartesian coordinates and geographical coordinates.
-
Initializer
Declaration
Objective-C
- (instancetype _Nonnull)initWithDimensions:(SITDimensions *_Nonnull)dimensions center:(CLLocationCoordinate2D)center rotation:(SITAngle *_Nonnull)rotation;
Swift
init(dimensions: SITDimensions, center: CLLocationCoordinate2D, rotation: SITAngle)
Parameters
dimensions
Dimensions of the building
center
Center of the building
rotation
Rotation of the building
Return Value
SITCoordinateConverter
-
Dimensions of cartesian area, in meters
Declaration
Objective-C
- (SITDimensions *_Nonnull)getDimensions;
Swift
func getDimensions() -> SITDimensions
Return Value
-
Convert geographic coordinate to cartesian coordinate
Declaration
Objective-C
- (SITCartesianCoordinate *_Nonnull)toCartesianCoordinate: (CLLocationCoordinate2D)coordinate;
Swift
func toCartesianCoordinate(_ coordinate: CLLocationCoordinate2D) -> SITCartesianCoordinate
Return Value
-
Convert cartesian coordinate to geographic coordinate
Declaration
Objective-C
- (CLLocationCoordinate2D)toLocationCoordinate: (SITCartesianCoordinate *_Nonnull)cartesianCoordinate;
Swift
func toLocationCoordinate(_ cartesianCoordinate: SITCartesianCoordinate) -> CLLocationCoordinate2D
Return Value
CLLocationCoordinate2D
-
Convert point to geographic coordinate
Declaration
Objective-C
- (CLLocationCoordinate2D)coordinateFromPoint:(CGPoint)point;
Swift
func coordinate(from point: CGPoint) -> CLLocationCoordinate2D
Return Value
CLLocationCoordinate2D
-
Convert cartesian angle to geographic angle
Declaration
Objective-C
- (float)angleFromYaw:(float)yaw;
Swift
func angle(fromYaw yaw: Float) -> Float