SimplePointInAreaLocator class

Computes the location of points relative to a {@link Polygonal} {@link Geometry}, using a simple O(n) algorithm.

The algorithm used reports if a point lies in the interior, exterior, or exactly on the boundary of the Geometry.

Instance methods are provided to implement the interface {@link PointInAreaLocator}. However, they provide no performance advantage over the class methods.

This algorithm is suitable for use in cases where only a few points will be tested. If many points will be tested, {@link IndexedPointInAreaLocator} may provide better performance.

@version 1.7

Implemented types

Constructors

SimplePointInAreaLocator(Geometry geom)
Create an instance of a point-in-area locator, using the provided areal geometry.

Properties

geom Geometry
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

locate(Coordinate p) int
Determines the {@link Location} of a point in an areal {@link Geometry}. The return value is one of:
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

containsPointInPolygon(Coordinate p, Polygon poly) bool
Determines whether a point lies in a {@link Polygon}. If the point lies on the polygon boundary it is considered to be inside.
isContained(Coordinate p, Geometry geom) bool
Determines whether a point is contained in a {@link Geometry}, or lies on its boundary. This is a convenience method for
locateInGeometry(Coordinate p, Geometry geom) int
locatePointInGeom(Coordinate p, Geometry geom) int
Determines the {@link Location} of a point in an areal {@link Geometry}. The return value is one of:
locatePointInPolygon(Coordinate p, Polygon poly) int
Determines the {@link Location} of a point in a {@link Polygon}. The return value is one of:
locatePointInRing(Coordinate p, LinearRing ring) int
Determines whether a point lies in a LinearRing, using the ring envelope to short-circuit if possible.