Interface IGeometryFactory
- Namespace
- SpatialNET
- Assembly
- SpatialNET.Core.dll
The geometry factory: creates the result geometries of an algorithm from coordinates as host geometries (ADR 0004).
public interface IGeometryFactoryRemarks
Contract for implementations:
- Thread-safe or stateless – SpatialNET.GeometryFactory.Default is used by all threads.
- Buffers that are passed in are copied and not referenced after the call.
- Empty input (0 points, paths or parts) produces empty geometries, never
null. - Z may be dropped; if SpatialNET.IGeometryFactory.SupportsZ is
false, algorithms produce no Z at all. - M may be dropped; if SpatialNET.IGeometryFactory.SupportsM is
false, algorithms produce no M at all.
The source parameter is the algorithm's primary input geometry (or null);
the host can take metadata such as the spatial reference from it.
Properties
SupportsM
Whether the created geometries are meant to carry M (ADR 0015). The default is false,
so that existing host factories keep compiling and receive no M.
bool SupportsM { get; }Property Value
SupportsZ
Whether the created geometries are meant to carry Z.
bool SupportsZ { get; }Property Value
Methods
CreateMultiPoint(ReadOnlySpan<Coordinate>, IGeometry2D?)
Creates a multipoint; an empty one if there are no coordinates.
IMultiPoint2D CreateMultiPoint(ReadOnlySpan<Coordinate> coordinates, IGeometry2D? source)Parameters
coordinatesReadOnlySpan<Coordinate>-
The points.
sourceIGeometry2D?-
The primary input geometry or
null.
Returns
CreatePoint(Coordinate, IGeometry2D?)
Creates a point.
IPoint2D CreatePoint(Coordinate coordinate, IGeometry2D? source)Parameters
coordinateCoordinate-
The coordinate.
sourceIGeometry2D?-
The primary input geometry or
null.
Returns
CreatePolygon(ReadOnlySpan<PolygonPart>, IGeometry2D?)
Creates a polygon from parts; an empty one if there are no parts.
IPolygon2D CreatePolygon(ReadOnlySpan<PolygonPart> parts, IGeometry2D? source)Parameters
partsReadOnlySpan<PolygonPart>-
The parts (valid, closed, shell counter-clockwise).
sourceIGeometry2D?-
The primary input geometry or
null.
Returns
CreatePolyline(ReadOnlySpan<ReadOnlyMemory<Coordinate>>, IGeometry2D?)
Creates a polyline; an empty one if there are no paths.
IPolyline2D CreatePolyline(ReadOnlySpan<ReadOnlyMemory<Coordinate>> paths, IGeometry2D? source)Parameters
pathsReadOnlySpan<ReadOnlyMemory<Coordinate>>-
The paths as coordinate sequences.
sourceIGeometry2D?-
The primary input geometry or
null.