Class OverlayOp
Computes the geometric overlay of two Geometrys. The overlay can be used to determine any bool combination of the geometries.
Inherited Members
Namespace: NetTopologySuite.Operation.Overlay
Assembly: NetTopologySuite.dll
Syntax
public class OverlayOp : GeometryGraphOperation
Constructors
| Improve this Doc View SourceOverlayOp(Geometry, Geometry)
Constructs an instance to compute a single overlay operation for the given geometries.
Declaration
public OverlayOp(Geometry g0, Geometry g1)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g0 | The first geometry argument |
Geometry | g1 | The second geometry argument |
Properties
| Improve this Doc View SourceGraph
Gets the graph constructed to compute the overlay.
Declaration
public PlanarGraph Graph { get; }
Property Value
Type | Description |
---|---|
PlanarGraph |
NodingValidatorDisabled
Disable EdgeNodingValidator when an intersection is made (NetTopologySuite.Operation.Overlay.OverlayOp.ComputeOverlay(NetTopologySuite.Operation.Overlay.SpatialFunction)), so performances are dramatically improved but failures are not managed.
Declaration
public static bool NodingValidatorDisabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Use ay your own risk!
Methods
| Improve this Doc View SourceCreateEmptyResult(SpatialFunction, Geometry, Geometry, GeometryFactory)
Creates an empty result geometry of the appropriate dimension, based on the given overlay operation and the dimensions of the inputs. The created geometry is always an atomic geometry, not a collection.
The empty result is constructed using the following rules:
- Intersection - result has the dimension of the lowest input dimension
- Union - result has the dimension of the highest input dimension
- Difference - result has the dimension of the left-hand input
- SymDifference - result has the dimension of the highest input dimension (since symDifference is the union of the differences).
Declaration
public static Geometry CreateEmptyResult(SpatialFunction overlayOpCode, Geometry a, Geometry b, GeometryFactory geomFact)
Parameters
Type | Name | Description |
---|---|---|
SpatialFunction | overlayOpCode | The overlay operation being performed |
Geometry | a | An input geometry |
Geometry | b | An input geometry |
GeometryFactory | geomFact | The geometry factory being used for the operation |
Returns
Type | Description |
---|---|
Geometry | An empty atomic geometry of the appropriate dimension |
GetResultGeometry(SpatialFunction)
Gets the result of the overlay for a given overlay operation.
Note: this method can be called once only.
Declaration
public Geometry GetResultGeometry(SpatialFunction overlayOpCode)
Parameters
Type | Name | Description |
---|---|---|
SpatialFunction | overlayOpCode | The code of the overlay operation to perform |
Returns
Type | Description |
---|---|
Geometry | The computed result geometry |
Exceptions
Type | Condition |
---|---|
TopologyException | Thrown if a robustness problem is encountered |
InsertUniqueEdge(Edge)
Insert an edge from one of the noded input graphs. Checks edges that are inserted to see if an identical edge already exists. If so, the edge is not inserted, but its label is merged with the existing edge.
Declaration
protected void InsertUniqueEdge(Edge e)
Parameters
Type | Name | Description |
---|---|---|
Edge | e | The edge to insert |
IsCoveredByA(Coordinate)
Tests if an L edge should be included in the result or not.
Declaration
public bool IsCoveredByA(Coordinate coord)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | coord | The point coordinate |
Returns
Type | Description |
---|---|
Boolean |
|
IsCoveredByLA(Coordinate)
Tests if a point node should be included in the result or not.
Declaration
public bool IsCoveredByLA(Coordinate coord)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | coord | The point coordinate |
Returns
Type | Description |
---|---|
Boolean |
|
IsResultOfOp(Location, Location, SpatialFunction)
Tests whether a point with given Locations relative to two geometries is contained in the result of overlaying the geometries using a given overlay operation.
The method handles arguments of Null correctly
Declaration
public static bool IsResultOfOp(Location loc0, Location loc1, SpatialFunction overlayOpCode)
Parameters
Type | Name | Description |
---|---|---|
Location | loc0 | the code for the location in the first geometry |
Location | loc1 | the code for the location in the second geometry |
SpatialFunction | overlayOpCode | the code for the overlay operation to test |
Returns
Type | Description |
---|---|
Boolean |
|
IsResultOfOp(Label, SpatialFunction)
Tests whether a point with a given topological Label relative to two geometries is contained in the result of overlaying the geometries using a given overlay operation.
The method handles arguments of Null correctly
Declaration
public static bool IsResultOfOp(Label label, SpatialFunction overlayOpCode)
Parameters
Type | Name | Description |
---|---|---|
Label | label | The topological label of the point |
SpatialFunction | overlayOpCode | The code for the overlay operation to test |
Returns
Type | Description |
---|---|
Boolean |
|
Overlay(Geometry, Geometry, SpatialFunction)
Computes an overlay operation for the given geometry arguments.
Declaration
public static Geometry Overlay(Geometry geom0, Geometry geom1, SpatialFunction opCode)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom0 | The first geometry argument |
Geometry | geom1 | The second geometry argument |
SpatialFunction | opCode | The code for the desired overlay operation |
Returns
Type | Description |
---|---|
Geometry | The result of the overlay operation |
Exceptions
Type | Condition |
---|---|
TopologyException | Thrown if a robustness problem is encountered. |