labelIsolatedEdge method

void labelIsolatedEdge(
  1. Edge e,
  2. int targetIndex,
  3. Geometry target
)

Label an isolated edge of a graph with its relationship to the target geometry. If the target has dim 2 or 1, the edge can either be in the interior or the exterior. If the target has dim 0, the edge must be in the exterior

Implementation

void labelIsolatedEdge(Edge e, int targetIndex, Geometry target) {
  // this won't work for GeometryCollections with both dim 2 and 1 geoms
  if (target.getDimension() > 0) {
    // since edge is not in boundary, may not need the full generality of PointLocator?
    // Possibly should use ptInArea locator instead?  We probably know here
    // that the edge does not touch the bdy of the target Geometry
    int loc = ptLocator.locate(e.getCoordinate()!, target);
    e.getLabel()!.setAllLocations(targetIndex, loc);
  } else {
    e.getLabel()!.setAllLocations(targetIndex, Location.EXTERIOR);
  }
//System.out.println(e.getLabel());
}