SFCentroidPoint

Objective-C

@interface SFCentroidPoint : NSObject

Swift

class SFCentroidPoint : NSObject

Calculate the centroid from point based geometries. Implementation based on the JTS (Java Topology Suite) CentroidPoint.

  • Initialize

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()

    Return Value

    new instance

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithGeometry:(SFGeometry *)geometry;

    Swift

    init!(geometry: SFGeometry!)

    Parameters

    geometry

    geometry to add

    Return Value

    new instance

  • Add a point based dimension 0 geometry to the centroid total

    Declaration

    Objective-C

    - (void)addGeometry:(SFGeometry *)geometry;

    Swift

    func add(_ geometry: SFGeometry!)

    Parameters

    geometry

    geometry

  • Get the centroid point

    Declaration

    Objective-C

    - (SFPoint *)centroid;

    Swift

    func centroid() -> SFPoint!

    Return Value

    centroid point