@Override public Shape getBuffered(double distance, SpatialContext spatialContext) { GeoBBox bBox = shape.expand(distance * DistanceUtils.DEGREES_TO_RADIANS); return new Geo3dRectangleShape(bBox, spatialContext); } }
@Override public void reset(double minX, double maxX, double minY, double maxY) { shape = GeoBBoxFactory.makeGeoBBox(shape.getPlanetModel(), maxY * DistanceUtils.DEGREES_TO_RADIANS, minY * DistanceUtils.DEGREES_TO_RADIANS, minX * DistanceUtils.DEGREES_TO_RADIANS, maxX * DistanceUtils.DEGREES_TO_RADIANS); center = null; boundingBox = null; }
@Override public Point getCenter() { Point center = this.center;//volatile read once if (center == null) { GeoPoint point = shape.getCenter(); center = new Geo3dPointShape( GeoPointShapeFactory.makeGeoPointShape(shape.getPlanetModel(), point.getLatitude(), point.getLongitude()), spatialcontext); this.center = center; } return center; }
/** * 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; }