@Override public boolean intersects(final GeometricSurface surface) { return surface.fullyGeometricallyEncloses(getLocation()); }
@Override public boolean intersects(final GeometricSurface surface) { return surface.overlaps(asPolyLine()); }
@Override public boolean intersects(final GeometricSurface surface) { return surface.overlaps(asPolygon()); }
public Set<Node> leafNodes(final GeometricSurface surface) { final Set<Node> result = new HashSet<>(); final Rectangle polygonBounds = surface.bounds(); if (polygonBounds.overlaps(bounds())) { if (isFinal() && surface.overlaps(bounds())) { result.add(this); } else { for (final Node child : this.children) { result.addAll(child.leafNodes(surface)); } } } return result; }
private boolean nodeWithinTargetBoundary(final Node node) { return this.boundingBox.fullyGeometricallyEncloses(new Location( Latitude.degrees(node.getLatitude()), Longitude.degrees(node.getLongitude()))); }
@Override public boolean geometricSurfaceEntityIntersecting(final GeometricSurface geometricSurface, final AtlasEntity entity) { if (entity instanceof LineItem) { return geometricSurface .fullyGeometricallyEncloses(((LineItem) entity).asPolyLine()); } if (entity instanceof LocationItem) { return geometricSurface .fullyGeometricallyEncloses(((LocationItem) entity).getLocation()); } if (entity instanceof Area) { return geometricSurface.fullyGeometricallyEncloses(((Area) entity).asPolygon()); } if (entity instanceof Relation) { return ((Relation) entity).members().stream().map(RelationMember::getEntity) .anyMatch(relationEntity -> this.geometricSurfaceEntityIntersecting( geometricSurface, relationEntity)); } else { return false; } } };