Class Polygon
Represents is a plane geometry figure that is bounded by a finite chain of straight line segments closing in a loop to form a closed chain or circuit.
Implements
Inherited Members
Namespace: Cassandra.Geometry
Assembly: Cassandra.dll
Syntax
[Serializable]
[JsonConverter(typeof(PolygonJsonConverter))]
public class Polygon : GeometryBase, ISerializable
Constructors
Polygon()
Creates a new instance of Polygon with no rings (empty).
Declaration
public Polygon()
Polygon(params Point[])
Creates a new instance of Polygon with a single ring.
Declaration
public Polygon(params Point[] points)
Parameters
Type | Name | Description |
---|---|---|
Point[] | points | The points of the single ring |
Polygon(params IList<Point>[])
Creates a new instance of Polygon with a sequence of rings.
Declaration
public Polygon(params IList<Point>[] points)
Parameters
Type | Name | Description |
---|---|---|
IList<Point>[] | points | The points of the single ring |
Polygon(IList<IList<Point>>)
Creates a new instance of Polygon using multiple rings.
Declaration
public Polygon(IList<IList<Point>> rings)
Parameters
Type | Name | Description |
---|---|---|
IList<IList<Point>> | rings | The polygon rings |
Polygon(SerializationInfo, StreamingContext)
Creates a new instance of Polygon using serialization information.
Declaration
protected Polygon(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
Properties
GeoCoordinates
Gets the coordinates property for GeoJSON serialization.
Declaration
protected override IEnumerable GeoCoordinates { get; }
Property Value
Type | Description |
---|---|
IEnumerable |
Overrides
Rings
A read-only list describing the rings of the polygon.
Declaration
public IList<IList<Point>> Rings { get; }
Property Value
Type | Description |
---|---|
IList<IList<Point>> |
Methods
Equals(object)
Returns a value indicating whether this instance and a specified object represent the same value.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj |
Returns
Type | Description |
---|---|
bool |
Overrides
GetHashCode()
Returns the hash code based on the value of this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
Parse(string)
Creates a Polygon instance from a Well-known Text(WKT) representation of a polygon.
Declaration
public static Polygon Parse(string textValue)
Parameters
Type | Name | Description |
---|---|---|
string | textValue |
Returns
Type | Description |
---|---|
Polygon |
ToString()
Returns Well-known text (WKT) representation of the geometry object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |