hasDuplicateRings method

bool hasDuplicateRings()

Checks for two duplicate rings in an area. Duplicate rings are rings that are topologically equal (that is, which have the same sequence of points up to point order). If the area is topologically consistent (determined by calling the isNodeConsistentArea, duplicate rings can be found by checking for EdgeBundles which contain more than one EdgeEnd. (This is because topologically consistent areas cannot have two rings sharing the same line segment, unless the rings are equal). The start point of one of the equal rings will be placed in invalidPoint.

@return true if this area Geometry is topologically consistent but has two duplicate rings

Implementation

bool hasDuplicateRings() {
  for (Iterator nodeIt = nodeGraph.getNodeIterator(); nodeIt.moveNext();) {
    RelateNode node = nodeIt.current as RelateNode;
    for (Iterator i = node.getEdges()!.iterator(); i.moveNext();) {
      EdgeEndBundle eeb = i.current as EdgeEndBundle;
      if (eeb.getEdgeEnds().length > 1) {
        invalidPoint = eeb.getEdge().getCoordinateWithIndex(0);
        return true;
      }
    }
  }
  return false;
}