use of com.revolsys.geometry.geomgraph.Label in project com.revolsys.open by revolsys.
the class LineBuilder method collectLineEdge.
/**
* Collect line edges which are in the result.
* Line edges are in the result if they are not part of
* an area boundary, if they are in the result of the overlay operation,
* and if they are not covered by a result area.
*
* @param de the directed edge to test
* @param opCode the overlap operation
* @param edges the list of included line edges
*/
private void collectLineEdge(final DirectedEdge de, final int opCode, final List<Edge> edges) {
final Label label = de.getLabel();
final Edge e = de.getEdge();
// include L edges which are in the result
if (de.isLineEdge()) {
if (!de.isVisited() && OverlayOp.isResultOfOp(label, opCode) && !e.isCovered()) {
// Debug.println("de: " + de.getLabel());
// Debug.println("edge: " + e.getLabel());
edges.add(e);
de.setVisitedEdge(true);
}
}
}
use of com.revolsys.geometry.geomgraph.Label in project com.revolsys.open by revolsys.
the class OverlayOp method updateNodeLabelling.
private void updateNodeLabelling() {
// because it is a point in one of the input geometries)
for (final Node node : this.graph.getNodes()) {
final Label label = ((DirectedEdgeStar) node.getEdges()).getLabel();
node.getLabel().merge(label);
}
}
use of com.revolsys.geometry.geomgraph.Label in project com.revolsys.open by revolsys.
the class OverlayOp method labelIncompleteNode.
/**
* Label an isolated node with its relationship to the target geometry.
*/
private void labelIncompleteNode(final Node node, final int targetIndex) {
final Geometry geometry = this.arg[targetIndex].getGeometry();
final double x = node.getX();
final double y = node.getY();
final Location location = this.ptLocator.locate(geometry, x, y);
final Label label = node.getLabel();
label.setLocation(targetIndex, location);
}
use of com.revolsys.geometry.geomgraph.Label in project com.revolsys.open by revolsys.
the class OverlayOp method labelIncompleteNodes.
/**
* 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.
*
* 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() {
for (final Node n : this.graph.getNodes()) {
final Label label = n.getLabel();
if (n.isIsolated()) {
if (label.isNull(0)) {
labelIncompleteNode(n, 0);
} else {
labelIncompleteNode(n, 1);
}
}
// now update the labelling for the DirectedEdges incident on this node
((DirectedEdgeStar) n.getEdges()).updateLabelling(label);
}
}
use of com.revolsys.geometry.geomgraph.Label in project com.revolsys.open by revolsys.
the class OffsetCurveSetBuilder method addCurve.
/**
* Creates a {@link SegmentString} for a coordinate list which is a raw offset curve,
* and adds it to the list of buffer curves.
* The SegmentString is tagged with a Label giving the topology of the curve.
* The curve may be oriented in either direction.
* If the curve is oriented CW, the locations will be:
* <br>Left: Location.EXTERIOR
* <br>Right: Location.INTERIOR
*/
private void addCurve(final LineString points, final Location leftLoc, final Location rightLoc) {
if (points != null && points.getVertexCount() >= 2) {
final Label label = new Label(0, Location.BOUNDARY, leftLoc, rightLoc);
final NodedSegmentString segment = new NodedSegmentString(points, label);
this.curveList.add(segment);
}
}
Aggregations