@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; }
/** * Set the bounds from the wrapped GeoBBox. */ private void setBoundsFromshape() { LatLonBounds bounds = new LatLonBounds(); shape.getBounds(bounds); minX = bounds.checkNoLongitudeBound() ? -180.0 : bounds.getLeftLongitude() * DistanceUtils.RADIANS_TO_DEGREES; minY = bounds.checkNoBottomLatitudeBound() ? -90.0 : bounds.getMinLatitude() * DistanceUtils.RADIANS_TO_DEGREES; maxX = bounds.checkNoLongitudeBound() ? 180.0 : bounds.getRightLongitude() * DistanceUtils.RADIANS_TO_DEGREES; maxY = bounds.checkNoTopLatitudeBound() ? 90.0 : bounds.getMaxLatitude() * DistanceUtils.RADIANS_TO_DEGREES; }