/** * 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; }
@Override public Bounds addHorizontalPlane(final PlanetModel planetModel, final double latitude, final Plane horizontalPlane, final Membership... bounds) { if (!noTopLatitudeBound || !noBottomLatitudeBound) { addLatitudeBound(latitude); } return this; }
@Override public Bounds addVerticalPlane(final PlanetModel planetModel, final double longitude, final Plane verticalPlane, final Membership... bounds) { if (!noLongitudeBound) { addLongitudeBound(longitude); } return this; }
if (!boundsInfo.checkNoTopLatitudeBound() || !boundsInfo.checkNoBottomLatitudeBound()) { boundsInfo.addZValue(points[0]); if (!boundsInfo.checkNoLongitudeBound()) {
@Override public Bounds addPoint(GeoPoint point) { if (!noLongitudeBound) { // Get a longitude value addLongitudeBound(point.getLongitude()); } if (!noTopLatitudeBound || !noBottomLatitudeBound) { // Compute a latitude value addLatitudeBound(point.getLatitude()); } return this; }
@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; }
/** * Create a geobbox of the right kind given the specified {@link LatLonBounds}. * * @param planetModel is the planet model * @param bounds are the bounds * @return a GeoBBox corresponding to what was specified. */ public static GeoBBox makeGeoBBox(final PlanetModel planetModel, LatLonBounds bounds) { final double topLat = (bounds.checkNoTopLatitudeBound()) ? Math.PI * 0.5 : bounds.getMaxLatitude(); final double bottomLat = (bounds.checkNoBottomLatitudeBound()) ? -Math.PI * 0.5 : bounds.getMinLatitude(); final double leftLon = (bounds.checkNoLongitudeBound()) ? -Math.PI : bounds.getLeftLongitude(); final double rightLon = (bounds.checkNoLongitudeBound()) ? Math.PI : bounds.getRightLongitude(); return makeGeoBBox(planetModel, topLat, bottomLat, leftLon, rightLon); }
@Override public Bounds addYValue(final GeoPoint point) { if (!noLongitudeBound) { // Get a longitude value addLongitudeBound(point.getLongitude()); } return this; }
@Override public Bounds addZValue(final GeoPoint point) { if (!noTopLatitudeBound || !noBottomLatitudeBound) { // Compute a latitude value double latitude = point.getLatitude(); addLatitudeBound(latitude); } return this; }
@Override public Bounds addXValue(final GeoPoint point) { if (!noLongitudeBound) { // Get a longitude value addLongitudeBound(point.getLongitude()); } return this; }