Class: DistanceOp

jsts.operation.distance.DistanceOp

new DistanceOp(g0, g1, terminateDistance)

Constructs a DistanceOp that computes the distance and nearest points between the two specified geometries.
Parameters:
Name Type Description
g0 Geometry a Geometry.
g1 Geometry a Geometry.
terminateDistance double the distance on which to terminate the search.
Source:

Members

geom :Array.<Geometry>

Type:
  • Array.<Geometry>
Source:

minDistance :double

Type:
  • double
Source:

minDistanceLocation :Array.<GeometryLocation>

Type:
  • Array.<GeometryLocation>
Source:

ptLocator :PointLocator

Type:
  • PointLocator
Source:

terminateDistance :double

Type:
  • double
Source:

Methods

(static) distance(g0, g1) → {double}

Compute the distance between the nearest points of two geometries.
Parameters:
Name Type Description
g0 Geometry a Geometry.
g1 Geometry another Geometry.
Source:
Returns:
the distance between the geometries.
Type
double

(static) isWithinDistance(g0, g1, distance) → {boolean}

Test whether two geometries lie within a given distance of each other.
Parameters:
Name Type Description
g0 Geometry a Geometry.
g1 Geometry another Geometry.
distance double the distance to test.
Source:
Returns:
true if g0.distance(g1) <= distance.
Type
boolean

(static) nearestPoints(g0, g1) → {Array.<Coordinate>}

Compute the the nearest points of two geometries. The points are presented in the same order as the input Geometries.
Parameters:
Name Type Description
g0 Geometry a Geometry.
g1 Geometry another Geometry.
Source:
Returns:
the nearest points in the geometries.
Type
Array.<Coordinate>

distance() → {double|double}

Report the distance between the nearest points on the input geometries.
Source:
Throws:
IllegalArgumentException if either input geometry is null
Returns:
  • the distance between the geometries.
    Type
    double
  • 0 if either input geometry is empty.
    Type
    double

nearestLocations() → {Array.<GeometryLocation>}

Report the locations of the nearest points in the input geometries. The locations are presented in the same order as the input Geometries.
Source:
Returns:
a pair of GeometryLocation s for the nearest points.
Type
Array.<GeometryLocation>

nearestPoints() → {Array.<Coordinate>}

Report the coordinates of the nearest points in the input geometries. The points are presented in the same order as the input Geometries.
Source:
Returns:
a pair of Coordinate s of the nearest points.
Type
Array.<Coordinate>