Class LineString
A LineString is a Curve with linear interpolation between points. Each consecutive pair of points defines a line segment.
Inherited Members
Namespace: Mapsui.Geometries
Assembly: Mapsui.Geometries.dll
Syntax
public class LineString : Geometry, IGeometry, IEquatable<Geometry>
Constructors
| Improve this Doc View SourceLineString()
Initializes an instance of a LineString
Declaration
public LineString()
LineString(IEnumerable<Point>)
Initializes an instance of a LineString from a set of vertices
Declaration
public LineString(IEnumerable<Point> vertices)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Point> | vertices |
LineString(IEnumerable<Double[]>)
Initializes an instance of a LineString
Declaration
public LineString(IEnumerable<double[]> points)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Double[]> | points |
Properties
| Improve this Doc View SourceBoundingBox
The minimum bounding box for this Geometry.
Declaration
public override BoundingBox BoundingBox { get; }
Property Value
Type | Description |
---|---|
BoundingBox | BoundingBox for this geometry |
Overrides
| Improve this Doc View SourceEndPoint
Gets the vertice where this Geometry ends
Declaration
public Point EndPoint { get; }
Property Value
Type | Description |
---|---|
Point | Last vertice in LineString |
IsClosed
Returns true if this Curve is closed (StartPoint = EndPoint).
Declaration
public bool IsClosed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Length
The length of this LineString, as measured in the spatial reference system of this LineString.
Declaration
public double Length { get; }
Property Value
Type | Description |
---|---|
System.Double |
NumPoints
The number of points in this LineString.
Declaration
public int NumPoints { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This method is supplied as part of the OpenGIS Simple Features Specification
StartPoint
Returns the vertice where this Geometry begins
Declaration
public Point StartPoint { get; }
Property Value
Type | Description |
---|---|
Point | First vertice in LineString |
Vertices
Gets or sets the collection of vertices in this Geometry
Declaration
public IList<Point> Vertices { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<Point> |
Methods
| Improve this Doc View SourceClone()
Return a copy of this geometry
Declaration
public LineString Clone()
Returns
Type | Description |
---|---|
LineString | 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 | Geometry to calculate distance to |
Returns
Type | Description |
---|---|
System.Double | Shortest distance between any two points in the two geometries |
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(LineString)
Checks whether this instance is spatially equal to the LineString 'l'
Declaration
public bool Equals(LineString lineString)
Parameters
Type | Name | Description |
---|---|---|
LineString | lineString | LineString to compare to |
Returns
Type | Description |
---|---|
System.Boolean | true of the objects are spatially equal |
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 SourceGetSegments()
Returns a list of line string segments
Declaration
public List<LineString> GetSegments()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<LineString> | List of LineString |
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 SourceIsSimple()
Returns 'true' if this Geometry has no anomalous geometric points, such as self intersection or self tangency. The description of each instantiable geometric class will include the specific conditions that cause an instance of that class to be classified as not simple.
Declaration
public bool IsSimple()
Returns
Type | Description |
---|---|
System.Boolean | true if the geometry is simple |
Point(Int32)
Returns the specified point N in this Linestring.
Declaration
public Point Point(int n)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | n |
Returns
Type | Description |
---|---|
Point |
Remarks
This method is supplied as part of the OpenGIS Simple Features Specification