Class IndexedPointInAreaLocator

Hierarchy: Object , IndexedPointInAreaLocator
All Implemented Interfaces: PointOnGeometryLocator
public class IndexedPointInAreaLocator
implements PointOnGeometryLocator
Determines the Location of Coordinates relative to an areal geometry, using indexing for efficiency. This algorithm is suitable for use in cases where many points will be tested against a given area.

The Location is computed precisely, in that points located on the geometry boundary or segments will return Location.BOUNDARY.

Polygonal and LinearRing geometries are supported.

The index is lazy-loaded, which allows creating instances even if they are not used.

Thread-safe and immutable.

Authors:
Martin Davis
public IndexedPointInAreaLocator(Geometry g)
Creates a new locator for a given Geometry. Polygonal and LinearRing geometries are supported.
Parameters:
g - g the Geometry to locate in
public int locate(Coordinate p)
Determines the Location of a point in an areal Geometry.
Parameters:
p - p the point to test
Returns:
the location of the point in the geometry