Class FunctionsUtil
- Namespace
- NetTopologySuite.Utilities
- Assembly
- NetTopologySuite.dll
A utility class to get GeometryFactorys, Envelopes off of Geometrys or to build aggregate geometries.
public class FunctionsUtil
- Inheritance
-
FunctionsUtil
- Inherited Members
Constructors
FunctionsUtil()
public FunctionsUtil()
Fields
DefaultEnvelope
Gets a default envelope
public static readonly Envelope DefaultEnvelope
Field Value
Methods
BuildGeometry(Geometry, Geometry)
Method to build a geometry.
public static Geometry BuildGeometry(Geometry a, Geometry b)
Parameters
Returns
- Geometry
A
GEOMETRYCOLLECTION
containinga
andb
.
BuildGeometry(params Geometry[])
Method to build a geometry.
public static Geometry BuildGeometry(params Geometry[] geoms)
Parameters
geoms
Geometry[]An array of geometries
Returns
- Geometry
A
GEOMETRYCOLLECTION
containinggeoms
.
BuildGeometry(IList<Geometry>, Geometry)
Builds a geometry from a list of geometries.
The function returnsnull
if the list isnull
or empty
if the list contains one single item.geoms
[0]- a GeometryCollection
- a Multi-geometry
public static Geometry BuildGeometry(IList<Geometry> geoms, Geometry parentGeom)
Parameters
Returns
- Geometry
A geometry.
BuildGeometry(List<Geometry>, Geometry)
Builds a geometry from a list of geometries.
The function returnsnull
if the list isnull
or empty
if the list contains one single item.geoms
[0]- a GeometryCollection
- a Multi-geometry
[Obsolete]
public static Geometry BuildGeometry(List<Geometry> geoms, Geometry parentGeom)
Parameters
Returns
- Geometry
A geometry.
GetEnvelopeOrDefault(Geometry)
Gets the envelope of a geometry.
public static Envelope GetEnvelopeOrDefault(Geometry g)
Parameters
g
GeometryA geometry
Returns
- Envelope
The envelope of
g
or DefaultEnvelope ifg == null
.
GetFactoryOrDefault(Geometry)
Function to get the geometry factory of a geometry. If
g
is null
, a default geometry
factory is returned.
public static GeometryFactory GetFactoryOrDefault(Geometry g)
Parameters
g
GeometryA geometry
Returns
- GeometryFactory
A geometry factory
GetFactoryOrDefault(IEnumerable<Geometry>)
Function to get the geometry factory of the first geometry in a series of geometries.
If no geometry is provided ings
,
a default geometry factory is returned.
public static GeometryFactory GetFactoryOrDefault(IEnumerable<Geometry> gs)
Parameters
gs
IEnumerable<Geometry>An enumeration of geometries
Returns
- GeometryFactory
A geometry factory