Class Polygon
A Polygon is a planar Surface, defined by 1 exterior boundary and 0 or more interior boundaries. Each interior boundary defines a hole in the Polygon.
Inherited Members
Namespace: Mapsui.Geometries
Assembly: Mapsui.Geometries.dll
Syntax
public class Polygon : Geometry, IGeometry, IEquatable<Geometry>
Remarks
Vertices of rings defining holes in polygons are in the opposite direction of the exterior ring.
Constructors
| Improve this Doc View SourcePolygon()
Instatiates a polygon
Declaration
public Polygon()
Polygon(LinearRing)
Instatiates a polygon based on one extorier ring.
Declaration
public Polygon(LinearRing exteriorRing)
Parameters
Type | Name | Description |
---|---|---|
LinearRing | exteriorRing | Exterior ring |
Polygon(LinearRing, IList<LinearRing>)
Instatiates a polygon based on one extorier ring and a collection of interior rings.
Declaration
public Polygon(LinearRing exteriorRing, IList<LinearRing> interiorRings)
Parameters
Type | Name | Description |
---|---|---|
LinearRing | exteriorRing | Exterior ring |
System.Collections.Generic.IList<LinearRing> | interiorRings | Interior rings |
Properties
| Improve this Doc View SourceArea
The area of this Surface, as measured in the spatial reference system of this Surface.
Declaration
public double Area { get; }
Property Value
Type | Description |
---|---|
System.Double |
BoundingBox
Returns the bounding box of the object
Declaration
public override BoundingBox BoundingBox { get; }
Property Value
Type | Description |
---|---|
BoundingBox | bounding box |
Overrides
| Improve this Doc View SourceExteriorRing
Gets or sets the exterior ring of this Polygon
Declaration
public LinearRing ExteriorRing { get; set; }
Property Value
Type | Description |
---|---|
LinearRing |
Remarks
This method is supplied as part of the OpenGIS Simple Features Specification
InteriorRings
Gets or sets the interior rings of this Polygon
Declaration
public IList<LinearRing> InteriorRings { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<LinearRing> |
NumInteriorRing
Returns the number of interior rings in this Polygon
Declaration
public int NumInteriorRing { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This method is supplied as part of the OpenGIS Simple Features Specification
Methods
| Improve this Doc View SourceClone()
Return a copy of this geometry
Declaration
public Polygon Clone()
Returns
Type | Description |
---|---|
Polygon | Copy of Geometry |
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 |
Returns
Type | Description |
---|---|
System.Double |
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(Polygon)
Determines if this Polygon and the specified Polygon object has the same values
Declaration
public bool Equals(Polygon p)
Parameters
Type | Name | Description |
---|---|---|
Polygon | p | Polygon to compare with |
Returns
Type | Description |
---|---|
System.Boolean |
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 SourceInteriorRing(Int32)
Returns the Nth interior ring for this Polygon as a LineString
Declaration
public LinearRing InteriorRing(int n)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | n |
Returns
Type | Description |
---|---|
LinearRing |
Remarks
This method is supplied as part of the OpenGIS Simple Features Specification
IsEmpty()
If true, then this Geometry represents the empty point set, Ø, for the coordinate space.
Declaration
public override bool IsEmpty()
Returns
Type | Description |
---|---|
System.Boolean | Returns 'true' if this Geometry is the empty geometry |
Overrides
| Improve this Doc View SourceRotate(Double)
Declaration
public Polygon Rotate(double degrees)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees |
Returns
Type | Description |
---|---|
Polygon |
Rotate(Double, Point)
Declaration
public Polygon Rotate(double degrees, Point center)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees | |
Point | center |
Returns
Type | Description |
---|---|
Polygon |