Packages

package union

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. class CascadedPolygonUnion extends AnyRef
  2. class InputExtracter extends GeometryFilter
  3. class OverlapUnion extends AnyRef
  4. class PointGeometryUnion extends AnyRef
  5. class UnaryUnionOp extends AnyRef
  6. class UnionInteracting extends AnyRef

Value Members

  1. object CascadedPolygonUnion

    Provides an efficient method of unioning a collection of {link Polygonal} geometries.

    Provides an efficient method of unioning a collection of {link Polygonal} geometries. The geometries are indexed using a spatial index, and unioned recursively in index order. For geometries with a high degree of overlap, this has the effect of reducing the number of vertices early in the process, which increases speed and robustness.

    This algorithm is faster and more robust than the simple iterated approach of repeatedly unioning each polygon to a result geometry.

    The buffer(0) trick is sometimes faster, but can be less robust and can sometimes take a long time to complete. This is particularly the case where there is a high degree of overlap between the polygons. In this case, buffer(0) is forced to compute with all line segments from the outset, whereas cascading can eliminate many segments at each stage of processing. The best situation for using buffer(0) is the trivial case where there is no overlap between the input geometries. However, this case is likely rare in practice.

  2. object InputExtracter

    Extracts atomic elements from input geometries or collections, recording the dimension found.

    Extracts atomic elements from input geometries or collections, recording the dimension found. Empty geometries are discarded since they do not contribute to the result of {link UnaryUnionOp}.

  3. 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.

    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.

  4. object PointGeometryUnion

    Computes the union of a {link Puntal} geometry with another arbitrary {link Geometry}.

    Computes the union of a {link Puntal} geometry with another arbitrary {link Geometry}. Does not copy any component geometries.

  5. object UnaryUnionOp

    Unions a Collection of {link Geometry}s or a single Geometry (which may be a {link GeoometryCollection}) together.

    Unions a Collection of {link Geometry}s or a single Geometry (which may be a {link GeoometryCollection}) together. By using this special-purpose operation over a collection of geometries it is possible to take advantage of various optimizations to improve performance. Heterogeneous {link GeometryCollection}s are fully supported.

    The result obeys the following contract:

    • Unioning a set of {link Polygon}s has the effect of merging the areas (i.e. the same effect as iteratively unioning all individual polygons together).
    • Unioning a set of {link LineString}s has the effect of noding and dissolving the input linework. In this context "fully noded" means that there will be an endpoint or node in the result for every endpoint or line segment crossing in the input. "Dissolved" means that any duplicate (i.e. coincident) line segments or portions of line segments will be reduced to a single line segment in the result. This is consistent with the semantics of the {link Geometry#union(Geometry)} operation. If merged linework is required, the {link LineMerger} class can be used.
    • Unioning a set of {link Point}s has the effect of merging all identical points (producing a set with no duplicates).

    UnaryUnion always operates on the individual components of MultiGeometries. So it is possible to use it to "clean" invalid self-intersecting MultiPolygons (although the polygon components must all still be individually valid.)

  6. object UnionInteracting

    Experimental code to union MultiPolygons with processing limited to the elements which actually interact.

    Experimental code to union MultiPolygons with processing limited to the elements which actually interact.

    Not currently used, since it doesn't seem to offer much of a performance advantage.

Ungrouped