NetTopologySuite
|
Supplies a set of utility methods for building Geometry objects from lists of Coordinates. More...
Public Member Functions | |
GeometryFactory (IPrecisionModel precisionModel, int srid, ICoordinateSequenceFactory coordinateSequenceFactory) | |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel, spatial-reference ID, and CoordinateSequence implementation. More... | |
GeometryFactory (ICoordinateSequenceFactory coordinateSequenceFactory) | |
Constructs a GeometryFactory that generates Geometries having the given CoordinateSequence implementation, a double-precision floating PrecisionModel and a spatial-reference ID of 0. More... | |
GeometryFactory (IPrecisionModel precisionModel) | |
Constructs a GeometryFactory that generates Geometries having the given {PrecisionModel} and the default CoordinateSequence implementation. More... | |
GeometryFactory (IPrecisionModel precisionModel, int srid) | |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel and spatial-reference ID, and the default CoordinateSequence implementation. More... | |
GeometryFactory () | |
Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0. More... | |
virtual IGeometry | ToGeometry (Envelope envelope) |
Creates a IGeometry with the same extent as the given envelope. More... | |
IPoint | CreatePoint (Coordinate coordinate) |
Creates a Point using the given Coordinate. A null coordinate creates an empty Geometry. More... | |
IPoint | CreatePoint (ICoordinateSequence coordinates) |
Creates a Point using the given CoordinateSequence ; a null or empty CoordinateSequence will create an empty Point. More... | |
ILineString | CreateLineString (Coordinate[] coordinates) |
Creates a LineString using the given Coordinates. A null or empty array creates an empty LineString. More... | |
ILineString | CreateLineString (ICoordinateSequence coordinates) |
Creates a LineString using the given CoordinateSequence. A null or empty CoordinateSequence creates an empty LineString. More... | |
ILinearRing | CreateLinearRing (Coordinate[] coordinates) |
Creates a LinearRing using the given Coordinates ; a null or empty array creates an empty LinearRing. The points must form a closed and simple linestring. Consecutive points must not be equal. More... | |
ILinearRing | CreateLinearRing (ICoordinateSequence coordinates) |
Creates a LinearRing using the given CoordinateSequence ; a null or empty CoordinateSequence creates an empty LinearRing. The points must form a closed and simple linestring. Consecutive points must not be equal. More... | |
virtual IPolygon | CreatePolygon (ILinearRing shell, ILinearRing[] holes) |
Constructs a Polygon with the given exterior boundary and interior boundaries. More... | |
virtual IPolygon | CreatePolygon (ICoordinateSequence coordinates) |
Constructs a Polygon with the given exterior boundary. More... | |
virtual IPolygon | CreatePolygon (Coordinate[] coordinates) |
Constructs a Polygon with the given exterior boundary. More... | |
virtual IPolygon | CreatePolygon (ILinearRing shell) |
Constructs a Polygon with the given exterior boundary. More... | |
IMultiPoint | CreateMultiPoint (IPoint[] point) |
Creates a IMultiPoint using the given Points. A null or empty array will create an empty MultiPoint. More... | |
IMultiPoint | CreateMultiPoint (Coordinate[] coordinates) |
Creates a IMultiPoint using the given Coordinates. A null or empty array will create an empty MultiPoint. More... | |
IMultiPoint | CreateMultiPoint (ICoordinateSequence coordinates) |
Creates a IMultiPoint using the given CoordinateSequence. A null or empty CoordinateSequence will create an empty MultiPoint. More... | |
IMultiLineString | CreateMultiLineString (ILineString[] lineStrings) |
Creates a MultiLineString using the given LineStrings ; a null or empty array will create an empty MultiLineString. More... | |
IMultiPolygon | CreateMultiPolygon (IPolygon[] polygons) |
Creates a MultiPolygon using the given Polygons ; a null or empty array will create an empty Polygon. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL. More... | |
IGeometryCollection | CreateGeometryCollection (IGeometry[] geometries) |
Creates a GeometryCollection using the given Geometries ; a null or empty array will create an empty GeometryCollection. More... | |
IGeometry | BuildGeometry (ICollection< IGeometry > geomList) |
Build an appropriate Geometry , MultiGeometry , or GeometryCollection to contain the Geometry s in it. More... | |
IGeometry | CreateGeometry (IGeometry g) |
Creates a deep copy of the input IGeometry. The ICoordinateSequenceFactory defined for this factory is used to copy the ICoordinateSequences of the input geometry. This is a convenient way to change the CoordinateSequence used to represent a geometry, or to change the factory used for a geometry. IGeometry.Clone() can also be used to make a deep copy, but it does not allow changing the CoordinateSequence type. More... | |
Static Public Member Functions | |
static IPoint | CreatePointFromInternalCoord (Coordinate coord, IGeometry exemplar) |
static IPoint[] | ToPointArray (ICollection< IGeometry > points) |
Converts the ICollection to an array. More... | |
static IGeometry[] | ToGeometryArray (ICollection< IGeometry > geometries) |
Converts the ICollection to an array. More... | |
static ILineString[] | ToLineStringArray (ICollection< IGeometry > lineStrings) |
Converts the ICollection to an array. More... | |
static ILinearRing[] | ToLinearRingArray (ICollection< IGeometry > linearRings) |
Converts the ICollection to an array. More... | |
static IPolygon[] | ToPolygonArray (ICollection< IGeometry > polygons) |
Converts the ICollection to an array. More... | |
static IMultiPoint[] | ToMultiPointArray (ICollection< IGeometry > multiPoints) |
Converts the ICollection to an array. More... | |
static IMultiLineString[] | ToMultiLineStringArray (ICollection< IGeometry > multiLineStrings) |
Converts the ICollection to an array. More... | |
static IMultiPolygon[] | ToMultiPolygonArray (ICollection< IGeometry > multiPolygons) |
Converts the ICollection to an array. More... | |
Static Public Attributes | |
static readonly IGeometryFactory | Default = new GeometryFactory() |
A predefined GeometryFactory with PrecisionModel == PrecisionModels.Floating. More... | |
static readonly IGeometryFactory | Floating = Default |
A predefined GeometryFactory with PrecisionModel == PrecisionModels.Floating. More... | |
static readonly IGeometryFactory | FloatingSingle = new GeometryFactory(new PrecisionModel(PrecisionModels.FloatingSingle)) |
A predefined GeometryFactory with PrecisionModel == PrecisionModels.FloatingSingle. More... | |
static readonly IGeometryFactory | Fixed = new GeometryFactory(new PrecisionModel(PrecisionModels.Fixed)) |
A predefined GeometryFactory with PrecisionModel == PrecisionModels.Fixed. More... | |
Properties | |
IPrecisionModel | PrecisionModel [get] |
Returns the PrecisionModel that Geometries created by this factory will be associated with. More... | |
ICoordinateSequenceFactory | CoordinateSequenceFactory [get] |
int | SRID [get] |
The SRID value defined for this factory. More... | |
Supplies a set of utility methods for building Geometry objects from lists of Coordinates.
Note that the factory constructor methods do not change the input coordinates in any way. In particular, they are not rounded to the supplied PrecisionModel
. It is assumed that input Coordinates meet the given precision.
NetTopologySuite.Geometries.GeometryFactory.GeometryFactory | ( | IPrecisionModel | precisionModel, |
int | srid, | ||
ICoordinateSequenceFactory | coordinateSequenceFactory | ||
) |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel, spatial-reference ID, and CoordinateSequence implementation.
NetTopologySuite.Geometries.GeometryFactory.GeometryFactory | ( | ICoordinateSequenceFactory | coordinateSequenceFactory | ) |
Constructs a GeometryFactory that generates Geometries having the given CoordinateSequence implementation, a double-precision floating PrecisionModel and a spatial-reference ID of 0.
NetTopologySuite.Geometries.GeometryFactory.GeometryFactory | ( | IPrecisionModel | precisionModel | ) |
Constructs a GeometryFactory that generates Geometries having the given {PrecisionModel} and the default CoordinateSequence implementation.
precisionModel | The PrecisionModel to use. |
NetTopologySuite.Geometries.GeometryFactory.GeometryFactory | ( | IPrecisionModel | precisionModel, |
int | srid | ||
) |
Constructs a GeometryFactory that generates Geometries having the given PrecisionModel
and spatial-reference ID, and the default CoordinateSequence implementation.
precisionModel | The PrecisionModel to use. |
srid | The SRID to use. |
NetTopologySuite.Geometries.GeometryFactory.GeometryFactory | ( | ) |
Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0.
IGeometry NetTopologySuite.Geometries.GeometryFactory.BuildGeometry | ( | ICollection< IGeometry > | geomList | ) |
Build an appropriate Geometry
, MultiGeometry
, or GeometryCollection
to contain the Geometry
s in it.
If geomList
contains a single Polygon
, the Polygon
is returned.
If geomList
contains several Polygon
s, a MultiPolygon
is returned.
If geomList
contains some Polygon
s and some LineString
s, a GeometryCollection
is returned.
If geomList
is empty, an empty GeometryCollection
is returned. Note that this method does not "flatten" Geometries in the input, and hence if any MultiGeometries are contained in the input a GeometryCollection containing them will be returned.
geomList | The Geometry to combine. |
geomList
. Determine some facts about the geometries in the list
Now construct an appropriate geometry to return
IGeometry NetTopologySuite.Geometries.GeometryFactory.CreateGeometry | ( | IGeometry | g | ) |
Creates a deep copy of the input IGeometry. The ICoordinateSequenceFactory defined for this factory is used to copy the ICoordinateSequences of the input geometry. This is a convenient way to change the CoordinateSequence
used to represent a geometry, or to change the factory used for a geometry. IGeometry.Clone() can also be used to make a deep copy, but it does not allow changing the CoordinateSequence type.
g | The geometry |
IGeometryCollection NetTopologySuite.Geometries.GeometryFactory.CreateGeometryCollection | ( | IGeometry[] | geometries | ) |
Creates a GeometryCollection
using the given Geometries
; a null or empty array will create an empty GeometryCollection.
geometries | an array of Geometries, each of which may be empty but not null, or null |
ILinearRing NetTopologySuite.Geometries.GeometryFactory.CreateLinearRing | ( | Coordinate[] | coordinates | ) |
Creates a LinearRing
using the given Coordinates
; a null or empty array creates an empty LinearRing. The points must form a closed and simple linestring. Consecutive points must not be equal.
coordinates | An array without null elements, or an empty array, or null. |
ArgumentException | If the ring is not closed, or has too few points |
ILinearRing NetTopologySuite.Geometries.GeometryFactory.CreateLinearRing | ( | ICoordinateSequence | coordinates | ) |
Creates a LinearRing
using the given CoordinateSequence
; a null or empty CoordinateSequence creates an empty LinearRing. The points must form a closed and simple linestring. Consecutive points must not be equal.
coordinates | A CoordinateSequence (possibly empty), or null. |
ArgumentException | If the ring is not closed, or has too few points |
ILineString NetTopologySuite.Geometries.GeometryFactory.CreateLineString | ( | Coordinate[] | coordinates | ) |
Creates a LineString using the given Coordinates. A null or empty array creates an empty LineString.
coordinates | An array without null elements, or an empty array, or null. |
ILineString NetTopologySuite.Geometries.GeometryFactory.CreateLineString | ( | ICoordinateSequence | coordinates | ) |
Creates a LineString using the given CoordinateSequence. A null or empty CoordinateSequence creates an empty LineString.
coordinates | A CoordinateSequence (possibly empty), or null. |
IMultiLineString NetTopologySuite.Geometries.GeometryFactory.CreateMultiLineString | ( | ILineString[] | lineStrings | ) |
Creates a MultiLineString
using the given LineStrings
; a null or empty array will create an empty MultiLineString.
lineStrings | LineStrings, each of which may be empty but not null- |
IMultiPoint NetTopologySuite.Geometries.GeometryFactory.CreateMultiPoint | ( | IPoint[] | point | ) |
Creates a IMultiPoint using the given Points. A null or empty array will create an empty MultiPoint.
point | An array (without null elements), or an empty array, or null . |
IMultiPoint NetTopologySuite.Geometries.GeometryFactory.CreateMultiPoint | ( | Coordinate[] | coordinates | ) |
Creates a IMultiPoint using the given Coordinates. A null or empty array will create an empty MultiPoint.
coordinates | An array (without null elements), or an empty array, or null |
IMultiPoint NetTopologySuite.Geometries.GeometryFactory.CreateMultiPoint | ( | ICoordinateSequence | coordinates | ) |
Creates a IMultiPoint using the given CoordinateSequence. A null or empty CoordinateSequence will create an empty MultiPoint.
coordinates | A CoordinateSequence (possibly empty), or null . |
IMultiPolygon NetTopologySuite.Geometries.GeometryFactory.CreateMultiPolygon | ( | IPolygon[] | polygons | ) |
Creates a MultiPolygon
using the given Polygons
; a null or empty array will create an empty Polygon. The polygons must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL.
polygons | Polygons, each of which may be empty but not null. |
IPoint NetTopologySuite.Geometries.GeometryFactory.CreatePoint | ( | Coordinate | coordinate | ) |
IPoint NetTopologySuite.Geometries.GeometryFactory.CreatePoint | ( | ICoordinateSequence | coordinates | ) |
|
static |
coord | |
exemplar |
|
virtual |
Constructs a Polygon
with the given exterior boundary and interior boundaries.
shell | The outer boundary of the new Polygon , or null or an empty LinearRing if the empty point is to be created. |
holes | The inner boundaries of the new Polygon , or null or empty LinearRing s if the empty point is to be created. |
Reimplemented in NetTopologySuite.Geometries.OgcCompliantGeometryFactory.
|
virtual |
Constructs a Polygon
with the given exterior boundary.
coordinates | the outer boundary of the new Polygon , or null or an empty LinearRing if the empty geometry is to be created. |
ArgumentException | If the boundary ring is invalid |
Reimplemented in NetTopologySuite.Geometries.OgcCompliantGeometryFactory.
|
virtual |
Constructs a Polygon
with the given exterior boundary.
coordinates | the outer boundary of the new Polygon , or null or an empty LinearRing if the empty geometry is to be created. |
ArgumentException | If the boundary ring is invalid |
Reimplemented in NetTopologySuite.Geometries.OgcCompliantGeometryFactory.
|
virtual |
Constructs a Polygon
with the given exterior boundary.
shell | the outer boundary of the new Polygon , or null or an empty LinearRing if the empty geometry is to be created. |
ArgumentException | If the boundary ring is invalid |
Reimplemented in NetTopologySuite.Geometries.OgcCompliantGeometryFactory.
|
virtual |
Creates a IGeometry with the same extent as the given envelope.
The Geometry returned is guaranteed to be valid. To provide this behaviour, the following cases occur:
If the Envelope
is:
envelope | The Envelope |
Point
(for null Envelope
s), a Point
(when min x = max x and min y = max y) or a Polygon
(in all other cases) Reimplemented in NetTopologySuite.Geometries.OgcCompliantGeometryFactory.
|
static |
Converts the ICollection
to an array.
geometries | The ICollection of Geometry 's to convert. |
ICollection
in array format.
|
static |
Converts the ICollection
to an array.
linearRings | The ICollection of LinearRings to convert. |
ICollection
in array format.
|
static |
Converts the ICollection
to an array.
lineStrings | The ICollection of LineStrings to convert. |
ICollection
in array format.
|
static |
Converts the ICollection
to an array.
multiLineStrings | The ICollection of MultiLineStrings to convert. |
ICollection
in array format.
|
static |
Converts the ICollection
to an array.
multiPoints | The ICollection of MultiPoints to convert. |
ICollection
in array format.
|
static |
Converts the ICollection
to an array.
multiPolygons | The ICollection of MultiPolygons to convert. |
ICollection
in array format.
|
static |
Converts the ICollection
to an array.
points | The ICollection of Points to convert. |
ICollection
in array format.
|
static |
Converts the ICollection
to an array.
polygons | The ICollection of Polygons to convert. |
ICollection
in array format.
|
static |
A predefined GeometryFactory with PrecisionModel ==
PrecisionModels.Floating.
|
static |
A predefined GeometryFactory with PrecisionModel ==
PrecisionModels.Fixed.
|
static |
A predefined GeometryFactory with PrecisionModel ==
PrecisionModels.Floating.
A shortcut for GeometryFactory.Default.
|
static |
A predefined GeometryFactory with PrecisionModel ==
PrecisionModels.FloatingSingle.
|
get |
|
get |
Returns the PrecisionModel that Geometries created by this factory will be associated with.
|
get |
The SRID value defined for this factory.