Table of Contents

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

Envelope

Methods

BuildGeometry(Geometry, Geometry)

Method to build a geometry.

public static Geometry BuildGeometry(Geometry a, Geometry b)

Parameters

a Geometry

A geometry

b Geometry

A geometry

Returns

Geometry

A GEOMETRYCOLLECTION containing a and b.

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 containing geoms.

BuildGeometry(IList<Geometry>, Geometry)

Builds a geometry from a list of geometries.

The function returns
  • nullif the list is null or empty
  • geoms[0]if the list contains one single item.
  • a GeometryCollection
  • a Multi-geometry
public static Geometry BuildGeometry(IList<Geometry> geoms, Geometry parentGeom)

Parameters

geoms IList<Geometry>

A list of geometries.

parentGeom Geometry

A parent geometry

Returns

Geometry

A geometry.

BuildGeometry(List<Geometry>, Geometry)

Builds a geometry from a list of geometries.

The function returns
  • nullif the list is null or empty
  • geoms[0]if the list contains one single item.
  • a GeometryCollection
  • a Multi-geometry
[Obsolete]
public static Geometry BuildGeometry(List<Geometry> geoms, Geometry parentGeom)

Parameters

geoms List<Geometry>

A list of geometries.

parentGeom Geometry

A parent geometry

Returns

Geometry

A geometry.

GetEnvelopeOrDefault(Geometry)

Gets the envelope of a geometry.

public static Envelope GetEnvelopeOrDefault(Geometry g)

Parameters

g Geometry

A geometry

Returns

Envelope

The envelope of g or DefaultEnvelope if g == 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 Geometry

A 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 in gs, 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