Show / Hide Table of Contents

    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.

    Inheritance
    System.Object
    Geometry
    Polygon
    Implements
    IGeometry
    System.IEquatable<Geometry>
    Inherited Members
    Geometry.Envelope
    Geometry.GetBoundingBox()
    Geometry.AsText()
    Geometry.AsBinary()
    Geometry.ToString()
    Geometry.GeomFromText(String)
    Geometry.GeomFromWKB(Byte[])
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    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 Source

    Polygon()

    Instatiates a polygon

    Declaration
    public Polygon()
    | Improve this Doc View Source

    Polygon(LinearRing)

    Instatiates a polygon based on one extorier ring.

    Declaration
    public Polygon(LinearRing exteriorRing)
    Parameters
    Type Name Description
    LinearRing exteriorRing

    Exterior ring

    | Improve this Doc View Source

    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 Source

    Area

    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
    | Improve this Doc View Source

    BoundingBox

    Returns the bounding box of the object

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

    bounding box

    Overrides
    Geometry.BoundingBox
    | Improve this Doc View Source

    ExteriorRing

    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

    | Improve this Doc View Source

    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>
    | Improve this Doc View Source

    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 Source

    Clone()

    Return a copy of this geometry

    Declaration
    public Polygon Clone()
    Returns
    Type Description
    Polygon

    Copy of Geometry

    | Improve this Doc View Source

    Contains(Point)

    Declaration
    public override bool Contains(Point point)
    Parameters
    Type Name Description
    Point point
    Returns
    Type Description
    System.Boolean
    Overrides
    Geometry.Contains(Point)
    | Improve this Doc View Source

    Distance(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
    Geometry.Distance(Point)
    | Improve this Doc View Source

    Equals(Geometry)

    Declaration
    public override bool Equals(Geometry geom)
    Parameters
    Type Name Description
    Geometry geom
    Returns
    Type Description
    System.Boolean
    Overrides
    Geometry.Equals(Geometry)
    | Improve this Doc View Source

    Equals(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
    | Improve this Doc View Source

    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
    Geometry.GetHashCode()
    | Improve this Doc View Source

    InteriorRing(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

    | Improve this Doc View Source

    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
    Geometry.IsEmpty()
    | Improve this Doc View Source

    Rotate(Double)

    Declaration
    public Polygon Rotate(double degrees)
    Parameters
    Type Name Description
    System.Double degrees
    Returns
    Type Description
    Polygon
    | Improve this Doc View Source

    Rotate(Double, Point)

    Declaration
    public Polygon Rotate(double degrees, Point center)
    Parameters
    Type Name Description
    System.Double degrees
    Point center
    Returns
    Type Description
    Polygon

    Implements

    IGeometry
    System.IEquatable<T>

    Extension Methods

    ClippingExtension.ToSkiaPath(Polygon, IReadOnlyViewport, SKRect, Single)
    GeometryExtensions.Copy(IGeometry)
    GeometryIterator.AllVertices(IGeometry)
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX