Class Constructions
- Namespace
- SpatialNET
- Assembly
- SpatialNET.Extensions.dll
Small constructions with geometric results (ADR 0019): Boundary, Densify and Reverse.
Results are created through the factory and restricted to what it supports (SupportsZ, SupportsM).
public static class ConstructionsInheritance
Inherited Members
Methods
Boundary(IPolygon2D, IGeometryFactory?)
The boundary of a polygon: its rings, normalized (shells counter-clockwise, holes clockwise), one path per ring.
public static IPolyline2D Boundary(this IPolygon2D polygon, IGeometryFactory? factory = null)Parameters
polygonIPolygon2D-
The polygon.
factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default.
Returns
Exceptions
- ArgumentNullException
-
polygonisnull. - InvalidOperationException
-
No factory available.
Boundary(IPolyline2D, IGeometryFactory?)
The boundary of a polyline: its end points by the mod-2 rule (an end point that occurs an odd number of times; closed paths have no boundary, ADR 0013).
public static IMultiPoint2D Boundary(this IPolyline2D line, IGeometryFactory? factory = null)Parameters
lineIPolyline2D-
The polyline.
factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default.
Returns
Exceptions
- ArgumentNullException
-
lineisnull. - InvalidOperationException
-
No factory available.
Boundary(IGeometry2D, IGeometryFactory?)
The boundary of any geometry: the rings of a polygon, the mod-2 end points of a polyline, and an empty multipoint for a point or multipoint.
public static IGeometry2D Boundary(this IGeometry2D geometry, IGeometryFactory? factory = null)Parameters
geometryIGeometry2D-
The geometry.
factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default.
Returns
Exceptions
- ArgumentNullException
-
geometryisnull. - NotSupportedException
-
geometryis not a known geometry kind. - InvalidOperationException
-
No factory available.
Densify(IPolyline2D, double, IGeometryFactory?)
Splits every segment longer than maxSegmentLength into equal pieces no longer than it; the shape
and all original vertices stay. Z and M of new vertices are interpolated.
public static IPolyline2D Densify(this IPolyline2D line, double maxSegmentLength, IGeometryFactory? factory = null)Parameters
lineIPolyline2D-
The polyline.
maxSegmentLengthdouble-
The longest allowed segment; finite and greater than 0.
factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default.
Returns
Exceptions
- ArgumentNullException
-
lineisnull. - ArgumentOutOfRangeException
-
maxSegmentLengthis not finite or not greater than 0, or so small that the result would be unreasonably large. - InvalidOperationException
-
No factory available.
Densify(IPolygon2D, double, IGeometryFactory?)
Densifies the rings of a polygon after their normalization (shells counter-clockwise, holes clockwise), so the polygon stays valid. See SpatialNET.Constructions.Densify(SpatialNET.IPolyline2D,System.Double,SpatialNET.IGeometryFactory).
public static IPolygon2D Densify(this IPolygon2D polygon, double maxSegmentLength, IGeometryFactory? factory = null)Parameters
polygonIPolygon2D-
The polygon.
maxSegmentLengthdouble-
The longest allowed segment; finite and greater than 0.
factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default.
Returns
Exceptions
- ArgumentNullException
-
polygonisnull. - ArgumentOutOfRangeException
-
maxSegmentLengthis not finite or not greater than 0, or so small that the result would be unreasonably large. - InvalidOperationException
-
No factory available.
Densify(IGeometry2D, double, IGeometryFactory?)
Densifies a polyline or polygon; a point or multipoint is copied unchanged.
public static IGeometry2D Densify(this IGeometry2D geometry, double maxSegmentLength, IGeometryFactory? factory = null)Parameters
geometryIGeometry2D-
The geometry.
maxSegmentLengthdouble-
The longest allowed segment; finite and greater than 0.
factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default.
Returns
Exceptions
- ArgumentNullException
-
geometryisnull. - ArgumentOutOfRangeException
-
maxSegmentLengthis not finite or not greater than 0, or so small that the result would be unreasonably large. - NotSupportedException
-
geometryis not a known geometry kind. - InvalidOperationException
-
No factory available.
LineMerge(IPolyline2D, bool, IGeometryFactory?)
Joins the paths of a polyline where exactly two path ends meet (exact equality of X and Y, ADR 0023); a cycle of paths becomes one closed path. It does not node: crossing lines stay as they are. Paths of fewer than two distinct points are dropped.
public static IPolyline2D LineMerge(this IPolyline2D line, bool directed = false, IGeometryFactory? factory = null)Parameters
lineIPolyline2D-
The polyline.
directedbool-
false: a path is reversed where needed, and the direction of the first path in the input order prevails.true: two paths are joined only if the end of one is the start of the other. factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default.
Returns
Exceptions
- ArgumentNullException
-
lineisnull. - InvalidOperationException
-
No factory available.
Reverse(IPolyline2D, IGeometryFactory?)
Reverses every path and the order of the paths: the same line, traversed backwards.
public static IPolyline2D Reverse(this IPolyline2D line, IGeometryFactory? factory = null)Parameters
lineIPolyline2D-
The polyline.
factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default.
Returns
Exceptions
- ArgumentNullException
-
lineisnull. - InvalidOperationException
-
No factory available.