public class PointLocator
extends java.lang.Object
Location
)
of a single point to a Geometry
.
A BoundaryNodeRule
may be specified
to control the evaluation of whether the point lies on the boundary or not
The default rule is to use the the SFS Boundary Determination Rule
Notes:
LinearRing
s do not enclose any area - points inside the ring are still in the EXTERIOR of the ring.
Modifier and Type | Field and Description |
---|---|
private BoundaryNodeRule |
boundaryRule |
private boolean |
isIn |
private int |
numBoundaries |
Constructor and Description |
---|
PointLocator() |
PointLocator(BoundaryNodeRule boundaryRule) |
Modifier and Type | Method and Description |
---|---|
private void |
computeLocation(Coordinate p,
Geometry geom) |
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. |
private int |
locateInPolygon(Coordinate p,
Polygon poly) |
private int |
locateInPolygonRing(Coordinate p,
LinearRing ring) |
private int |
locateOnLineString(Coordinate p,
LineString l) |
private int |
locateOnPoint(Coordinate p,
Point pt) |
private void |
updateLocationInfo(int loc) |
private BoundaryNodeRule boundaryRule
private boolean isIn
private int numBoundaries
public PointLocator()
public PointLocator(BoundaryNodeRule boundaryRule)
public boolean intersects(Coordinate p, Geometry geom)
p
- the coordinate to testgeom
- the Geometry to testtrue
if the point is in the interior or boundary of the Geometrypublic int locate(Coordinate p, Geometry geom)
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 SFS Boundary Determination Rule.Location
of the point relative to the input Geometryprivate void computeLocation(Coordinate p, Geometry geom)
private void updateLocationInfo(int loc)
private int locateOnPoint(Coordinate p, Point pt)
private int locateOnLineString(Coordinate p, LineString l)
private int locateInPolygonRing(Coordinate p, LinearRing ring)
private int locateInPolygon(Coordinate p, Polygon poly)