Table of Contents

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 Constructions

Inheritance

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

polygon IPolygon2D

The polygon.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

Returns

IPolyline2D

Exceptions

ArgumentNullException

polygon is null.

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

line IPolyline2D

The polyline.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

Returns

IMultiPoint2D

Exceptions

ArgumentNullException

line is null.

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

geometry IGeometry2D

The geometry.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

Returns

IGeometry2D

Exceptions

ArgumentNullException

geometry is null.

NotSupportedException

geometry is 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

line IPolyline2D

The polyline.

maxSegmentLength double

The longest allowed segment; finite and greater than 0.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

Returns

IPolyline2D

Exceptions

ArgumentNullException

line is null.

ArgumentOutOfRangeException

maxSegmentLength is 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

polygon IPolygon2D

The polygon.

maxSegmentLength double

The longest allowed segment; finite and greater than 0.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

Returns

IPolygon2D

Exceptions

ArgumentNullException

polygon is null.

ArgumentOutOfRangeException

maxSegmentLength is 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

geometry IGeometry2D

The geometry.

maxSegmentLength double

The longest allowed segment; finite and greater than 0.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

Returns

IGeometry2D

Exceptions

ArgumentNullException

geometry is null.

ArgumentOutOfRangeException

maxSegmentLength is not finite or not greater than 0, or so small that the result would be unreasonably large.

NotSupportedException

geometry is 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

line IPolyline2D

The polyline.

directed bool

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.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

Returns

IPolyline2D

Exceptions

ArgumentNullException

line is null.

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

line IPolyline2D

The polyline.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

Returns

IPolyline2D

Exceptions

ArgumentNullException

line is null.

InvalidOperationException

No factory available.