本文整理汇总了Java中com.vividsolutions.jts.geomgraph.EdgeEnd类的典型用法代码示例。如果您正苦于以下问题:Java EdgeEnd类的具体用法?Java EdgeEnd怎么用?Java EdgeEnd使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EdgeEnd类属于com.vividsolutions.jts.geomgraph包,在下文中一共展示了EdgeEnd类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEdgeEndForNext
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
/**
* Create a StubEdge for the edge after the intersection eiCurr.
* The next intersection is provided
* in case it is the endpoint for the stub edge.
* Otherwise, the next point from the parent edge will be the endpoint.
* <br>
* eiCurr will always be an EdgeIntersection, but eiNext may be null.
*/
void createEdgeEndForNext(
Edge edge,
List l,
EdgeIntersection eiCurr,
EdgeIntersection eiNext) {
int iNext = eiCurr.segmentIndex + 1;
// if there is no next edge there is nothing to do
if (iNext >= edge.getNumPoints() && eiNext == null) {
return;
}
Coordinate pNext = edge.getCoordinate(iNext);
// if the next intersection is in the same segment as the current, use it as the endpoint
if (eiNext != null && eiNext.segmentIndex == eiCurr.segmentIndex) {
pNext = eiNext.coord;
}
EdgeEnd e = new EdgeEnd(edge, eiCurr.coord, pNext, new Label(edge.getLabel()));
//Debug.println(e);
l.add(e);
}
示例2: computeLabel
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
/**
* This computes the overall edge label for the set of
* edges in this EdgeStubBundle. It essentially merges
* the ON and side labels for each edge. These labels must be compatible
*/
@Override
public void computeLabel(BoundaryNodeRule boundaryNodeRule) {
// create the label. If any of the edges belong to areas,
// the label must be an area label
boolean isArea = false;
for (Iterator it = this.iterator(); it.hasNext(); ) {
EdgeEnd e = (EdgeEnd) it.next();
if (e.getLabel().isArea()) {
isArea = true;
}
}
if (isArea) {
this.label = new Label(Location.NONE, Location.NONE, Location.NONE);
} else {
this.label = new Label(Location.NONE);
}
// compute the On label, and the side labels if present
for (int i = 0; i < 2; i++) {
this.computeLabelOn(i, boundaryNodeRule);
if (isArea) {
this.computeLabelSides(i);
}
}
}
示例3: insert
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
/**
* Insert a EdgeEnd in order in the list.
* If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is
* added to the bundle. Otherwise, a new EdgeEndBundle is created
* to contain the EdgeEnd.
* <br>
*/
@Override
public void insert(EdgeEnd e) {
EdgeEndBundle eb = (EdgeEndBundle) this.edgeMap.get(e);
if (eb == null) {
eb = new EdgeEndBundle(e);
this.insertEdgeEnd(e, eb);
} else {
eb.insert(e);
}
}
示例4: createEdgeEndForPrev
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
/**
* Create a EdgeStub for the edge before the intersection eiCurr.
* The previous intersection is provided
* in case it is the endpoint for the stub edge.
* Otherwise, the previous point from the parent edge will be the endpoint.
* <br>
* eiCurr will always be an EdgeIntersection, but eiPrev may be null.
*/
void createEdgeEndForPrev(
Edge edge,
List l,
EdgeIntersection eiCurr,
EdgeIntersection eiPrev) {
int iPrev = eiCurr.segmentIndex;
if (eiCurr.dist == 0.0) {
// if at the start of the edge there is no previous edge
if (iPrev == 0) {
return;
}
iPrev--;
}
Coordinate pPrev = edge.getCoordinate(iPrev);
// if prev intersection is past the previous vertex, use it instead
if (eiPrev != null && eiPrev.segmentIndex >= iPrev) {
pPrev = eiPrev.coord;
}
Label label = new Label(edge.getLabel());
// since edgeStub is oriented opposite to it's parent edge, have to flip sides for edge label
label.flip();
EdgeEnd e = new EdgeEnd(edge, eiCurr.coord, pPrev, label);
//e.print(System.out); System.out.println();
l.add(e);
}
示例5: EdgeEndBundle
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
public EdgeEndBundle(BoundaryNodeRule boundaryNodeRule, EdgeEnd e) {
super(e.getEdge(), e.getCoordinate(), e.getDirectedCoordinate(), new Label(e.getLabel()));
this.insert(e);
/*
if (boundaryNodeRule != null)
this.boundaryNodeRule = boundaryNodeRule;
else
boundaryNodeRule = BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE;
*/
}
示例6: computeLabelSide
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
/**
* To compute the summary label for a side, the algorithm is:
* FOR all edges
* IF any edge's location is INTERIOR for the side, side location = INTERIOR
* ELSE IF there is at least one EXTERIOR attribute, side location = EXTERIOR
* ELSE side location = NULL
* <br>
* Note that it is possible for two sides to have apparently contradictory information
* i.e. one edge side may indicate that it is in the interior of a geometry, while
* another edge side may indicate the exterior of the same geometry. This is
* not an incompatibility - GeometryCollections may contain two Polygons that touch
* along an edge. This is the reason for Interior-primacy rule above - it
* results in the summary label having the Geometry interior on <b>both</b> sides.
*/
private void computeLabelSide(int geomIndex, int side) {
for (Iterator it = this.iterator(); it.hasNext(); ) {
EdgeEnd e = (EdgeEnd) it.next();
if (e.getLabel().isArea()) {
int loc = e.getLabel().getLocation(geomIndex, side);
if (loc == Location.INTERIOR) {
this.label.setLocation(geomIndex, side, Location.INTERIOR);
return;
} else if (loc == Location.EXTERIOR) {
this.label.setLocation(geomIndex, side, Location.EXTERIOR);
}
}
}
}
示例7: print
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
@Override
public void print(PrintStream out) {
out.println("EdgeEndBundle--> Label: " + this.label);
for (Iterator it = this.iterator(); it.hasNext(); ) {
EdgeEnd ee = (EdgeEnd) it.next();
ee.print(out);
out.println();
}
}
示例8: insert
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
/**
* Insert a EdgeEnd in order in the list.
* If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is
* added to the bundle. Otherwise, a new EdgeEndBundle is created
* to contain the EdgeEnd.
* <br>
*/
public void insert(EdgeEnd e) {
EdgeEndBundle eb = (EdgeEndBundle) edgeMap.get(e);
if (eb == null) {
eb = new EdgeEndBundle(e);
insertEdgeEnd(e, eb);
} else {
eb.insert(e);
}
}
示例9: insertEdgeEnds
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
private void insertEdgeEnds(List ee) {
for (Object anEe : ee) {
EdgeEnd e = (EdgeEnd) anEe;
this.nodes.add(e);
}
}
示例10: insertEdgeEnds
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
public void insertEdgeEnds(List ee) {
for (Object anEe : ee) {
EdgeEnd e = (EdgeEnd) anEe;
this.nodes.add(e);
}
}
示例11: insert
import com.vividsolutions.jts.geomgraph.EdgeEnd; //导入依赖的package包/类
public void insert(EdgeEnd e) {
// Assert: start point is the same
// Assert: direction is the same
this.edgeEnds.add(e);
}