com.vividsolutions.jts.algorithm

Class PointLocator


public class PointLocator
extends java.lang.Object

Computes the topological relationship (Location) of a single point to a Geometry. The algorithm obeys the SFS boundaryDetermination rule to correctly determine whether the point lies on the boundary or not. Note that instances of this class are not reentrant.
Version:
1.6

Constructor Summary

PointLocator()

Method Summary

boolean
intersects(Coordinate p, Geometry geom)
Convenience method to test a point for intersection with a Geometry
int
locate(Coordinate p, Geometry geom)
Computes the topological relationship (Location) of a single point to a Geometry.

Constructor Details

PointLocator

public PointLocator()

Method Details

intersects

public boolean intersects(Coordinate p,
                          Geometry geom)
Convenience method to test a point for intersection with a Geometry
Parameters:
p - the coordinate to test
geom - the Geometry to test
Returns:
true if the point is in the interior or boundary of the Geometry

locate

public int locate(Coordinate p,
                  Geometry geom)
Computes the topological relationship (Location) of a single point to a Geometry. It handles both single-element and multi-element Geometries. The algorithm for multi-part Geometries takes into account the boundaryDetermination rule.
Returns:
the Location of the point relative to the input Geometry