當前位置: 首頁>>代碼示例>>Java>>正文


Java Noder.getNodedSubstrings方法代碼示例

本文整理匯總了Java中com.vividsolutions.jts.noding.Noder.getNodedSubstrings方法的典型用法代碼示例。如果您正苦於以下問題:Java Noder.getNodedSubstrings方法的具體用法?Java Noder.getNodedSubstrings怎麽用?Java Noder.getNodedSubstrings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vividsolutions.jts.noding.Noder的用法示例。


在下文中一共展示了Noder.getNodedSubstrings方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: computeNodedEdges

import com.vividsolutions.jts.noding.Noder; //導入方法依賴的package包/類
private void computeNodedEdges(List bufferSegStrList, PrecisionModel precisionModel) {
        Noder noder = this.getNoder(precisionModel);
        noder.computeNodes(bufferSegStrList);
        Collection nodedSegStrings = noder.getNodedSubstrings();
// DEBUGGING ONLY
//BufferDebug.saveEdges(nodedEdges, "run" + BufferDebug.runCount + "_nodedEdges");

        for (Object nodedSegString : nodedSegStrings) {
            SegmentString segStr = (SegmentString) nodedSegString;

            /**
             * Discard edges which have zero length,
             * since they carry no information and cause problems with topology building
             */
            Coordinate[] pts = segStr.getCoordinates();
            if (pts.length == 2 && pts[0].equals2D(pts[1])) {
                continue;
            }

            Label oldLabel = (Label) segStr.getData();
            Edge edge = new Edge(segStr.getCoordinates(), new Label(oldLabel));
            this.insertUniqueEdge(edge);
        }
        //saveEdges(edgeList.getEdges(), "run" + runCount + "_collapsedEdges");
    }
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:26,代碼來源:BufferBuilder.java

示例2: node

import com.vividsolutions.jts.noding.Noder; //導入方法依賴的package包/類
/**
 * Nodes the linework of a set of Geometrys using SnapRounding.
 *
 * @param geoms a Collection of Geometrys of any type
 * @return a List of LineStrings representing the noded linework of the input
 */
public List node(Collection geoms) {
    // get geometry factory
    Geometry geom0 = (Geometry) geoms.iterator().next();
    this.geomFact = geom0.getFactory();

    List segStrings = this.toSegmentStrings(this.extractLines(geoms));
    //Noder sr = new SimpleSnapRounder(pm);
    Noder sr = new MCIndexSnapRounder(this.pm);
    sr.computeNodes(segStrings);
    Collection nodedLines = sr.getNodedSubstrings();

    //TODO: improve this to check for full snap-rounded correctness
    if (this.isValidityChecked) {
        NodingValidator nv = new NodingValidator(nodedLines);
        nv.checkValid();
    }

    return this.toLineStrings(nodedLines);
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:26,代碼來源:GeometryNoder.java

示例3: computeNodedEdges

import com.vividsolutions.jts.noding.Noder; //導入方法依賴的package包/類
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();

            /**
             * Discard edges which have zero length,
             * since they carry no information and cause problems with topology building
             */
            Coordinate[] pts = segStr.getCoordinates();
            if (pts.length == 2 && pts[0].equals2D(pts[1]))
                continue;

            Label oldLabel = (Label) segStr.getData();
            Edge edge = new Edge(segStr.getCoordinates(), new Label(oldLabel));
            insertUniqueEdge(edge);
        }
        //saveEdges(edgeList.getEdges(), "run" + runCount + "_collapsedEdges");
    }
 
開發者ID:Semantive,項目名稱:jts,代碼行數:25,代碼來源:BufferBuilder.java

示例4: node

import com.vividsolutions.jts.noding.Noder; //導入方法依賴的package包/類
/**
 * Nodes the linework of a set of Geometrys using SnapRounding.
 *
 * @param geoms a Collection of Geometrys of any type
 * @return a List of LineStrings representing the noded linework of the input
 */
public List node(Collection geoms) {
    // get geometry factory
    Geometry geom0 = (Geometry) geoms.iterator().next();
    geomFact = geom0.getFactory();

    List segStrings = toSegmentStrings(extractLines(geoms));
    //Noder sr = new SimpleSnapRounder(pm);
    Noder sr = new MCIndexSnapRounder(pm);
    sr.computeNodes(segStrings);
    Collection nodedLines = sr.getNodedSubstrings();

    //TODO: improve this to check for full snap-rounded correctness
    if (isValidityChecked) {
        NodingValidator nv = new NodingValidator(nodedLines);
        nv.checkValid();
    }

    return toLineStrings(nodedLines);
}
 
開發者ID:Semantive,項目名稱:jts,代碼行數:26,代碼來源:GeometryNoder.java


注:本文中的com.vividsolutions.jts.noding.Noder.getNodedSubstrings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。