SFGFeatureConverter
Objective-C
@interface SFGFeatureConverter : NSObject
Swift
class SFGFeatureConverter : NSObject
Feature Converter
-
Convert the JSON string to a feature
Declaration
Objective-C
+ (SFGFeature *)jsonToFeature:(NSString *)json;
Swift
class func json(toFeature json: String!) -> SFGFeature!
Parameters
json
JSON string
Return Value
feature
-
Convert the JSON tree to a feature
Declaration
Objective-C
+ (SFGFeature *)treeToFeature:(NSDictionary *)tree;
Swift
class func tree(toFeature tree: [AnyHashable : Any]!) -> SFGFeature!
Parameters
tree
tree node
Return Value
feature
-
Convert a simple geometry to a feature
Declaration
Objective-C
+ (SFGFeature *)simpleGeometryToFeature:(SFGeometry *)simpleGeometry;
Swift
class func simpleGeometry(toFeature simpleGeometry: SFGeometry!) -> SFGFeature!
Parameters
simpleGeometry
simple geometry
Return Value
feature
-
Convert the JSON string to a feature collection
Declaration
Objective-C
+ (SFGFeatureCollection *)jsonToFeatureCollection:(NSString *)json;
Swift
class func json(toFeatureCollection json: String!) -> SFGFeatureCollection!
Parameters
json
JSON string
Return Value
feature collection
-
Convert the JSON tree to a feature collection
Declaration
Objective-C
+ (SFGFeatureCollection *)treeToFeatureCollection:(NSDictionary *)tree;
Swift
class func tree(toFeatureCollection tree: [AnyHashable : Any]!) -> SFGFeatureCollection!
Parameters
tree
tree node
Return Value
feature collection
-
Convert a simple geometry to a feature collection
Declaration
Objective-C
+ (SFGFeatureCollection *)simpleGeometryToFeatureCollection: (SFGeometry *)simpleGeometry;
Swift
class func simpleGeometry(toFeatureCollection simpleGeometry: SFGeometry!) -> SFGFeatureCollection!
Parameters
simpleGeometry
simple geometry
Return Value
feature collection
-
Convert simple geometries to a feature collection
Declaration
Objective-C
+ (SFGFeatureCollection *)simpleGeometriesToFeatureCollection: (NSArray<SFGeometry *> *)simpleGeometries;
Swift
class func simpleGeometries(toFeatureCollection simpleGeometries: [SFGeometry]!) -> SFGFeatureCollection!
Parameters
simpleGeometries
simple geometries
Return Value
feature collection
-
Convert the string content to a GeoJSON object
Declaration
Objective-C
+ (SFGGeoJSONObject *)jsonToObject:(NSString *)json;
Swift
class func json(toObject json: String!) -> SFGGeoJSONObject!
Parameters
json
JSON string
Return Value
GeoJSON object
-
Convert the JSON tree to a GeoJSON Object
Declaration
Objective-C
+ (SFGGeoJSONObject *)treeToObject:(NSDictionary *)tree;
Swift
class func tree(toObject tree: [AnyHashable : Any]!) -> SFGGeoJSONObject!
Parameters
tree
JSON tree
Return Value
GeoJSON object
-
Convert the string content to a simple geometry
Declaration
Objective-C
+ (SFGeometry *)jsonToSimpleGeometry:(NSString *)json;
Swift
class func json(toSimpleGeometry json: String!) -> SFGeometry!
Parameters
json
JSON string
Return Value
simple geometry
-
Convert the JSON tree to a simple geometry
Declaration
Objective-C
+ (SFGeometry *)treeToSimpleGeometry:(NSDictionary *)tree;
Swift
class func tree(toSimpleGeometry tree: [AnyHashable : Any]!) -> SFGeometry!
Parameters
tree
JSON tree
Return Value
simple geometry
-
Convert the GeoJSON object to a simple geometry
Declaration
Objective-C
+ (SFGeometry *)objectToSimpleGeometry:(SFGGeoJSONObject *)geoJson;
Swift
class func object(toSimpleGeometry geoJson: SFGGeoJSONObject!) -> SFGeometry!
Parameters
geoJson
GeoJSON object
Return Value
simple geometry
-
Convert the object to a JSON value
Declaration
Objective-C
+ (NSString *)objectToJSON:(SFGGeoJSONObject *)object;
Swift
class func object(toJSON object: SFGGeoJSONObject!) -> String!
Parameters
object
object
Return Value
string value
-
Convert the simple geometry to a JSON value
Declaration
Objective-C
+ (NSString *)simpleGeometryToJSON:(SFGeometry *)simpleGeometry;
Swift
class func simpleGeometry(toJSON simpleGeometry: SFGeometry!) -> String!
Parameters
simpleGeometry
simple geometry
Return Value
string value
-
Convert the JSON tree to a JSON string
Declaration
Objective-C
+ (NSString *)treeToJSON:(id)object;
Swift
class func tree(toJSON object: Any!) -> String!
Parameters
object
JSON object
Return Value
JSON string
-
Convert the GeoJSON object to a mutable tree
Declaration
Objective-C
+ (NSMutableDictionary *)objectToMutableTree:(SFGGeoJSONObject *)object;
Swift
class func object(toMutableTree object: SFGGeoJSONObject!) -> NSMutableDictionary!
Parameters
object
GeoJSON object
Return Value
object map
-
Convert the GeoJSON object to a tree
Declaration
Objective-C
+ (NSDictionary *)objectToTree:(SFGGeoJSONObject *)object;
Swift
class func object(toTree object: SFGGeoJSONObject!) -> [AnyHashable : Any]!
Parameters
object
GeoJSON object
Return Value
object map
-
Convert the JSON string to a mutable JSON tree
Declaration
Objective-C
+ (NSMutableDictionary *)jsonToMutableTree:(NSString *)json;
Swift
class func json(toMutableTree json: String!) -> NSMutableDictionary!
Parameters
json
JSON string
Return Value
tree
-
Convert the JSON string to a JSON tree
Declaration
Objective-C
+ (NSDictionary *)jsonToTree:(NSString *)json;
Swift
class func json(toTree json: String!) -> [AnyHashable : Any]!
Parameters
json
JSON string
Return Value
tree
-
Convert the simple geometry to a mutable tree
Declaration
Objective-C
+ (NSMutableDictionary *)simpleGeometryToMutableTree: (SFGeometry *)simpleGeometry;
Swift
class func simpleGeometry(toMutableTree simpleGeometry: SFGeometry!) -> NSMutableDictionary!
Parameters
simpleGeometry
simple geometry
Return Value
object map
-
Convert the simple geometry to a tree
Declaration
Objective-C
+ (NSDictionary *)simpleGeometryToTree:(SFGeometry *)simpleGeometry;
Swift
class func simpleGeometry(toTree simpleGeometry: SFGeometry!) -> [AnyHashable : Any]!
Parameters
simpleGeometry
simple geometry
Return Value
object map
-
Convert the JSON string to a geometry
Declaration
Objective-C
+ (SFGGeometry *)jsonToGeometry:(NSString *)json;
Swift
class func json(toGeometry json: String!) -> SFGGeometry!
Parameters
json
JSON string
Return Value
geometry
-
Convert the JSON tree to a geometry
Declaration
Objective-C
+ (SFGGeometry *)treeToGeometry:(NSDictionary *)tree;
Swift
class func tree(toGeometry tree: [AnyHashable : Any]!) -> SFGGeometry!
Parameters
tree
JSON tree
Return Value
geometry
-
Convert the simple geometry to a geometry
Declaration
Objective-C
+ (SFGGeometry *)simpleGeometryToGeometry:(SFGeometry *)simpleGeometry;
Swift
class func simpleGeometry(to simpleGeometry: SFGeometry!) -> SFGGeometry!
Parameters
simpleGeometry
simple geometry
Return Value
geometry
-
Convert the JSON tree to a line string
Declaration
Objective-C
+ (SFGLineString *)treeToLineString:(NSDictionary *)tree;
Swift
class func tree(toLineString tree: [AnyHashable : Any]!) -> SFGLineString!
Parameters
tree
JSON tree
Return Value
line string
-
Convert the JSON tree to a polygon
Declaration
Objective-C
+ (SFGPolygon *)treeToPolygon:(NSDictionary *)tree;
Swift
class func tree(toPolygon tree: [AnyHashable : Any]!) -> SFGPolygon!
Parameters
tree
JSON tree
Return Value
polygon
-
Convert the JSON tree to a multi point
Declaration
Objective-C
+ (SFGMultiPoint *)treeToMultiPoint:(NSDictionary *)tree;
Swift
class func tree(toMultiPoint tree: [AnyHashable : Any]!) -> SFGMultiPoint!
Parameters
tree
JSON tree
Return Value
multi point
-
Convert the JSON tree to a multi line string
Declaration
Objective-C
+ (SFGMultiLineString *)treeToMultiLineString:(NSDictionary *)tree;
Swift
class func tree(toMultiLineString tree: [AnyHashable : Any]!) -> SFGMultiLineString!
Parameters
tree
JSON tree
Return Value
multi line string
-
Convert the JSON tree to a multi polygon
Declaration
Objective-C
+ (SFGMultiPolygon *)treeToMultiPolygon:(NSDictionary *)tree;
Swift
class func tree(toMultiPolygon tree: [AnyHashable : Any]!) -> SFGMultiPolygon!
Parameters
tree
JSON tree
Return Value
multi polygon
-
Convert the JSON tree to a geometry collection
Declaration
Objective-C
+ (SFGGeometryCollection *)treeToGeometryCollection:(NSDictionary *)tree;
Swift
class func tree(toGeometryCollection tree: [AnyHashable : Any]!) -> SFGGeometryCollection!
Parameters
tree
JSON tree
Return Value
geometry collection