use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class EdgeLessThanDistanceToNodeVisitor method edgesWithinDistance.
public static <T> List<Edge<T>> edgesWithinDistance(final Graph<T> graph, final Node<T> node, final double maxDistance) {
final CreateListVisitor<Edge<T>> results = new CreateListVisitor<>();
final Point point = node;
BoundingBox env = point.getBoundingBox();
env = env.expand(maxDistance);
graph.getEdgeIndex().forEach(env, new EdgeLessThanDistanceToNodeVisitor<>(node, maxDistance, results));
return results.getList();
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class NearParallelEdgeVisitor method getEnvelope.
@Override
public BoundingBox getEnvelope() {
BoundingBox envelope = this.line.getBoundingBox();
envelope = envelope.expand(this.maxDistance);
return envelope;
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class NodeLessThanDistanceOfGeometryVisitor method getNodes.
public static <T> List<Node<T>> getNodes(final Graph<T> graph, final Geometry geometry, final double maxDistance) {
if (geometry == null) {
return Collections.emptyList();
} else {
final CreateListVisitor<Node<T>> results = new CreateListVisitor<>();
BoundingBox env = geometry.getBoundingBox();
env = env.expand(maxDistance);
final IdObjectIndex<Node<T>> index = graph.getNodeIndex();
final NodeLessThanDistanceOfGeometryVisitor<T> visitor = new NodeLessThanDistanceOfGeometryVisitor<>(geometry, maxDistance, results);
index.forEach(env, visitor);
return results.getList();
}
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class OnLineNodeVisitor method getNodes.
public static <T> List<Node<T>> getNodes(final Graph<T> graph, final LineString line, final double maxDistance) {
if (line == null) {
return Collections.emptyList();
} else {
final CreateListVisitor<Node<T>> results = new CreateListVisitor<>();
BoundingBox env = line.getBoundingBox();
env = env.expand(maxDistance);
final IdObjectIndex<Node<T>> index = graph.getNodeIndex();
final OnLineNodeVisitor<T> visitor = new OnLineNodeVisitor<>(line, results);
index.forEach(env, visitor);
return results.getList();
}
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class LineSegmentIndex method queryIntersections.
public List<Geometry> queryIntersections(final LineSegment querySeg) {
final BoundingBox env = querySeg.getBoundingBox();
final LineSegmentIntersectionVisitor visitor = new LineSegmentIntersectionVisitor(querySeg);
forEach(env, visitor);
final List<Geometry> intersections = new ArrayList<>(visitor.getIntersections());
return intersections;
}
Aggregations