Packages

object OverlapUnion

Unions MultiPolygons efficiently by using full topological union only for polygons which may overlap by virtue of intersecting the common area of the inputs. Other polygons are simply combined with the union result, which is much more performant.

This situation is likely to occur during cascaded polygon union, since the partitioning of polygons is done heuristically and thus may group disjoint polygons which can lie far apart. It may also occur in real world data which contains many disjoint polygons (e.g. polygons representing parcels on different street blocks).

Algorithm

The overlap region is determined as the common envelope of intersection. The input polygons are partitioned into two sets:

  • Overlapping: Polygons which intersect the overlap region, and thus potentially overlap each other
  • Disjoint: Polygons which are disjoint from (lie wholly outside) the overlap region

The Overlapping set is fully unioned, and then combined with the Disjoint set. Performing a simple combine works because the disjoint polygons do not interact with each other (since the inputs are valid MultiPolygons). They also do not interact with the Overlapping polygons, since they are outside their envelope.

Verification

In the general case the Overlapping set of polygons will extend beyond the overlap envelope. This means that the union result will extend beyond the overlap region. There is a small chance that the topological union of the overlap region will shift the result linework enough that the result geometry intersects one of the Disjoint geometries. This case is detected and if it occurs is remedied by falling back to performing a full union of the original inputs. Detection is done by a fairly efficient comparison of edge segments which extend beyond the overlap region. If any segments have changed then there is a risk of introduced intersections, and full union is performed.

This situation has not been observed in JTS using floating precision, but it could happen due to snapping. It has been observed in other APIs (e.g. GEOS) due to more aggressive snapping. And it will be more likely to happen if a snap-rounding overlay is used.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OverlapUnion
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. def union(g0: Geometry, g1: Geometry): Geometry

    Union a pair of geometries, using the more performant overlap union algorithm if possible.

    Union a pair of geometries, using the more performant overlap union algorithm if possible.

    g0

    a geometry to union

    g1

    a geometry to union return the union of the inputs

  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped