Search Results for

    Show / Hide Table of Contents

    Class GeometryCollection

    Basic implementation of GeometryCollection.

    Inheritance
    object
    Geometry
    GeometryCollection
    MultiLineString
    MultiPoint
    MultiPolygon
    Implements
    IComparable
    IComparable<Geometry>
    IReadOnlyList<Geometry>
    IReadOnlyCollection<Geometry>
    IEnumerable<Geometry>
    IEnumerable
    Inherited Members
    Geometry.TypeNamePoint
    Geometry.TypeNameMultiPoint
    Geometry.TypeNameLineString
    Geometry.TypeNameLinearRing
    Geometry.TypeNameMultiLineString
    Geometry.TypeNamePolygon
    Geometry.TypeNameMultiPolygon
    Geometry.TypeNameGeometryCollection
    Geometry.Factory
    Geometry.UserData
    Geometry.SRID
    Geometry.HasNonEmptyElements(Geometry[])
    Geometry.HasNullElements(object[])
    Geometry.HasNullElements<T>(IEnumerable<T>)
    Geometry.PrecisionModel
    Geometry.IsSimple
    Geometry.IsValid
    Geometry.Distance(Geometry)
    Geometry.IsWithinDistance(Geometry, double)
    Geometry.Centroid
    Geometry.InteriorPoint
    Geometry.PointOnSurface
    Geometry.Envelope
    Geometry.EnvelopeInternal
    Geometry.GeometryChanged()
    Geometry.GeometryChangedAction()
    Geometry.Disjoint(Geometry)
    Geometry.Touches(Geometry)
    Geometry.Intersects(Geometry)
    Geometry.Crosses(Geometry)
    Geometry.Within(Geometry)
    Geometry.Contains(Geometry)
    Geometry.Overlaps(Geometry)
    Geometry.Covers(Geometry)
    Geometry.CoveredBy(Geometry)
    Geometry.Relate(Geometry, string)
    Geometry.Relate(Geometry)
    Geometry.Equals(Geometry)
    Geometry.EqualsTopologically(Geometry)
    Geometry.Equals(object)
    Geometry.GetHashCode()
    Geometry.ToString()
    Geometry.ToText()
    Geometry.AsText()
    Geometry.ToBinary()
    Geometry.AsBinary()
    Geometry.ToGMLFeature()
    Geometry.Buffer(double)
    Geometry.Buffer(double, EndCapStyle)
    Geometry.Buffer(double, int)
    Geometry.Buffer(double, int, EndCapStyle)
    Geometry.Buffer(double, BufferParameters)
    Geometry.ConvexHull()
    Geometry.Intersection(Geometry)
    Geometry.Union(Geometry)
    Geometry.Difference(Geometry)
    Geometry.SymmetricDifference(Geometry)
    Geometry.Union()
    Geometry.EqualsExact(Geometry)
    Geometry.EqualsNormalized(Geometry)
    Geometry.Copy()
    Geometry.Normalized()
    Geometry.CompareTo(object)
    Geometry.CompareTo(Geometry)
    Geometry.CompareTo(object, IComparer<CoordinateSequence>)
    Geometry.IsEquivalentClass(Geometry)
    Geometry.CheckNotGeometryCollection(Geometry)
    Geometry.IsGeometryCollection
    Geometry.Compare(List<Geometry>, List<Geometry>)
    Geometry.Equal(Coordinate, Coordinate, double)
    Geometry.IsRectangle
    Geometry.DefaultFactory
    Geometry.CreateArray(int, double)
    Geometry.CreateArray(CoordinateSequence, Ordinate)
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.Geometries
    Assembly: NetTopologySuite.dll
    Syntax
    [Serializable]
    public class GeometryCollection : Geometry, IComparable, IComparable<Geometry>, IReadOnlyList<Geometry>, IReadOnlyCollection<Geometry>, IEnumerable<Geometry>, IEnumerable

    Constructors

    | Edit this page View Source

    GeometryCollection(Geometry[])

    Declaration
    public GeometryCollection(Geometry[] geometries)
    Parameters
    Type Name Description
    Geometry[] geometries

    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.

    | Edit this page View Source

    GeometryCollection(Geometry[], GeometryFactory)

    Declaration
    public GeometryCollection(Geometry[] geometries, GeometryFactory factory)
    Parameters
    Type Name Description
    Geometry[] geometries

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

    GeometryFactory factory

    Fields

    | Edit this page View Source

    Empty

    Represents an empty GeometryCollection.

    Declaration
    public static readonly GeometryCollection Empty
    Field Value
    Type Description
    GeometryCollection

    Properties

    | Edit this page View Source

    Area

    Returns the area of this GeometryCollection.

    Declaration
    public override double Area { get; }
    Property Value
    Type Description
    double
    Overrides
    Geometry.Area
    | Edit this page View Source

    Boundary

    Returns the boundary, or an empty geometry of appropriate dimension if this Geometry is empty. For a discussion of this function, see the OpenGIS Simple Features Specification. As stated in SFS Section 2.1.13.1, "the boundary of a Geometry is a set of Geometries of the next lower dimension."

    Declaration
    public override Geometry Boundary { get; }
    Property Value
    Type Description
    Geometry

    The closure of the combinatorial boundary of this Geometry.

    Overrides
    Geometry.Boundary
    | Edit this page View Source

    BoundaryDimension

    Returns the dimension of this Geometrys inherent boundary.

    Declaration
    public override Dimension BoundaryDimension { get; }
    Property Value
    Type Description
    Dimension

    The dimension of the boundary of the class implementing this interface, whether or not this object is the empty point. Returns Dimension.False if the boundary is the empty point.

    Overrides
    Geometry.BoundaryDimension
    | Edit this page View Source

    Coordinate

    Returns a vertex of this geometry (usually, but not necessarily, the first one), or null if the geometry is empty.

    Declaration
    public override Coordinate Coordinate { get; }
    Property Value
    Type Description
    Coordinate

    A coordinate which is a vertex of this Geometry.

    Overrides
    Geometry.Coordinate
    Remarks

    The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation.

    | Edit this page View Source

    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.

    Declaration
    public override Coordinate[] Coordinates { get; }
    Property Value
    Type Description
    Coordinate[]

    The collected coordinates.

    Overrides
    Geometry.Coordinates
    | Edit this page View Source

    Count

    Returns the number of geometries contained by this GeometryCollection.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Dimension

    Returns the dimension of this geometry.

    Declaration
    public override Dimension Dimension { get; }
    Property Value
    Type Description
    Dimension

    The topological dimensions of this geometry

    Overrides
    Geometry.Dimension
    Remarks

    The dimension of a geometry is is the topological dimension of its embedding in the 2-D Euclidean plane. In the NTS spatial model, dimension values are in the set {0,1,2}.

    Note that this is a different concept to the dimension of the vertex Coordinates. The geometry dimension can never be greater than the coordinate dimension. For example, a 0-dimensional geometry (e.g. a Point) may have a coordinate dimension of 3 (X,Y,Z).

    See Also
    HasDimension(Dimension)
    | Edit this page View Source

    Geometries

    Declaration
    public Geometry[] Geometries { get; protected set; }
    Property Value
    Type Description
    Geometry[]
    | Edit this page View Source

    GeometryType

    Returns the name of this object's interface.

    Declaration
    public override string GeometryType { get; }
    Property Value
    Type Description
    string

    "GeometryCollection"

    Overrides
    Geometry.GeometryType
    | Edit this page View Source

    IsEmpty

    Tests whether the set of points covered in this Geometry is empty.

    Note this test is for topological emptiness, not structural emptiness.
    A collection containing only empty elements is reported as empty.
    To check structural emptiness use NumGeometries.
    Declaration
    public override bool IsEmpty { get; }
    Property Value
    Type Description
    bool

    true if this Geometry does not cover any points.

    Overrides
    Geometry.IsEmpty
    | Edit this page View Source

    IsHomogeneous

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

    Declaration
    public bool IsHomogeneous { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    this[int]

    Returns the iTh element in the collection.

    Declaration
    public Geometry this[int i] { get; }
    Parameters
    Type Name Description
    int i
    Property Value
    Type Description
    Geometry
    | Edit this page View Source

    Length

    Returns the length of this GeometryCollection.

    Declaration
    public override double Length { get; }
    Property Value
    Type Description
    double
    Overrides
    Geometry.Length
    | Edit this page View Source

    NumGeometries

    Returns the number of Geometryes in a GeometryCollection, or 1, if the geometry is not a collection.

    Declaration
    public override int NumGeometries { get; }
    Property Value
    Type Description
    int
    Overrides
    Geometry.NumGeometries
    | Edit this page View Source

    NumPoints

    Returns the count of this Geometrys vertices. The Geometry s contained by composite Geometrys must be Geometry's; that is, they must implement NumPoints.

    Declaration
    public override int NumPoints { get; }
    Property Value
    Type Description
    int

    The number of vertices in this Geometry.

    Overrides
    Geometry.NumPoints
    | Edit this page View Source

    OgcGeometryType

    Gets the OGC geometry type

    Declaration
    public override OgcGeometryType OgcGeometryType { get; }
    Property Value
    Type Description
    OgcGeometryType
    Overrides
    Geometry.OgcGeometryType
    | Edit this page View Source

    SortIndex

    Gets a value to sort the geometry

    Declaration
    protected override Geometry.SortIndexValue SortIndex { get; }
    Property Value
    Type Description
    Geometry.SortIndexValue
    Overrides
    Geometry.SortIndex
    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

    | Edit this page View Source

    Apply(ICoordinateFilter)

    Declaration
    public override void Apply(ICoordinateFilter filter)
    Parameters
    Type Name Description
    ICoordinateFilter filter
    Overrides
    Geometry.Apply(ICoordinateFilter)
    | Edit this page View Source

    Apply(ICoordinateSequenceFilter)

    Declaration
    public override void Apply(ICoordinateSequenceFilter filter)
    Parameters
    Type Name Description
    ICoordinateSequenceFilter filter
    Overrides
    Geometry.Apply(ICoordinateSequenceFilter)
    | Edit this page View Source

    Apply(IEntireCoordinateSequenceFilter)

    Performs an operation on this Geometry's CoordinateSequences.

    Declaration
    public override void Apply(IEntireCoordinateSequenceFilter filter)
    Parameters
    Type Name Description
    IEntireCoordinateSequenceFilter filter

    The filter to apply

    Overrides
    Geometry.Apply(IEntireCoordinateSequenceFilter)
    Remarks

    If the filter reports that a coordinate value has been changed, GeometryChanged() will be called automatically.

    | Edit this page View Source

    Apply(IGeometryComponentFilter)

    Declaration
    public override void Apply(IGeometryComponentFilter filter)
    Parameters
    Type Name Description
    IGeometryComponentFilter filter
    Overrides
    Geometry.Apply(IGeometryComponentFilter)
    | Edit this page View Source

    Apply(IGeometryFilter)

    Declaration
    public override void Apply(IGeometryFilter filter)
    Parameters
    Type Name Description
    IGeometryFilter filter
    Overrides
    Geometry.Apply(IGeometryFilter)
    | Edit this page View Source

    CompareToSameClass(object)

    Returns whether this Geometry is greater than, equal to, or less than another Geometry having the same class.

    Declaration
    protected override int CompareToSameClass(object o)
    Parameters
    Type Name Description
    object o

    A Geometry having the same class as this Geometry.

    Returns
    Type Description
    int

    A positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the NTS Technical Specifications.

    Overrides
    Geometry.CompareToSameClass(object)
    | Edit this page View Source

    CompareToSameClass(object, IComparer<CoordinateSequence>)

    Returns whether this Geometry is greater than, equal to, or less than another Geometry of the same class. using the given IComparer<T>.

    Declaration
    protected override int CompareToSameClass(object o, IComparer<CoordinateSequence> comp)
    Parameters
    Type Name Description
    object o

    A Geometry having the same class as this Geometry

    IComparer<CoordinateSequence> comp

    The comparer

    Returns
    Type Description
    int

    A positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than o, as defined in "Normal Form For Geometry" in the JTS Technical Specifications

    Overrides
    Geometry.CompareToSameClass(object, IComparer<CoordinateSequence>)
    | Edit this page View Source

    ComputeEnvelopeInternal()

    Declaration
    protected override Envelope ComputeEnvelopeInternal()
    Returns
    Type Description
    Envelope
    Overrides
    Geometry.ComputeEnvelopeInternal()
    | Edit this page View Source

    CopyInternal()

    An internal method to copy subclass-specific geometry data.

    Declaration
    protected override Geometry CopyInternal()
    Returns
    Type Description
    Geometry

    A copy of the target geometry object.

    Overrides
    Geometry.CopyInternal()
    | Edit this page View Source

    EqualsExact(Geometry, double)

    Declaration
    public override bool EqualsExact(Geometry other, double tolerance)
    Parameters
    Type Name Description
    Geometry other
    double tolerance
    Returns
    Type Description
    bool
    Overrides
    Geometry.EqualsExact(Geometry, double)
    | Edit this page View Source

    GetEnumerator()

    Declaration
    public IEnumerator<Geometry> GetEnumerator()
    Returns
    Type Description
    IEnumerator<Geometry>
    | Edit this page View Source

    GetGeometryN(int)

    Returns an element Geometry from a GeometryCollection, or this, if the geometry is not a collection.

    Declaration
    public override Geometry GetGeometryN(int n)
    Parameters
    Type Name Description
    int n

    The index of the geometry element.

    Returns
    Type Description
    Geometry

    The n'th geometry contained in this geometry.

    Overrides
    Geometry.GetGeometryN(int)
    | Edit this page View Source

    GetOrdinates(Ordinate)

    Gets an array of double ordinate values

    Declaration
    public override double[] GetOrdinates(Ordinate ordinate)
    Parameters
    Type Name Description
    Ordinate ordinate

    The ordinate index

    Returns
    Type Description
    double[]

    An array of ordinate values

    Overrides
    Geometry.GetOrdinates(Ordinate)
    | Edit this page View Source

    HasDimension(Dimension)

    Tests whether an atomic geometry or any element of a collection has the specified dimension.
    In particular, this can be used with mixed-dimension GeometryCollections to test if they contain an element of the specified dimension.

    Declaration
    public override bool HasDimension(Dimension dim)
    Parameters
    Type Name Description
    Dimension dim

    The dimension to test

    Returns
    Type Description
    bool

    true if the geometry has or contains an element with the dimension

    Overrides
    Geometry.HasDimension(Dimension)
    See Also
    Dimension
    | Edit this page View Source

    Normalize()

    Declaration
    public override void Normalize()
    Overrides
    Geometry.Normalize()
    | Edit this page View Source

    Reverse()

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

    Declaration
    [Obsolete("Call Geometry.Reverse()")]
    public override Geometry Reverse()
    Returns
    Type Description
    Geometry

    A GeometryCollection

    Overrides
    Geometry.Reverse()
    | Edit this page View Source

    ReverseInternal()

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

    Declaration
    protected override Geometry ReverseInternal()
    Returns
    Type Description
    Geometry

    A reversed geometry

    Overrides
    Geometry.ReverseInternal()

    Implements

    IComparable
    IComparable<T>
    IReadOnlyList<T>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IEnumerable

    Extension Methods

    PolygonalExtracter.GetPolygonals<TCollection>(Geometry)
    PolygonalExtracter.GetPolygonals<TCollection>(Geometry, TCollection)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX