org.locationtech.jts.operation.distance

Type members

Classlikes

A ConnectedElementPointFilter extracts a single point from each connected element in a Geometry (e.g. a polygon, linestring or point) and returns them in a list. The elements of the list are {link org.locationtech.jts.operation.distance.GeometryLocation}s. Empty geometries do not provide a location item.

A ConnectedElementPointFilter extracts a single point from each connected element in a Geometry (e.g. a polygon, linestring or point) and returns them in a list. The elements of the list are {link org.locationtech.jts.operation.distance.GeometryLocation}s. Empty geometries do not provide a location item.

Version

1.7

Companion
class

Extracts a single point from each connected element in a Geometry (e.g. a polygon, linestring or point) and returns them in a list

Extracts a single point from each connected element in a Geometry (e.g. a polygon, linestring or point) and returns them in a list

Version

1.7

Companion
class
object DistanceOp

Find two points on two {link Geometry}s which lie within a given distance, or else are the nearest points on the geometries (in which case this also provides the distance between the geometries).

Find two points on two {link Geometry}s which lie within a given distance, or else are the nearest points on the geometries (in which case this also provides the distance between the geometries).

The distance computation also finds a pair of points in the input geometries which have the minimum distance between them. If a point lies in the interior of a line segment, the coordinate computed is a close approximation to the exact point.

Empty geometry collection components are ignored.

The algorithms used are straightforward O(n^2) comparisons. This worst-case performance could be improved on by using Voronoi techniques or spatial indexes.

Version

1.7

Companion
class
class DistanceOp(val g0: Geometry, val g1: Geometry, val terminateDistance: Double)
Companion
object
class FacetSequence(val geom: Geometry, val pts: CoordinateSequence, val start: Int, val end: Int)

Represents a sequence of facets (points or line segments) of a {link Geometry} specified by a subsequence of a {link CoordinateSequence}.

Represents a sequence of facets (points or line segments) of a {link Geometry} specified by a subsequence of a {link CoordinateSequence}.

Represents the location of a point on a Geometry. Maintains both the actual point location (which may not be exact, if the point is not a vertex) as well as information about the component and segment index where the point occurs. Locations inside area Geometrys will not have an associated segment index, so in this case the segment index will have the sentinel value of {link #INSIDE_AREA}.

Represents the location of a point on a Geometry. Maintains both the actual point location (which may not be exact, if the point is not a vertex) as well as information about the component and segment index where the point occurs. Locations inside area Geometrys will not have an associated segment index, so in this case the segment index will have the sentinel value of {link #INSIDE_AREA}.

Version

1.7

Companion
class
class GeometryLocation(val component: Geometry, var segIndex: Int, val pt: Coordinate)
Companion
object

Computes the distance between the facets (segments and vertices) of two {link Geometry}s using a Branch-and-Bound algorithm. The Branch-and-Bound algorithm operates over a traversal of R-trees built on the target and the query geometries.

Computes the distance between the facets (segments and vertices) of two {link Geometry}s using a Branch-and-Bound algorithm. The Branch-and-Bound algorithm operates over a traversal of R-trees built on the target and the query geometries.

This approach provides the following benefits:

  • Performance is dramatically improved due to the use of the R-tree index and the pruning due to the Branch-and-Bound approach

  • The spatial index on the target geometry is cached which allow reuse in an repeated query situation.

Using this technique is usually much more performant than using the brute-force {link Geometry#distance(Geometry)} when one or both input geometries are large, or when evaluating many distance computations against a single geometry.

This class is thread-safe.

Companion
class
class IndexedFacetDistance(var baseGeometry: Geometry)
Companion
object