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
dimensionsDimensions of the building
centerCenter of the building
rotationRotation of the building
Return Value
SITCoordinateConverter
-
Dimensions of cartesian area, in meters
Declaration
Objective-C
- (SITDimensions *_Nonnull)getDimensions;Swift
func getDimensions() -> SITDimensionsReturn Value
-
Convert geographic coordinate to cartesian coordinate
Declaration
Objective-C
- (SITCartesianCoordinate *_Nonnull)toCartesianCoordinate: (CLLocationCoordinate2D)coordinate;Swift
func toCartesianCoordinate(_ coordinate: CLLocationCoordinate2D) -> SITCartesianCoordinateReturn Value
-
Convert cartesian coordinate to geographic coordinate
Declaration
Objective-C
- (CLLocationCoordinate2D)toLocationCoordinate: (SITCartesianCoordinate *_Nonnull)cartesianCoordinate;Swift
func toLocationCoordinate(_ cartesianCoordinate: SITCartesianCoordinate) -> CLLocationCoordinate2DReturn Value
CLLocationCoordinate2D -
Convert point to geographic coordinate
Declaration
Objective-C
- (CLLocationCoordinate2D)coordinateFromPoint:(CGPoint)point;Swift
func coordinate(from point: CGPoint) -> CLLocationCoordinate2DReturn Value
CLLocationCoordinate2D -
Convert cartesian angle to geographic angle
Declaration
Objective-C
- (float)angleFromYaw:(float)yaw;Swift
func angle(fromYaw yaw: Float) -> Float