Class NtsGeometryServices
A geometry service provider class
Inherited Members
Namespace: NetTopologySuite
Assembly: NetTopologySuite.dll
Syntax
public class NtsGeometryServices
Remarks
When overriding this class, you need to provide a public constructor with the following arguments:
- A factory to create coordinate sequences
PrecisionModel
A precision modelint
spatial reference id (srid)GeometryOverlay
A class that bundles an overlay operation function setCoordinateEqualityComparer
A class that performs checks Coordinates for equality.
Constructors
| Improve this Doc View SourceNtsGeometryServices()
Creates an instance of this class, using the CoordinateArraySequenceFactory
as default and a Floating precision model.
No DefaultSRID is specified.
The Legacy function set for overlay operations is being used.
Declaration
public NtsGeometryServices()
NtsGeometryServices(CoordinateSequenceFactory)
Creates an instance of this class, using a Floating precision model as default.
No DefaultSRID is specified.
The default coordinate sequence factory is defined by coordinateSequenceFactory
.
The Legacy function set for overlay operations is being used.
Declaration
public NtsGeometryServices(CoordinateSequenceFactory coordinateSequenceFactory)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequenceFactory | coordinateSequenceFactory |
NtsGeometryServices(CoordinateSequenceFactory, PrecisionModel, Int32)
Creates an instance of this class, using the provided CoordinateSequenceFactory,
PrecisionModel and spatial reference Id (srid
).
Declaration
public NtsGeometryServices(CoordinateSequenceFactory coordinateSequenceFactory, PrecisionModel precisionModel, int srid)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequenceFactory | coordinateSequenceFactory | The coordinate sequence factory to use. |
PrecisionModel | precisionModel | The precision model. |
Int32 | srid | The default spatial reference ID |
NtsGeometryServices(CoordinateSequenceFactory, PrecisionModel, Int32, GeometryOverlay, CoordinateEqualityComparer)
Creates an instance of this class, using the provided CoordinateSequenceFactory,
PrecisionModel, a spatial reference Id (srid
) and
a GeometryOverlay.
Declaration
public NtsGeometryServices(CoordinateSequenceFactory coordinateSequenceFactory, PrecisionModel precisionModel, int srid, GeometryOverlay geometryOverlay, CoordinateEqualityComparer coordinateEqualityComparer)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequenceFactory | coordinateSequenceFactory | The coordinate sequence factory to use. |
PrecisionModel | precisionModel | The precision model. |
Int32 | srid | The default spatial reference ID |
GeometryOverlay | geometryOverlay | The geometry overlay function set to use. |
CoordinateEqualityComparer | coordinateEqualityComparer | The equality comparer for coordinates |
NtsGeometryServices(GeometryOverlay)
Creates an instance of this class, using the CoordinateArraySequenceFactory as default and a Floating precision model. No DefaultSRID is specified
Declaration
public NtsGeometryServices(GeometryOverlay geometryOverlay)
Parameters
Type | Name | Description |
---|---|---|
GeometryOverlay | geometryOverlay | The function set to perform overlay operations |
NtsGeometryServices(PrecisionModel)
Creates an instance of this class, using the CoordinateArraySequenceFactory as default.
No DefaultSRID is specified.
The default precision model is defined by precisionModel
.
The Legacy function set for overlay operations is being used.
Declaration
public NtsGeometryServices(PrecisionModel precisionModel)
Parameters
Type | Name | Description |
---|---|---|
PrecisionModel | precisionModel |
NtsGeometryServices(PrecisionModel, Int32)
Creates an instance of this class, using the CoordinateArraySequenceFactory as default.
A value of srid
is assigned to DefaultSRID.
The default precision model is defined by precisionModel
.
The Legacy function set for overlay operations is being used.
Declaration
public NtsGeometryServices(PrecisionModel precisionModel, int srid)
Parameters
Type | Name | Description |
---|---|---|
PrecisionModel | precisionModel | |
Int32 | srid |
Properties
| Improve this Doc View SourceCoordinateEqualityComparer
Gets an object that is used to test 2 coordinates for equality.
Declaration
public CoordinateEqualityComparer CoordinateEqualityComparer { get; }
Property Value
Type | Description |
---|---|
CoordinateEqualityComparer | A coordinate equality tester object |
DefaultCoordinateSequenceFactory
Gets or sets the coordiate sequence factory to use
Declaration
public CoordinateSequenceFactory DefaultCoordinateSequenceFactory { get; }
Property Value
Type | Description |
---|---|
CoordinateSequenceFactory |
DefaultPrecisionModel
Gets or sets the default precision model
Declaration
public PrecisionModel DefaultPrecisionModel { get; }
Property Value
Type | Description |
---|---|
PrecisionModel |
DefaultSRID
Gets the default spatial reference id
Declaration
public int DefaultSRID { get; }
Property Value
Type | Description |
---|---|
Int32 |
GeometryOverlay
Gets or sets a value indicating the operations to use for geometry overlay.
Declaration
public GeometryOverlay GeometryOverlay { get; }
Property Value
Type | Description |
---|---|
GeometryOverlay | A set of geometry overlay functions. |
Instance
Gets or sets the default instance of NtsGeometryServices.
Declaration
public static NtsGeometryServices Instance { get; set; }
Property Value
Type | Description |
---|---|
NtsGeometryServices |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when trying to set the value to null. |
Methods
| Improve this Doc View SourceCreateGeometryFactory()
Creates or retrieves a geometry factory using DefaultSRID, DefaultPrecisionModel and DefaultCoordinateSequenceFactory.
Declaration
public GeometryFactory CreateGeometryFactory()
Returns
Type | Description |
---|---|
GeometryFactory | A geometry factory |
CreateGeometryFactory(CoordinateSequenceFactory)
Creates or retrieves a geometry factory using DefaultSRID, DefaultPrecisionModel and
coordinateSequenceFactory
.
Declaration
public GeometryFactory CreateGeometryFactory(CoordinateSequenceFactory coordinateSequenceFactory)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequenceFactory | coordinateSequenceFactory |
Returns
Type | Description |
---|---|
GeometryFactory | A geometry factory |
CreateGeometryFactory(PrecisionModel)
Creates or retrieves a geometry factory using DefaultSRID, precisionModel
and
DefaultCoordinateSequenceFactory.
Declaration
public GeometryFactory CreateGeometryFactory(PrecisionModel precisionModel)
Parameters
Type | Name | Description |
---|---|---|
PrecisionModel | precisionModel | The precision model to use. |
Returns
Type | Description |
---|---|
GeometryFactory | A geometry factory |
CreateGeometryFactory(PrecisionModel, Int32)
Creates or retrieves a geometry factory using srid
, precisionModel
and
DefaultCoordinateSequenceFactory.
Declaration
public GeometryFactory CreateGeometryFactory(PrecisionModel precisionModel, int srid)
Parameters
Type | Name | Description |
---|---|---|
PrecisionModel | precisionModel | The precision model to use. |
Int32 | srid | The spatial reference id. |
Returns
Type | Description |
---|---|
GeometryFactory | A geometry factory |
CreateGeometryFactory(PrecisionModel, Int32, CoordinateSequenceFactory)
Creates or retrieves a geometry factory using srid
, precisionModel
and
coordinateSequenceFactory
.
Declaration
public GeometryFactory CreateGeometryFactory(PrecisionModel precisionModel, int srid, CoordinateSequenceFactory coordinateSequenceFactory)
Parameters
Type | Name | Description |
---|---|---|
PrecisionModel | precisionModel | The precision model to use. |
Int32 | srid | The spatial reference id. |
CoordinateSequenceFactory | coordinateSequenceFactory |
Returns
Type | Description |
---|---|
GeometryFactory | A geometry factory |
CreateGeometryFactory(Int32)
Creates or retrieves a geometry factory using srid
, DefaultPrecisionModel and
DefaultCoordinateSequenceFactory.
Declaration
public GeometryFactory CreateGeometryFactory(int srid)
Parameters
Type | Name | Description |
---|---|---|
Int32 | srid |
Returns
Type | Description |
---|---|
GeometryFactory | A geometry factory |
CreateGeometryFactoryCore(PrecisionModel, Int32, CoordinateSequenceFactory)
Creates a GeometryFactory based on the given parameters.
Declaration
protected virtual GeometryFactory CreateGeometryFactoryCore(PrecisionModel precisionModel, int srid, CoordinateSequenceFactory coordinateSequenceFactory)
Parameters
Type | Name | Description |
---|---|---|
PrecisionModel | precisionModel | The value for PrecisionModel. |
Int32 | srid | The value for SRID. |
CoordinateSequenceFactory | coordinateSequenceFactory | The value for CoordinateSequenceFactory. |
Returns
Type | Description |
---|---|
GeometryFactory | A GeometryFactory that has the given values. |
Remarks
This method is expected to be safe to call from any number of threads at once.
Implementations must make sure to use a constructor which is properly assigning GeometryOverlay to the factory.
Although the result for a given set of parameters is cached, there is no guarantee that, once this method is called with some set of parameters, it will never be called again with an exactly equal set of parameters. When this does happen, an arbitrary result is chosen as the winner (not necessarily the first one to start or finish), and all other results are discarded.
CreatePrecisionModel(PrecisionModel)
Creates a precision model based on given precision model.
Declaration
[Obsolete("Will be removed in a future version")]
public PrecisionModel CreatePrecisionModel(PrecisionModel precisionModel)
Parameters
Type | Name | Description |
---|---|---|
PrecisionModel | precisionModel |
Returns
Type | Description |
---|---|
PrecisionModel | The precision model |
CreatePrecisionModel(PrecisionModels)
Creates a precision model based on given precision model type
Declaration
[Obsolete("Will be removed in a future version")]
public PrecisionModel CreatePrecisionModel(PrecisionModels modelType)
Parameters
Type | Name | Description |
---|---|---|
PrecisionModels | modelType |
Returns
Type | Description |
---|---|
PrecisionModel | The precision model type |
CreatePrecisionModel(Double)
Creates a precision model based on the given scale factor.
Declaration
[Obsolete("Will be removed in a future version")]
public PrecisionModel CreatePrecisionModel(double scale)
Parameters
Type | Name | Description |
---|---|---|
Double | scale | The scale factor |
Returns
Type | Description |
---|---|
PrecisionModel | The precision model. |