computeLabelSide method

void computeLabelSide(
  1. int geomIndex,
  2. int side
)

To compute the summary label for a side, the algorithm is: FOR all edges IF any edge's location is INTERIOR for the side, side location = INTERIOR ELSE IF there is at least one EXTERIOR attribute, side location = EXTERIOR ELSE side location = NULL
Note that it is possible for two sides to have apparently contradictory information i.e. one edge side may indicate that it is in the interior of a geometry, while another edge side may indicate the exterior of the same geometry. This is not an incompatibility - GeometryCollections may contain two Polygons that touch along an edge. This is the reason for Interior-primacy rule above - it results in the summary label having the Geometry interior on both sides.

Implementation

void computeLabelSide(int geomIndex, int side) {
  for (Iterator it = iterator(); it.moveNext();) {
    EdgeEnd e = it.current as EdgeEnd;
    if (e.getLabel()!.isArea()) {
      int loc = e.getLabel()!.getLocationWithPosIndex(geomIndex, side);
      if (loc == Location.INTERIOR) {
        label!.setLocation(geomIndex, side, Location.INTERIOR);
        return;
      } else if (loc == Location.EXTERIOR)
        label!.setLocation(geomIndex, side, Location.EXTERIOR);
    }
  }
}