Table of Contents

Class GeometryCollection

Namespace
NetTopologySuite.Geometries
Assembly
NetTopologySuite.dll

Basic implementation of GeometryCollection.

public class GeometryCollection : Geometry, IComparable, IComparable<Geometry>, IEnumerable<Geometry>, IEnumerable
Inheritance
GeometryCollection
Implements
Derived
Inherited Members

Constructors

GeometryCollection(Geometry[])

public GeometryCollection(Geometry[] geometries)

Parameters

geometries Geometry[]

The Geometrys for this GeometryCollection, or null or an empty array to create the empty point. Elements may be empty Geometrys, but not nulls.

Remarks

For create this Geometry is used a standard GeometryFactory with PrecisionModel == Floating.

GeometryCollection(Geometry[], GeometryFactory)

public GeometryCollection(Geometry[] geometries, GeometryFactory factory)

Parameters

geometries Geometry[]

The Geometrys for this GeometryCollection, or null or an empty array to create the empty point. Elements may be empty Geometrys, but not nulls.

factory GeometryFactory

Fields

Empty

Represents an empty GeometryCollection.

public static readonly GeometryCollection Empty

Field Value

GeometryCollection

Properties

Area

Returns the area of this GeometryCollection.

public override double Area { get; }

Property Value

double

Boundary

public override Geometry Boundary { get; }

Property Value

Geometry

BoundaryDimension

public override Dimension BoundaryDimension { get; }

Property Value

Dimension

Coordinate

public override Coordinate Coordinate { get; }

Property Value

Coordinate

Coordinates

Collects all coordinates of all subgeometries into an Array. Note that while changes to the coordinate objects themselves may modify the Geometries in place, the returned Array as such is only a temporary container which is not synchronized back.

public override Coordinate[] Coordinates { get; }

Property Value

Coordinate[]

The collected coordinates.

Count

Returns the number of geometries contained by this GeometryCollection.

public int Count { get; }

Property Value

int

Dimension

public override Dimension Dimension { get; }

Property Value

Dimension

Geometries

public Geometry[] Geometries { get; protected set; }

Property Value

Geometry[]

GeometryType

Returns the name of this object's interface.

public override string GeometryType { get; }

Property Value

string

"GeometryCollection"

IsEmpty

public override bool IsEmpty { get; }

Property Value

bool

IsHomogeneous

Return true if all features in collection are of the same type.

public bool IsHomogeneous { get; }

Property Value

bool

this[int]

Returns the iTh element in the collection.

public Geometry this[int i] { get; }

Parameters

i int

Property Value

Geometry

Length

Returns the length of this GeometryCollection.

public override double Length { get; }

Property Value

double

NumGeometries

public override int NumGeometries { get; }

Property Value

int

NumPoints

public override int NumPoints { get; }

Property Value

int

OgcGeometryType

Gets the OGC geometry type

public override OgcGeometryType OgcGeometryType { get; }

Property Value

OgcGeometryType

SortIndex

Gets a value to sort the geometry

protected override Geometry.SortIndexValue SortIndex { get; }

Property Value

Geometry.SortIndexValue

Remarks

NOTE:
For JTS v1.17 this property's getter has been renamed to getTypeCode(). In order not to break binary compatibility we did not follow.

Methods

Apply(ICoordinateFilter)

public override void Apply(ICoordinateFilter filter)

Parameters

filter ICoordinateFilter

Apply(ICoordinateSequenceFilter)

public override void Apply(ICoordinateSequenceFilter filter)

Parameters

filter ICoordinateSequenceFilter

Apply(IEntireCoordinateSequenceFilter)

public override void Apply(IEntireCoordinateSequenceFilter filter)

Parameters

filter IEntireCoordinateSequenceFilter

Apply(IGeometryComponentFilter)

public override void Apply(IGeometryComponentFilter filter)

Parameters

filter IGeometryComponentFilter

Apply(IGeometryFilter)

public override void Apply(IGeometryFilter filter)

Parameters

filter IGeometryFilter

CompareToSameClass(object)

protected override int CompareToSameClass(object o)

Parameters

o object

Returns

int

CompareToSameClass(object, IComparer<CoordinateSequence>)

protected override int CompareToSameClass(object o, IComparer<CoordinateSequence> comp)

Parameters

o object
comp IComparer<CoordinateSequence>

Returns

int

ComputeEnvelopeInternal()

protected override Envelope ComputeEnvelopeInternal()

Returns

Envelope

CopyInternal()

protected override Geometry CopyInternal()

Returns

Geometry

EqualsExact(Geometry, double)

public override bool EqualsExact(Geometry other, double tolerance)

Parameters

other Geometry
tolerance double

Returns

bool

GetEnumerator()

public IEnumerator<Geometry> GetEnumerator()

Returns

IEnumerator<Geometry>

GetGeometryN(int)

public override Geometry GetGeometryN(int n)

Parameters

n int

Returns

Geometry

GetOrdinates(Ordinate)

public override double[] GetOrdinates(Ordinate ordinate)

Parameters

ordinate Ordinate

Returns

double[]

Normalize()

public override void Normalize()

Reverse()

Creates a GeometryCollection with every component reversed. The order of the components in the collection are not reversed.

[Obsolete("Call Geometry.Reverse()")]
public override Geometry Reverse()

Returns

Geometry

A GeometryCollection

ReverseInternal()

The actual implementation of the Reverse() function for GeometryCollections.

protected override Geometry ReverseInternal()

Returns

Geometry

A reversed geometry