computeContainmentDistance1 method

void computeContainmentDistance1(
  1. int polyGeomIndex,
  2. List<GeometryLocation?> locPtPoly
)

Implementation

void computeContainmentDistance1(
    int polyGeomIndex, List<GeometryLocation?> locPtPoly) {
  Geometry? polyGeom = geom[polyGeomIndex];
  // if no polygon then nothing to do
  if (polyGeom!.getDimension() < 2) return;

  int locationsIndex = 1 - polyGeomIndex;
  List polys = PolygonExtracter.getPolygons(polyGeom);
  if (polys.length > 0) {
    List insideLocs =
        ConnectedElementLocationFilter.getLocations(geom[locationsIndex]!);
    computeContainmentDistance2(insideLocs, polys, locPtPoly);
    if (minDistance <= terminateDistance) {
      // this assigment is determined by the order of the args in the computeInside call above
      minDistanceLocation![locationsIndex] = locPtPoly[0];
      minDistanceLocation![polyGeomIndex] = locPtPoly[1];
      return;
    }
  }
}