Zum Hauptinhalt springen

Polygon

Namespace: Meshmakers.Octo.Runtime.Contracts.Geospatial.Geometry

Defines the Polygon type. Coordinates of a Polygon are a list of linear rings coordinate arrays. The first element in the array represents the exterior ring. Any subsequent elements represent interior rings (or holes).

public class Polygon : GeoJSONObject, IGeoJSONObject, IEqualityComparer<GeoJSONObject>, IEquatable<GeoJSONObject>, IGeometryObject, IEqualityComparer<Polygon>, IEquatable<Polygon>

Inheritance Object → GeoJSONObject → Polygon
Implements IGeoJSONObject, IEqualityComparer<GeoJSONObject>, IEquatable<GeoJSONObject>, IGeometryObject, IEqualityComparer<Polygon>, IEquatable<Polygon>

Remarks:

See https://tools.ietf.org/html/rfc7946#section-3.1.6

Properties​

Type​

public GeoJSONObjectType Type { get; }

Property Value​

GeoJSONObjectType

Coordinates​

Gets the list of linestrings defining this Polygon.

public ReadOnlyCollection<LineString> Coordinates { get; }

Property Value​

ReadOnlyCollection<LineString>

BoundingBoxes​

Gets or sets the (optional) Bounding Boxes.

public Double[] BoundingBoxes { get; set; }

Property Value​

Double[]
The value of GeoJSONObject.BoundingBoxes must be a 2*n array where n is the number of dimensions represented in the contained geometries, with the lowest values for all axes followed by the highest values. The axes order of a bbox follows the axes order of geometries. In addition, the coordinate reference system for the bbox is assumed to match the coordinate reference system of the GeoJSON object of which it is a member.

CRS​

Gets or sets the (optional)

Coordinate Reference System Object.

public ICRSObject CRS { get; set; }

Property Value​

ICRSObject
The Coordinate Reference System Objects.

Constructors​

Polygon(IEnumerable<LineString>)​

Initializes a new instance of the Polygon class.

public Polygon(IEnumerable<LineString> coordinates)

Parameters​

coordinates IEnumerable<LineString>
The linear rings with the first element in the array representing the exterior ring. Any subsequent elements represent interior rings (or holes).

Polygon(IEnumerable<IEnumerable<IEnumerable<Double>>>)​

Initializes a new Polygon from a 3-d array of Doubles that matches the "coordinates" field in the JSON representation.

public Polygon(IEnumerable<IEnumerable<IEnumerable<double>>> coordinates)

Parameters​

coordinates IEnumerable<IEnumerable<IEnumerable<Double>>>

Methods​

Equals(Object)​

Determines whether the specified object is equal to the current object

public bool Equals(object obj)

Parameters​

obj Object

Returns​

Boolean

Equals(Polygon)​

Determines whether the specified object is equal to the current object

public bool Equals(Polygon other)

Parameters​

other Polygon

Returns​

Boolean

Equals(Polygon, Polygon)​

Determines whether the specified object instances are considered equal

public bool Equals(Polygon left, Polygon right)

Parameters​

left Polygon

right Polygon

Returns​

Boolean

GetHashCode()​

Returns the hash code for this instance

public int GetHashCode()

Returns​

Int32

GetHashCode(Polygon)​

Returns the hash code for the specified object

public int GetHashCode(Polygon other)

Parameters​

other Polygon

Returns​

Int32