private int relate(Geo3dShape<?> s) { return shape.getRelationship(s.shape); }
@Override public boolean intersects(GeoShape geoShape){ for(GeoAreaShape geoAreaShape : shapes){ if (geoAreaShape.intersects(geoShape)){ return true; } } return false; }
private int relate(Point p) { GeoPoint point = new GeoPoint(shape.getPlanetModel(), p.getY() * DistanceUtils.DEGREES_TO_RADIANS, p.getX() * DistanceUtils.DEGREES_TO_RADIANS); if (shape.isWithin(point)) { return GeoArea.WITHIN; } return GeoArea.DISJOINT; }
@Override public Rectangle getBoundingBox() { Rectangle bbox = this.boundingBox;//volatile read once if (bbox == null) { LatLonBounds bounds = new LatLonBounds(); shape.getBounds(bounds); GeoBBox geoBBox = GeoBBoxFactory.makeGeoBBox(shape.getPlanetModel(), bounds); bbox = new Geo3dRectangleShape(geoBBox, spatialcontext); this.boundingBox = bbox; } return bbox; }
private int relate(Rectangle r) { // Construct the right kind of GeoArea first GeoArea geoArea = GeoAreaFactory.makeGeoArea(shape.getPlanetModel(), r.getMaxY() * DistanceUtils.DEGREES_TO_RADIANS, r.getMinY() * DistanceUtils.DEGREES_TO_RADIANS, r.getMinX() * DistanceUtils.DEGREES_TO_RADIANS, r.getMaxX() * DistanceUtils.DEGREES_TO_RADIANS); return geoArea.getRelationship(shape); }