LineString
Namespace: Meshmakers.Octo.Runtime.Contracts.Geospatial.Geometry
Defines the LineString type.
public class LineString : GeoJSONObject, IGeoJSONObject, IEqualityComparer<GeoJSONObject>, IEquatable<GeoJSONObject>, IGeometryObject, IEqualityComparer<LineString>, IEquatable<LineString>
Inheritance Object → GeoJSONObject → LineString
Implements IGeoJSONObject, IEqualityComparer<GeoJSONObject>, IEquatable<GeoJSONObject>, IGeometryObject, IEqualityComparer<LineString>, IEquatable<LineString>
Remarks:
See https://tools.ietf.org/html/rfc7946#section-3.1.4
Properties
Type
public GeoJSONObjectType Type { get; }
Property Value
Coordinates
The positions of the line string.
public ReadOnlyCollection<IPosition> Coordinates { get; }
Property Value
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
LineString(IEnumerable<IEnumerable<Double>>)
Initializes a new LineString from a 2-d array of Doubles that matches the "coordinates" field in the JSON representation.
public LineString(IEnumerable<IEnumerable<double>> coordinates)
Parameters
coordinates
IEnumerable<IEnumerable<Double>>
LineString(IEnumerable<IPosition>)
Initializes a new instance of the LineString class.
public LineString(IEnumerable<IPosition> coordinates)
Parameters
coordinates
IEnumerable<IPosition>
The coordinates.
Methods
IsClosed()
Determines whether this instance has its first and last coordinate at the same position and thereby is closed.
public bool IsClosed()
Returns
Boolean
true
if this instance is closed; otherwise, false
.
IsLinearRing()
Determines whether this LineString is a LinearRing.
public bool IsLinearRing()
Returns
Boolean
true
if it is a linear ring; otherwise, false
.
Remarks:
See https://tools.ietf.org/html/rfc7946#section-3.1.1
Equals(Object)
Determines whether the specified object is equal to the current object
public bool Equals(object obj)
Parameters
obj
Object
Returns
Equals(LineString)
Determines whether the specified object is equal to the current object
public bool Equals(LineString other)
Parameters
other
LineString
Returns
Equals(LineString, LineString)
Determines whether the specified object instances are considered equal
public bool Equals(LineString left, LineString right)
Parameters
left
LineString
right
LineString
Returns
GetHashCode()
Returns the hash code for this instance
public int GetHashCode()
Returns
GetHashCode(LineString)
Returns the hash code for the specified object
public int GetHashCode(LineString other)
Parameters
other
LineString