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
Value members
Concrete methods
Computes the distance between facets of two geometries.
Computes the distance between facets of two geometries.
For geometries with many segments or points, this can be faster than using a simple distance algorithm.
- Value Params
- g1
a geometry
- g2
a geometry return the distance between facets of the geometries
Tests whether the facets of two geometries lie within a given distance.
Tests whether the facets of two geometries lie within a given distance.
- Value Params
- distance
the distance limit return true if two facets lie with the given distance
- g1
a geometry
- g2
a geometry