use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class LineSegmentIndex method isWithinDistance.
public boolean isWithinDistance(final Point point) {
BoundingBox envelope = point.getBoundingBox();
envelope = envelope.expand(1);
final List<LineSegment> lines = getItems(envelope);
for (final LineSegment line : lines) {
if (line.distancePoint(point) <= 1) {
return true;
}
}
return false;
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class SpatialIndex method forEach.
default boolean forEach(final BoundingBoxProxy boundingBoxProxy, final Predicate<? super V> filter, final Consumer<? super V> action) {
final BoundingBox boundingBox = convertBoundingBox(boundingBoxProxy);
final double minX = boundingBox.getMinX();
final double minY = boundingBox.getMinY();
final double maxX = boundingBox.getMaxX();
final double maxY = boundingBox.getMaxY();
return forEach(minX, minY, maxX, maxY, filter, action);
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class SpatialIndex method forEach.
default boolean forEach(final BoundingBoxProxy boundingBoxProxy, final Consumer<? super V> action) {
final BoundingBox boundingBox = convertBoundingBox(boundingBoxProxy);
final double minX = boundingBox.getMinX();
final double minY = boundingBox.getMinY();
final double maxX = boundingBox.getMaxX();
final double maxY = boundingBox.getMaxY();
return forEach(minX, minY, maxX, maxY, action);
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class SpatialIndex method insertItem.
default void insertItem(final BoundingBoxProxy boundingBoxProxy, final V item) {
final BoundingBox boundingBox = boundingBoxProxy.getBoundingBox();
insertItem(boundingBox, item);
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class AbstractIdObjectPointQuadTree method forEach.
@Override
public void forEach(final BoundingBoxProxy boundingBoxProxy, final Predicate<? super T> filter, final Consumer<? super T> action) {
final BoundingBox boundingBox = boundingBoxProxy.getBoundingBox();
this.index.forEach(boundingBox, (id) -> {
final T object = getObject(id);
final BoundingBox e = getBoundingBox(object);
if (e.intersects(boundingBox) && filter.test(object)) {
action.accept(object);
}
});
}
Aggregations