nearestLocations method

List<GeometryLocation?>? nearestLocations(
  1. Geometry g
)

Computes the nearest locations on the base geometry and the given geometry.

@param g the geometry to compute the nearest location to @return the nearest locations

Implementation

List<GeometryLocation?>? nearestLocations(Geometry g) {
  STRtree tree2 = FacetSequenceTreeBuilder.build(g);
  List<Object>? obj =
      cachedTree!.nearestNeighbourWithTree(tree2, FACET_SEQ_DIST);
  FacetSequence fs1 = obj![0] as FacetSequence;
  FacetSequence fs2 = obj[1] as FacetSequence;
  return fs1.nearestLocations(fs2);
}