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


Java Noder類代碼示例

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


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

示例1: getNoder

import com.vividsolutions.jts.noding.Noder; //導入依賴的package包/類
private Noder getNoder(PrecisionModel precisionModel) {
        if (this.workingNoder != null) {
            return this.workingNoder;
        }

        // otherwise use a fast (but non-robust) noder
        MCIndexNoder noder = new MCIndexNoder();
        LineIntersector li = new RobustLineIntersector();
        li.setPrecisionModel(precisionModel);
        noder.setSegmentIntersector(new IntersectionAdder(li));
//    Noder noder = new IteratedNoder(precisionModel);
        return noder;
//    Noder noder = new SimpleSnapRounder(precisionModel);
//    Noder noder = new MCIndexSnapRounder(precisionModel);
//    Noder noder = new ScaledNoder(new MCIndexSnapRounder(new PrecisionModel(1.0)),
//                                  precisionModel.getScale());
    }
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:18,代碼來源:BufferBuilder.java

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: bufferFixedPrecision

import com.vividsolutions.jts.noding.Noder; //導入依賴的package包/類
private void bufferFixedPrecision(PrecisionModel fixedPM) {
    Noder noder = new ScaledNoder(new MCIndexSnapRounder(new PrecisionModel(1.0)),
            fixedPM.getScale());

    BufferBuilder bufBuilder = new BufferBuilder(this.bufParams);
    bufBuilder.setWorkingPrecisionModel(fixedPM);
    bufBuilder.setNoder(noder);
    // this may throw an exception, if robustness errors are encountered
    this.resultGeometry = bufBuilder.buffer(this.argGeom, this.distance);
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:11,代碼來源:BufferOp.java

示例7: getNoder

import com.vividsolutions.jts.noding.Noder; //導入依賴的package包/類
private Noder getNoder(PrecisionModel precisionModel) {
        if (workingNoder != null) return workingNoder;

        // otherwise use a fast (but non-robust) noder
        MCIndexNoder noder = new MCIndexNoder();
        LineIntersector li = new RobustLineIntersector();
        li.setPrecisionModel(precisionModel);
        noder.setSegmentIntersector(new IntersectionAdder(li));
//    Noder noder = new IteratedNoder(precisionModel);
        return noder;
//    Noder noder = new SimpleSnapRounder(precisionModel);
//    Noder noder = new MCIndexSnapRounder(precisionModel);
//    Noder noder = new ScaledNoder(new MCIndexSnapRounder(new PrecisionModel(1.0)),
//                                  precisionModel.getScale());
    }
 
開發者ID:Semantive,項目名稱:jts,代碼行數:16,代碼來源:BufferBuilder.java

示例8: bufferFixedPrecision

import com.vividsolutions.jts.noding.Noder; //導入依賴的package包/類
private void bufferFixedPrecision(PrecisionModel fixedPM) {
    Noder noder = new ScaledNoder(new MCIndexSnapRounder(new PrecisionModel(1.0)),
            fixedPM.getScale());

    BufferBuilder bufBuilder = new BufferBuilder(bufParams);
    bufBuilder.setWorkingPrecisionModel(fixedPM);
    bufBuilder.setNoder(noder);
    // this may throw an exception, if robustness errors are encountered
    resultGeometry = bufBuilder.buffer(argGeom, distance);
}
 
開發者ID:Semantive,項目名稱:jts,代碼行數:11,代碼來源:BufferOp.java

示例9: setNoder

import com.vividsolutions.jts.noding.Noder; //導入依賴的package包/類
/**
 * Sets the {@link Noder} to use during noding.
 * This allows choosing fast but non-robust noding, or slower
 * but robust noding.
 *
 * @param noder the noder to use
 */
public void setNoder(Noder noder) {
    this.workingNoder = noder;
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:11,代碼來源:BufferBuilder.java

示例10: setNoder

import com.vividsolutions.jts.noding.Noder; //導入依賴的package包/類
/**
 * Sets the {@link Noder} to use during noding.
 * This allows choosing fast but non-robust noding, or slower
 * but robust noding.
 *
 * @param noder the noder to use
 */
public void setNoder(Noder noder) {
    workingNoder = noder;
}
 
開發者ID:Semantive,項目名稱:jts,代碼行數:11,代碼來源:BufferBuilder.java


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