Class OverlayNGRobust
- java.lang.Object
-
- org.locationtech.jts.operation.overlayng.OverlayNGRobust
-
public class OverlayNGRobust extends java.lang.Object
Performs an overlay operation usingOverlayNG
, 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
SnappingNoder
using 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
SnapRoundingNoder
is 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 aValidatingNoder
in order to check the results of using a floating noder.- Author:
- Martin Davis
- See Also:
OverlayNG
-
-
Constructor Summary
Constructors Constructor Description OverlayNGRobust()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Geometry
overlay(Geometry geom0, Geometry geom1, int opCode)
Overlay two geometries, using heuristics to ensure computation completes correctly.static Geometry
union(java.util.Collection<Geometry> geoms)
Computes the unary union of a collection of geometries using robust computation.static Geometry
union(java.util.Collection<Geometry> geoms, GeometryFactory geomFact)
Computes the unary union of a collection of geometries using robust computation.static Geometry
union(Geometry geom)
Computes the unary union of a geometry using robust computation.
-
-
-
Method Detail
-
union
public static Geometry union(Geometry geom)
Computes the unary union of a geometry using robust computation.- Parameters:
geom
- the geometry to union- Returns:
- the union result
- See Also:
UnaryUnionOp
-
union
public static Geometry union(java.util.Collection<Geometry> geoms)
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:
UnaryUnionOp
-
union
public static Geometry union(java.util.Collection<Geometry> geoms, GeometryFactory geomFact)
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
-
-