Class GeometryCollection
A GeometryCollection is a geometry that is a collection of 1 or more geometries.
Implements
Inherited Members
Namespace: Mapsui.Geometries
Assembly: Mapsui.Geometries.dll
Syntax
public class GeometryCollection : Geometry, IEquatable<Geometry>, IGeometryCollection, IGeometry, IEnumerable<Geometry>, IEnumerable
Remarks
All the elements in a GeometryCollection must be in the same Spatial Reference. This is also the Spatial
Reference for the GeometryCollection.
GeometryCollection places no other constraints on its elements. Subclasses of GeometryCollection may
restrict membership based on dimension and may also place other constraints on the degree of spatial overlap
between elements.
Constructors
| Improve this Doc View SourceGeometryCollection()
Initializes a new GeometryCollection
Declaration
public GeometryCollection()
Properties
| Improve this Doc View SourceBoundingBox
The minimum bounding box for this Geometry, returned as a BoundingBox.
Declaration
public override BoundingBox BoundingBox { get; }
Property Value
Type | Description |
---|---|
BoundingBox |
Overrides
| Improve this Doc View SourceCollection
Gets or sets the GeometryCollection
Declaration
public IList<Geometry> Collection { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<Geometry> |
Item[Int32]
Returns an indexed geometry in the collection
Declaration
public Geometry this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Geometry index |
Property Value
Type | Description |
---|---|
Geometry | Geometry |
NumGeometries
Gets the number of geometries in the collection.
Declaration
public virtual int NumGeometries { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceClone()
Declaration
public GeometryCollection Clone()
Returns
Type | Description |
---|---|
GeometryCollection |
Contains(Point)
Declaration
public override bool Contains(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceDistance(Point)
Returns the shortest distance between any two points in the two geometries as calculated in the spatial reference system of this Geometry.
Declaration
public override double Distance(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | Geometry to calculate distance to |
Returns
Type | Description |
---|---|
System.Double | Shortest distance between any two points in the two geometries |
Overrides
| Improve this Doc View SourceEquals(Geometry)
Declaration
public override bool Equals(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceEquals(GeometryCollection)
Determines whether this GeometryCollection is spatially equal to the GeometryCollection 'g'
Declaration
public bool Equals(GeometryCollection g)
Parameters
Type | Name | Description |
---|---|---|
GeometryCollection | g |
Returns
Type | Description |
---|---|
System.Boolean | True if the GeometryCollections are equals |
Geometry(Int32)
Returns an indexed geometry in the collection
Declaration
public virtual Geometry Geometry(int n)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | n | Geometry index |
Returns
Type | Description |
---|---|
Geometry | Geometry at index N |
GetBoundingBox()
Declaration
[Obsolete("Use the BoundingBox field instead")]
public BoundingBox GetBoundingBox()
Returns
Type | Description |
---|---|
BoundingBox |
GetEnumerator()
Gets an enumerator for enumerating the geometries in the GeometryCollection
Declaration
public virtual IEnumerator<Geometry> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<Geometry> |
GetHashCode()
Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current GetHashCode(). |
Overrides
| Improve this Doc View SourceIsEmpty()
Returns empty of all the geometries are empty or the collection is empty
Declaration
public override bool IsEmpty()
Returns
Type | Description |
---|---|
System.Boolean | true of collection is empty |
Overrides
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Gets an enumerator for enumerating the geometries in the GeometryCollection
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |