SPGeoJson
Objective-C
@interface SPGeoJson : NSObject
Swift
class SPGeoJson : NSObject
Object that abstracts GeoJSON data and provides convenience methods for accessing common properties as well as custom data provided by the Steerpath Platform.
GeoJSON specification can be found at: http://geojson.org/
Steerpath Meta Service documentation can be found at at http://steerpath-meta-us2.appspot.com/meta/ui/#!/default/
Need API access? Contact support@steerpath.com
-
Default constructor for SPGeoJson objects.
Declaration
Objective-C
+ (nonnull instancetype)geoJsonWith:(nonnull NSDictionary *)json;
Swift
convenience init(_ json: [AnyHashable : Any])
Parameters
json
object to parse
Return Value
new instance of SPGeoJson
-
Examples of GeoJSON types: ‘FeatureCollection’, ‘Feature’
Declaration
Objective-C
- (nullable NSString *)type;
Swift
func type() -> String?
Return Value
GeoJSON type
-
Declaration
Objective-C
- (nonnull NSArray<SPGeoJson *> *)features;
Swift
func features() -> [SPGeoJson]
Return Value
all GeoJSON features in the object. Can be an empty array.
-
Declaration
Objective-C
- (nullable id)annotation;
Swift
func annotation() -> Any?
Return Value
annotation parsed from geojson.
-
Calculates largest possible bounding box for the GeoJSON data.
Declaration
Objective-C
- (nonnull SPBoundingBox *)boundingBox;
Swift
func boundingBox() -> SPBoundingBox
Return Value
bounding box
-
Declaration
Objective-C
- (CLLocationCoordinate2D)coordinate;
Swift
func coordinate() -> CLLocationCoordinate2D
Return Value
GPS coordinate where this geojson resides. May return kCLLocationCoordinate2DInvalid if no coordinate was found.
-
Return Value
location available if geojson contains coordinate and floor information.
-
Deprecated
Use ‘geofences’ instead. This property will be removed in the future.
Return Value
a polygonal geofence if geojson contains area or type is Polygon
-
Declaration
Objective-C
- (nullable NSArray<SPGeofence *> *)geofences;
Swift
func geofences() -> [SPGeofence]?
Return Value
polygonal geofences if geosjon contains an area or if it’s type Polygon or MultiPolygon
-
Declaration
Objective-C
- (nullable NSString *)identifier;
Swift
func identifier() -> String?
Return Value
unique identifier for the GeoJSON data.
-
Declaration
Objective-C
- (nullable NSArray<NSString *> *)tags;
Swift
func tags() -> [String]?
Return Value
list of tags associated with the GeoJSON data.
-
Declaration
Objective-C
- (BOOL)hasArea;
Swift
func hasArea() -> Bool
Return Value
true if GeoJSON has an area defined.
-
Declaration
Objective-C
- (nullable NSNumber *)floor;
Swift
func floor() -> NSNumber?
Return Value
building floor level or nil if this no floor information was found.
-
Declaration
Objective-C
- (nullable NSURL *)iconURL;
Swift
func iconURL() -> URL?
Return Value
url to icon image associated with the GeoJSON data.
-
Declaration
Objective-C
- (nullable NSString *)buildingIdentifier;
Swift
func buildingIdentifier() -> String?
Return Value
unique building identifier if GeoJSON contains building specific information.
-
Declaration
Objective-C
- (nullable NSString *)localRef;
Swift
func localRef() -> String?
Return Value
unique localRef if GeoJSON contains building specific localRef.
-
Declaration
Objective-C
- (nullable NSString *)assetTrackingIdentifier;
Swift
func assetTrackingIdentifier() -> String?
Return Value
unique asset identifier if GeoJSON contains a tracking identifier.
-
Declaration
Objective-C
- (nullable NSString *)title;
Swift
func title() -> String?
Return Value
title of the GeoJSON if one was provided.
-
Declaration
Objective-C
- (nonnull NSDictionary *)properties;
Swift
func properties() -> [AnyHashable : Any]
Return Value
contains all custom data in the GeoJSON provided by the Steerpath Platform.
-
Declaration
Objective-C
- (nonnull NSString *)stringProperties:(nonnull NSString *)keyName language:(nonnull NSString *)languageCode;
Swift
func stringProperties(_ keyName: String, language languageCode: String) -> String
Return Value
contains all strings data with localised in the GeoJSON provided by the Steerpath Platform - “title”, “description” for now
-
Declaration
Objective-C
- (nonnull NSArray<NSString *> *)arrayProperties:(nonnull NSString *)keyName language: (nonnull NSString *)languageCode;
Swift
func arrayProperties(_ keyName: String, language languageCode: String) -> [String]
Return Value
contains all strings data with localised in the GeoJSON provided by the Steerpath Platform - “keywords” for now
-
Declaration
Objective-C
- (nonnull NSDictionary *)asDictionary;
Swift
func asDictionary() -> [AnyHashable : Any]
Return Value
reference to original GeoJSON in dictionary format