SGGeoJSONEncoder


Converts annotations into GeoJSONObjects and vice-versa.

Superclass: NSObject
Declared In: SGGeoJSONEncoder.h

Discussion

Objects returned from SGLocationService are represented as GeoJSON object. A GeoJSON object is just an NSDictionary with specific key/values. For further information on GeoJSON See here



Methods

+geoJSONObjectForRecordAnnotations:

Returns a new GeoJSONObject that was constructed from the list of SGRecordAnnotation objects.

+layerNameFromLayerLink:

Returns the layer name from the layer link of a GeoJSON object.

+recordForGeoJSONObject:

Creates a new //simplegeo/ooc/intf/SGRecord SGRecord fromt a GeoJSON object.

+recordsForGeoJSONObject:

Returns a list of SGRecord


geoJSONObjectForRecordAnnotations:


Returns a new GeoJSONObject that was constructed from the list of SGRecordAnnotation objects.

+ (NSDictionary*) geoJSONObjectForRecordAnnotations:(NSArray*)recordAnnotations; 
Parameters
recordAnnotations

The array of record annotations that help construct the GeoJSON object. 

Return Value

A new GeoJSON object.


layerNameFromLayerLink:


Returns the layer name from the layer link of a GeoJSON object.

+ (NSString*) layerNameFromLayerLink:(NSString*)layerLink; 
Parameters
layerLink

The link to the layer that stores a GeoJSON object.

Return Value

The layer that was obtained from the layer link.


recordForGeoJSONObject:


Creates a new //simplegeo/ooc/intf/SGRecord SGRecord fromt a GeoJSON object.

+ (id<SGRecordAnnotation>) recordForGeoJSONObject:(NSDictionary *)geojsonObject; 
Parameters
geojsonObject

 A valid GeoJSON object.

Return Value

A new SGRecord created from the geoJSONObject.


recordsForGeoJSONObject:


Returns a list of SGRecord

+ (NSArray*) recordsForGeoJSONObject:(NSDictionary*)geojsonObject; 
Parameters
geojsonObject

A valid GeoJSON object.

Return Value

An array of newly allocated records that were constructed from the GeoJSONObject.

© SimpleGeo Last Updated: 03/31/2010