本文整理汇总了Java中com.vividsolutions.jts.geomgraph.GeometryGraph.getEdgeIterator方法的典型用法代码示例。如果您正苦于以下问题:Java GeometryGraph.getEdgeIterator方法的具体用法?Java GeometryGraph.getEdgeIterator怎么用?Java GeometryGraph.getEdgeIterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vividsolutions.jts.geomgraph.GeometryGraph
的用法示例。
在下文中一共展示了GeometryGraph.getEdgeIterator方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeIntersectionNodes
import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
/**
* Insert nodes for all intersections on the edges of a Geometry.
* Label the created nodes the same as the edge label if they do not already have a label.
* This allows nodes created by either self-intersections or
* mutual intersections to be labelled.
* Endpoint nodes will already be labelled from when they were inserted.
* <p>
* Precondition: edge intersections have been computed.
*/
public void computeIntersectionNodes(GeometryGraph geomGraph, int argIndex) {
for (Iterator edgeIt = geomGraph.getEdgeIterator(); edgeIt.hasNext(); ) {
Edge e = (Edge) edgeIt.next();
int eLoc = e.getLabel().getLocation(argIndex);
for (Iterator eiIt = e.getEdgeIntersectionList().iterator(); eiIt.hasNext(); ) {
EdgeIntersection ei = (EdgeIntersection) eiIt.next();
RelateNode n = (RelateNode) this.nodes.addNode(ei.coord);
if (eLoc == Location.BOUNDARY) {
n.setLabelBoundary(argIndex);
} else {
if (n.getLabel().isNull(argIndex)) {
n.setLabel(argIndex, Location.INTERIOR);
}
}
//Debug.println(n);
}
}
}
示例2: hasClosedEndpointIntersection
import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
/**
* Tests that no edge intersection is the endpoint of a closed line.
* This ensures that closed lines are not touched at their endpoint,
* which is an interior point according to the Mod-2 rule
* To check this we compute the degree of each endpoint.
* The degree of endpoints of closed lines
* must be exactly 2.
*/
private boolean hasClosedEndpointIntersection(GeometryGraph graph) {
Map endPoints = new TreeMap();
for (Iterator i = graph.getEdgeIterator(); i.hasNext(); ) {
Edge e = (Edge) i.next();
int maxSegmentIndex = e.getMaximumSegmentIndex();
boolean isClosed = e.isClosed();
Coordinate p0 = e.getCoordinate(0);
this.addEndpoint(endPoints, p0, isClosed);
Coordinate p1 = e.getCoordinate(e.getNumPoints() - 1);
this.addEndpoint(endPoints, p1, isClosed);
}
for (Object o : endPoints.values()) {
EndpointInfo eiInfo = (EndpointInfo) o;
if (eiInfo.isClosed && eiInfo.degree != 2) {
this.nonSimpleLocation = eiInfo.getCoordinate();
return true;
}
}
return false;
}
示例3: hasClosedEndpointIntersection
import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
/**
* Tests that no edge intersection is the endpoint of a closed line.
* This ensures that closed lines are not touched at their endpoint,
* which is an interior point according to the Mod-2 rule
* To check this we compute the degree of each endpoint.
* The degree of endpoints of closed lines
* must be exactly 2.
*/
private boolean hasClosedEndpointIntersection(GeometryGraph graph) {
Map endPoints = new TreeMap();
for (Iterator i = graph.getEdgeIterator(); i.hasNext(); ) {
Edge e = (Edge) i.next();
int maxSegmentIndex = e.getMaximumSegmentIndex();
boolean isClosed = e.isClosed();
Coordinate p0 = e.getCoordinate(0);
addEndpoint(endPoints, p0, isClosed);
Coordinate p1 = e.getCoordinate(e.getNumPoints() - 1);
addEndpoint(endPoints, p1, isClosed);
}
for (Iterator i = endPoints.values().iterator(); i.hasNext(); ) {
EndpointInfo eiInfo = (EndpointInfo) i.next();
if (eiInfo.isClosed && eiInfo.degree != 2) {
nonSimpleLocation = eiInfo.getCoordinate();
return true;
}
}
return false;
}
示例4: checkNoSelfIntersectingRings
import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
/**
* Check that there is no ring which self-intersects (except of course at its endpoints).
* This is required by OGC topology rules (but not by other models
* such as ESRI SDE, which allow inverted shells and exverted holes).
*
* @param graph the topology graph of the geometry
*/
private void checkNoSelfIntersectingRings(GeometryGraph graph) {
for (Iterator i = graph.getEdgeIterator(); i.hasNext(); ) {
Edge e = (Edge) i.next();
this.checkNoSelfIntersectingRing(e.getEdgeIntersectionList());
if (this.validErr != null) {
return;
}
}
}
示例5: hasNonEndpointIntersection
import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
/**
* For all edges, check if there are any intersections which are NOT at an endpoint.
* The Geometry is not simple if there are intersections not at endpoints.
*/
private boolean hasNonEndpointIntersection(GeometryGraph graph) {
for (Iterator i = graph.getEdgeIterator(); i.hasNext(); ) {
Edge e = (Edge) i.next();
int maxSegmentIndex = e.getMaximumSegmentIndex();
for (Iterator eiIt = e.getEdgeIntersectionList().iterator(); eiIt.hasNext(); ) {
EdgeIntersection ei = (EdgeIntersection) eiIt.next();
if (!ei.isEndPoint(maxSegmentIndex)) {
this.nonSimpleLocation = ei.getCoordinate();
return true;
}
}
}
return false;
}
示例6: checkNoSelfIntersectingRings
import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
/**
* Check that there is no ring which self-intersects (except of course at its endpoints).
* This is required by OGC topology rules (but not by other models
* such as ESRI SDE, which allow inverted shells and exverted holes).
*
* @param graph the topology graph of the geometry
*/
private void checkNoSelfIntersectingRings(GeometryGraph graph) {
for (Iterator i = graph.getEdgeIterator(); i.hasNext(); ) {
Edge e = (Edge) i.next();
checkNoSelfIntersectingRing(e.getEdgeIntersectionList());
if (validErr != null)
return;
}
}
示例7: hasNonEndpointIntersection
import com.vividsolutions.jts.geomgraph.GeometryGraph; //导入方法依赖的package包/类
/**
* For all edges, check if there are any intersections which are NOT at an endpoint.
* The Geometry is not simple if there are intersections not at endpoints.
*/
private boolean hasNonEndpointIntersection(GeometryGraph graph) {
for (Iterator i = graph.getEdgeIterator(); i.hasNext(); ) {
Edge e = (Edge) i.next();
int maxSegmentIndex = e.getMaximumSegmentIndex();
for (Iterator eiIt = e.getEdgeIntersectionList().iterator(); eiIt.hasNext(); ) {
EdgeIntersection ei = (EdgeIntersection) eiIt.next();
if (!ei.isEndPoint(maxSegmentIndex)) {
nonSimpleLocation = ei.getCoordinate();
return true;
}
}
}
return false;
}