com.vividsolutions.jts.operation.predicate

Class RectangleIntersects


public class RectangleIntersects
extends java.lang.Object

Optimized implementation of spatial predicate "intersects" for cases where the first Geometry is a rectangle.

As a further optimization, this class can be used directly to test many geometries against a single rectangle.

Version:
1.7

Field Summary

static int
MAXIMUM_SCAN_SEGMENT_COUNT
Crossover size at which brute-force intersection scanning is slower than indexed intersection detection.

Constructor Summary

RectangleIntersects(Polygon rectangle)
Create a new intersects computer for a rectangle.

Method Summary

boolean
intersects(Geometry geom)
static boolean
intersects(Polygon rectangle, Geometry b)

Field Details

MAXIMUM_SCAN_SEGMENT_COUNT

public static final int MAXIMUM_SCAN_SEGMENT_COUNT
Crossover size at which brute-force intersection scanning is slower than indexed intersection detection. Must be determined empirically. Should err on the safe side by making value smaller rather than larger.
Field Value:
200

Constructor Details

RectangleIntersects

public RectangleIntersects(Polygon rectangle)
Create a new intersects computer for a rectangle.
Parameters:
rectangle - a rectangular geometry

Method Details

intersects

public boolean intersects(Geometry geom)

intersects

public static boolean intersects(Polygon rectangle,
                                 Geometry b)