예제 #1
0
 private static Geometry convertSegStrings(Iterator it) {
   GeometryFactory fact = new GeometryFactory();
   List lines = new ArrayList();
   while (it.hasNext()) {
     SegmentString ss = (SegmentString) it.next();
     LineString line = fact.createLineString(ss.getCoordinates());
     lines.add(line);
   }
   return fact.buildGeometry(lines);
 }
예제 #2
0
  private void computeNodedEdges(List bufferSegStrList, PrecisionModel precisionModel) {
    Noder noder = getNoder(precisionModel);
    noder.computeNodes(bufferSegStrList);
    Collection nodedSegStrings = noder.getNodedSubstrings();
    // DEBUGGING ONLY
    // BufferDebug.saveEdges(nodedEdges, "run" + BufferDebug.runCount + "_nodedEdges");

    for (Iterator i = nodedSegStrings.iterator(); i.hasNext(); ) {
      SegmentString segStr = (SegmentString) i.next();
      Label oldLabel = (Label) segStr.getData();
      Edge edge = new Edge(segStr.getCoordinates(), new Label(oldLabel));
      insertUniqueEdge(edge);
    }
    // saveEdges(edgeList.getEdges(), "run" + runCount + "_collapsedEdges");
  }