当前位置: 首页>>代码示例>>Java>>正文


Java DirectedEdgeStar类代码示例

本文整理汇总了Java中com.vividsolutions.jts.geomgraph.DirectedEdgeStar的典型用法代码示例。如果您正苦于以下问题:Java DirectedEdgeStar类的具体用法?Java DirectedEdgeStar怎么用?Java DirectedEdgeStar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DirectedEdgeStar类属于com.vividsolutions.jts.geomgraph包,在下文中一共展示了DirectedEdgeStar类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findCoveredLineEdges

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
/**
     * Find and mark L edges which are "covered" by the result area (if any).
     * L edges at nodes which also have A edges can be checked by checking
     * their depth at that node.
     * L edges at nodes which do not have A edges can be checked by doing a
     * point-in-polygon test with the previously computed result areas.
     */
    private void findCoveredLineEdges() {
        // first set covered for all L edges at nodes which have A edges too
        for (Object o1 : op.getGraph().getNodes()) {
            Node node = (Node) o1;
//node.print(System.out);
            ((DirectedEdgeStar) node.getEdges()).findCoveredLineEdges();
        }

        /**
         * For all L edges which weren't handled by the above,
         * use a point-in-poly test to determine whether they are covered
         */
        for (Object o : op.getGraph().getEdgeEnds()) {
            DirectedEdge de = (DirectedEdge) o;
            Edge e = de.getEdge();
            if (de.isLineEdge() && !e.isCoveredSet()) {
                boolean isCovered = this.op.isCoveredByA(de.getCoordinate());
                e.setCovered(isCovered);
            }
        }
    }
 
开发者ID:gegy1000,项目名称:Earth,代码行数:29,代码来源:LineBuilder.java

示例2: labelIncompleteNodes

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
/**
     * Incomplete nodes are nodes whose labels are incomplete.
     * (e.g. the location for one Geometry is null).
     * These are either isolated nodes,
     * or nodes which have edges from only a single Geometry incident on them.
     * <p>
     * Isolated nodes are found because nodes in one graph which don't intersect
     * nodes in the other are not completely labelled by the initial process
     * of adding nodes to the nodeList.
     * To complete the labelling we need to check for nodes that lie in the
     * interior of edges, and in the interior of areas.
     * <p>
     * When each node labelling is completed, the labelling of the incident
     * edges is updated, to complete their labelling as well.
     */
    private void labelIncompleteNodes() {
        int nodeCount = 0;
        for (Object o : graph.getNodes()) {
            Node n = (Node) o;
            Label label = n.getLabel();
            if (n.isIsolated()) {
                nodeCount++;
                if (label.isNull(0)) {
                    this.labelIncompleteNode(n, 0);
                } else {
                    this.labelIncompleteNode(n, 1);
                }
            }
            // now update the labelling for the DirectedEdges incident on this node
            ((DirectedEdgeStar) n.getEdges()).updateLabelling(label);
//n.print(System.out);
        }
    /*
    int nPoly0 = arg[0].getGeometry().getNumGeometries();
    int nPoly1 = arg[1].getGeometry().getNumGeometries();
    System.out.println("# isolated nodes= " + nodeCount 
    		+ "   # poly[0] = " + nPoly0
    		+ "   # poly[1] = " + nPoly1);
    */
    }
 
开发者ID:gegy1000,项目名称:Earth,代码行数:41,代码来源:OverlayOp.java

示例3: check

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
/**
 * Tests whether the result geometry is consistent
 *
 * @throws TopologyException if inconsistent topology is found
 */
public void check(int opCode) {
    for (Iterator nodeit = this.graph.getNodeIterator(); nodeit.hasNext(); ) {
        Node node = (Node) nodeit.next();
        this.testLinkResultDirectedEdges((DirectedEdgeStar) node.getEdges(), opCode);
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:12,代码来源:ConsistentPolygonRingChecker.java

示例4: getPotentialResultAreaEdges

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
private List getPotentialResultAreaEdges(DirectedEdgeStar deStar, int opCode) {
//print(System.out);
        List resultAreaEdgeList = new ArrayList();
        for (Iterator it = deStar.iterator(); it.hasNext(); ) {
            DirectedEdge de = (DirectedEdge) it.next();
            if (this.isPotentialResultAreaEdge(de, opCode) || this.isPotentialResultAreaEdge(de.getSym(), opCode)) {
                resultAreaEdgeList.add(de);
            }
        }
        return resultAreaEdgeList;
    }
 
开发者ID:gegy1000,项目名称:Earth,代码行数:12,代码来源:ConsistentPolygonRingChecker.java

示例5: linkDirectedEdgesForMinimalEdgeRings

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
/**
 * For all nodes in this EdgeRing,
 * link the DirectedEdges at the node to form minimalEdgeRings
 */
public void linkDirectedEdgesForMinimalEdgeRings() {
    DirectedEdge de = this.startDe;
    do {
        Node node = de.getNode();
        ((DirectedEdgeStar) node.getEdges()).linkMinimalDirectedEdges(this);
        de = de.getNext();
    } while (de != this.startDe);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:13,代码来源:MaximalEdgeRing.java

示例6: mergeSymLabels

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
/**
     * For nodes which have edges from only one Geometry incident on them,
     * the previous step will have left their dirEdges with no labelling for the other
     * Geometry.  However, the sym dirEdge may have a labelling for the other
     * Geometry, so merge the two labels.
     */
    private void mergeSymLabels() {
        for (Object o : graph.getNodes()) {
            Node node = (Node) o;
            ((DirectedEdgeStar) node.getEdges()).mergeSymLabels();
//node.print(System.out);
        }
    }
 
开发者ID:gegy1000,项目名称:Earth,代码行数:14,代码来源:OverlayOp.java

示例7: updateNodeLabelling

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
private void updateNodeLabelling() {
    // update the labels for nodes
    // The label for a node is updated from the edges incident on it
    // (Note that a node may have already been labelled
    // because it is a point in one of the input geometries)
    for (Object o : graph.getNodes()) {
        Node node = (Node) o;
        Label lbl = ((DirectedEdgeStar) node.getEdges()).getLabel();
        node.getLabel().merge(lbl);
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:12,代码来源:OverlayOp.java

示例8: findRightmostEdgeAtNode

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
private void findRightmostEdgeAtNode() {
    Node node = this.minDe.getNode();
    DirectedEdgeStar star = (DirectedEdgeStar) node.getEdges();
    this.minDe = star.getRightmostEdge();
    // the DirectedEdge returned by the previous call is not
    // necessarily in the forward direction. Use the sym edge if it isn't.
    if (!this.minDe.isForward()) {
        this.minDe = this.minDe.getSym();
        this.minIndex = this.minDe.getEdge().getCoordinates().length - 1;
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:12,代码来源:RightmostEdgeFinder.java

示例9: linkDirectedEdgesForMinimalEdgeRings

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
/**
 * For all nodes in this EdgeRing,
 * link the DirectedEdges at the node to form minimalEdgeRings
 */
public void linkDirectedEdgesForMinimalEdgeRings() {
    DirectedEdge de = startDe;
    do {
        Node node = de.getNode();
        ((DirectedEdgeStar) node.getEdges()).linkMinimalDirectedEdges(this);
        de = de.getNext();
    } while (de != startDe);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:13,代码来源:MaximalEdgeRing.java

示例10: testLinkResultDirectedEdges

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
private void testLinkResultDirectedEdges(DirectedEdgeStar deStar, int opCode) {
        // make sure edges are copied to resultAreaEdges list
        List ringEdges = this.getPotentialResultAreaEdges(deStar, opCode);
        // find first area edge (if any) to start linking at
        DirectedEdge firstOut = null;
        DirectedEdge incoming = null;
        int state = this.SCANNING_FOR_INCOMING;
        // link edges in CCW order
        for (Object ringEdge : ringEdges) {
            DirectedEdge nextOut = (DirectedEdge) ringEdge;
            DirectedEdge nextIn = nextOut.getSym();

            // skip de's that we're not interested in
            if (!nextOut.getLabel().isArea()) {
                continue;
            }

            // record first outgoing edge, in order to link the last incoming edge
            if (firstOut == null
                    && this.isPotentialResultAreaEdge(nextOut, opCode)) {
                firstOut = nextOut;
            }
            // assert: sym.isInResult() == false, since pairs of dirEdges should have been removed already

            switch (state) {
                case SCANNING_FOR_INCOMING:
                    if (!this.isPotentialResultAreaEdge(nextIn, opCode)) {
                        continue;
                    }
                    incoming = nextIn;
                    state = this.LINKING_TO_OUTGOING;
                    break;
                case LINKING_TO_OUTGOING:
                    if (!this.isPotentialResultAreaEdge(nextOut, opCode)) {
                        continue;
                    }
                    //incoming.setNext(nextOut);
                    state = this.SCANNING_FOR_INCOMING;
                    break;
            }
        }
//Debug.print(this);
        if (state == this.LINKING_TO_OUTGOING) {
//Debug.print(firstOut == null, this);
            if (firstOut == null) {
                throw new TopologyException("no outgoing dirEdge found", deStar.getCoordinate());
            }
        }
    }
 
开发者ID:gegy1000,项目名称:Earth,代码行数:50,代码来源:ConsistentPolygonRingChecker.java

示例11: createNode

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
@Override
public Node createNode(Coordinate coord) {
    return new Node(coord, new DirectedEdgeStar());
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:5,代码来源:OverlayNodeFactory.java

示例12: createNode

import com.vividsolutions.jts.geomgraph.DirectedEdgeStar; //导入依赖的package包/类
public Node createNode(Coordinate coord) {
    return new Node(coord, new DirectedEdgeStar());
}
 
开发者ID:Semantive,项目名称:jts,代码行数:4,代码来源:OverlayNodeFactory.java


注:本文中的com.vividsolutions.jts.geomgraph.DirectedEdgeStar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。