public class SimplePointInAreaLocator extends Object implements PointOnGeometryLocator
Polygonal Geometry,
using a simple O(n) algorithm.
This algorithm is suitable for use in cases where
only one or a few points will be tested against a given area.
The algorithm used is only guaranteed to return correct results for points which are not on the boundary of the Geometry.
| Constructor and Description |
|---|
SimplePointInAreaLocator(Geometry geom) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsPointInPolygon(Coordinate p,
Polygon poly)
Determines whether a point lies in a
Polygon. |
int |
locate(Coordinate p)
|
static int |
locate(Coordinate p,
Geometry geom)
|
static int |
locatePointInPolygon(Coordinate p,
Polygon poly)
|
public SimplePointInAreaLocator(Geometry geom)
public static int locate(Coordinate p, Geometry geom)
Location of a point in an areal Geometry.
Computes Location.BOUNDARY if the point lies exactly
on a geometry line segment.p - the point to testgeom - the areal geometry to testpublic static int locatePointInPolygon(Coordinate p, Polygon poly)
Location of a point in a Polygon.
Computes Location.BOUNDARY if the point lies exactly
on the polygon boundary.p - the point to testpoly - the geometry to testpublic static boolean containsPointInPolygon(Coordinate p, Polygon poly)
Polygon.
If the point lies on the polygon boundary it is
considered to be inside.p - the point to testpoly - the geometry to testpublic int locate(Coordinate p)
PointOnGeometryLocatorlocate in interface PointOnGeometryLocatorp - the point to testCopyright © 2018. All rights reserved.