Class OverlayNGRobust
java.lang.Object
org.locationtech.jts.operation.overlayng.OverlayNGRobust
Performs an overlay operation using
OverlayNG,
providing full robustness by using a series of
increasingly robust (but slower) noding strategies.
The noding strategies used are:
- A simple, fast noder using FLOATING precision.
- A
SnappingNoderusing an automatically-determined snap tolerance - First snapping each geometry to itself,
and then overlaying them using a
SnappingNoder. - The above two strategies are repeated with increasing snap tolerance, up to a limit.
- Finally a
SnapRoundingNoderis used with a automatically-determined scale factor intended to preserve input precision while still preventing robustness problems.
TopologyException is thrown.
In practice this is extremely unlikely to occur.
This algorithm relies on each overlay operation execution
throwing a TopologyException if it is unable
to compute the overlay correctly.
Generally this occurs because the noding phase does
not produce a valid noding.
This requires the use of a ValidatingNoder
in order to check the results of using a floating noder.
- Author:
- Martin Davis
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GeometryOverlay two geometries, using heuristics to ensure computation completes correctly.static Geometryunion(Collection<Geometry> geoms) Computes the unary union of a collection of geometries using robust computation.static Geometryunion(Collection<Geometry> geoms, GeometryFactory geomFact) Computes the unary union of a collection of geometries using robust computation.static GeometryComputes the unary union of a geometry using robust computation.
-
Constructor Details
-
OverlayNGRobust
public OverlayNGRobust()
-
-
Method Details
-
union
-
union
Computes the unary union of a collection of geometries using robust computation.- Parameters:
geoms- the collection of geometries to union- Returns:
- the union result
- See Also:
-
union
Computes the unary union of a collection of geometries using robust computation.- Parameters:
geoms- the collection of geometries to uniongeomFact- the geometry factory to use- Returns:
- the union of the geometries
-
overlay
Overlay two geometries, using heuristics to ensure computation completes correctly. In practice the heuristics are observed to be fully correct.- Parameters:
geom0- a geometrygeom1- a geometryopCode- the overlay operation code (fromOverlayNG- Returns:
- the overlay result geometry
- See Also:
-