Table of Contents

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 IGeometryFactory

Remarks

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

bool

SupportsZ

Whether the created geometries are meant to carry Z.

bool SupportsZ { get; }

Property Value

bool

Methods

CreateMultiPoint(ReadOnlySpan<Coordinate>, IGeometry2D?)

Creates a multipoint; an empty one if there are no coordinates.

IMultiPoint2D CreateMultiPoint(ReadOnlySpan<Coordinate> coordinates, IGeometry2D? source)

Parameters

coordinates ReadOnlySpan<Coordinate>

The points.

source IGeometry2D?

The primary input geometry or null.

Returns

IMultiPoint2D

CreatePoint(Coordinate, IGeometry2D?)

Creates a point.

IPoint2D CreatePoint(Coordinate coordinate, IGeometry2D? source)

Parameters

coordinate Coordinate

The coordinate.

source IGeometry2D?

The primary input geometry or null.

Returns

IPoint2D

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

parts ReadOnlySpan<PolygonPart>

The parts (valid, closed, shell counter-clockwise).

source IGeometry2D?

The primary input geometry or null.

Returns

IPolygon2D

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

paths ReadOnlySpan<ReadOnlyMemory<Coordinate>>

The paths as coordinate sequences.

source IGeometry2D?

The primary input geometry or null.

Returns

IPolyline2D