NTGeoJSONGeometryWriter


@interface NTGeoJSONGeometryWriter : NSObject {
  void *swigCPtr;
  BOOL swigCMemOwn;
}

A GeoJSON writer. Generates human-readable GeoJSON representation of the geometry, feature or feature collection. Supports both 2D and 3D coordinate serialization.

  • Constructs a new GeoJSONGeometryWriter object with default settings.

    Declaration

    Objective-C

    - (id)init;
  • Returns the current source projection. If source projection is set, all geometry coordinates will be converted from given coordinate system to WGS84.

    Declaration

    Objective-C

    - (NTProjection *)getSourceProjection;

    Return Value

    The current source projection or null.

  • Sets the current source projection. If source projection is set, all geometry coordinates will be converted from given coordinate system to WGS84.

    Declaration

    Objective-C

    - (void)setSourceProjection:(NTProjection *)proj;

    Parameters

    proj

    The new source projection or null.

  • Returns the state of Z coordinate serialization.

    Declaration

    Objective-C

    - (BOOL)getZ;

    Return Value

    True if Z coordinate is stored in GeoJSON output, false otherwise. The default is false.

  • Sets the state of Z coordinate serialization.

    Declaration

    Objective-C

    - (void)setZ:(BOOL)z;

    Parameters

    z

    True when Z coordinate should be serialized, false otherwise.

  • Creates a GeoJSON string corresponding to the specified geometry.

    Warning

    Throws NSException If string could not be generated.

    Declaration

    Objective-C

    - (NSString *)writeGeometry:(NTGeometry *)geometry;

    Parameters

    geometry

    The geometry to write.

    Return Value

    The corresponding GeoJSON string.

  • Creates a GeoJSON string corresponding to the specified feature.

    Warning

    Throws NSException If string could not be generated.

    Declaration

    Objective-C

    - (NSString *)writeFeature:(NTFeature *)feature;

    Parameters

    feature

    The feature to write.

    Return Value

    The corresponding GeoJSON string.

  • Creates a GeoJSON string corresponding to the specified feature collection.

    Warning

    Throws NSException If string could not be generated.

    Declaration

    Objective-C

    - (NSString *)writeFeatureCollection:(NTFeatureCollection *)featureCollection;

    Parameters

    featureCollection

    The feature collection to write.

    Return Value

    The corresponding GeoJSON string.

  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;