Query for feature results in the bounding box

@param webMercatorBoundingBox
web mercator bounding box
@return geometry index results
426273
public CloseableIterator<GeometryIndex> queryIndexedFeatures(
			BoundingBox webMercatorBoundingBox) {

		// Create an expanded bounding box to handle features outside the tile
		// that overlap
		BoundingBox expandedQueryBoundingBox = expandBoundingBox(webMercatorBoundingBox);

		// Query for geometries matching the bounds in the index
		CloseableIterator<GeometryIndex> results = featureIndex.query(
				expandedQueryBoundingBox, WEB_MERCATOR_PROJECTION);

		return results;
	}
170425
public void setBoundingBox(BoundingBox boundingBox, Projection projection) {
        ProjectionTransform projectionToWebMercator = projection
                .getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
        webMercatorBoundingBox = boundingBox
                .transform(projectionToWebMercator);
    }
648567
public static BoundingBox boundDegreesBoundingBoxWithWebMercatorLimits(
			BoundingBox boundingBox) {
		BoundingBox bounded = new BoundingBox(boundingBox);
		if (bounded.getMinLatitude() < ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE) {
			bounded.setMinLatitude(ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE);
		}
		if (bounded.getMaxLatitude() < ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE) {
			bounded.setMaxLatitude(ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE);
		}
		if (bounded.getMaxLatitude() > ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE) {
			bounded.setMaxLatitude(ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE);
		}
		if (bounded.getMinLatitude() > ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE) {
			bounded.setMinLatitude(ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE);
		}
		return bounded;
	}
527277
public static AxisAlignedBB[] getCollisionBoundingBoxes(World world, MBlockState state)
	{
		return getCollisionBoundingBoxes(world, state, false);
	}
1247469
public BufferedImage drawTileQueryIndex(int x, int y, int zoom) {

		// Get the web mercator bounding box
		BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils
				.getWebMercatorBoundingBox(x, y, zoom);

		BufferedImage image = null;

		// Query for the geometry count matching the bounds in the index
		long tileCount = queryIndexedFeaturesCount(webMercatorBoundingBox);

		// Draw if at least one geometry exists
		if (tileCount > 0) {

			// Query for geometries matching the bounds in the index
			CloseableIterator<GeometryIndex> results = queryIndexedFeatures(webMercatorBoundingBox);

			try {

				if (maxFeaturesPerTile == null
						|| tileCount <= maxFeaturesPerTile.longValue()) {

					// Draw the tile image
					image = drawTile(zoom, webMercatorBoundingBox, results);

				} else if (maxFeaturesTileDraw != null) {

					// Draw the max features tile
					image = maxFeaturesTileDraw.drawTile(tileWidth, tileHeight,
							tileCount, results);
				}
			} finally {
				try {
					results.close();
				} catch (IOException e) {
					LOGGER.log(Level.WARNING,
							"Failed to close result set for query on x: " + x
									+ ", y: " + y + ", zoom: " + zoom, e);
				}
			}
		}

		return image;
	}
61609
@Nonnull
    private ReferencedEnvelope getFeatureBounds(
            final MfClientHttpRequestFactory clientHttpRequestFactory,
            final MapAttributeValues mapValues, final ExecutionContext context) {
        final MapfishMapContext mapContext = createMapContext(mapValues);

        String layerName = mapValues.zoomToFeatures.layer;
        ReferencedEnvelope bounds = new ReferencedEnvelope();
        for (MapLayer layer: mapValues.getLayers()) {
            context.stopIfCanceled();

            if ((!StringUtils.isEmpty(layerName) && layerName.equals(layer.getName())) ||
                    (StringUtils.isEmpty(layerName) && layer instanceof AbstractFeatureSourceLayer)) {
                AbstractFeatureSourceLayer featureLayer = (AbstractFeatureSourceLayer) layer;
                FeatureSource<?, ?> featureSource =
                        featureLayer.getFeatureSource(clientHttpRequestFactory, mapContext);
                FeatureCollection<?, ?> features;
                try {
                    features = featureSource.getFeatures();
                } catch (IOException e) {
                    throw ExceptionUtils.getRuntimeException(e);
                }

                if (!features.isEmpty()) {
                    final ReferencedEnvelope curBounds = features.getBounds();
                    bounds.expandToInclude(curBounds);
                }
            }
        }

        return bounds;
    }
977483
public static BoundingBox getProjectedBoundingBox(Projection projection,
			TileGrid tileGrid, int zoom) {

		BoundingBox boundingBox = getWebMercatorBoundingBox(tileGrid, zoom);

		if (projection != null) {
			ProjectionTransform transform = webMercator
					.getTransformation(projection);
			boundingBox = boundingBox.transform(transform);
		}

		return boundingBox;
	}
982157
public GeometryIndex getLinearRingIndex(Geometry geometry, Coordinate location) {
		return fromDelegate(GeometryService.getLinearRingIndex(geometry, location));
	}
434150
public BoundingBox getBoundingBox() {

		GenericRawResults<Object[]> results = null;
		Object[] values = null;
		try {
			results = geometryIndexDao.queryRaw("SELECT MIN("
					+ GeometryIndex.COLUMN_MIN_X + "), MIN("
					+ GeometryIndex.COLUMN_MIN_Y + "), MAX("
					+ GeometryIndex.COLUMN_MAX_X + "), MAX("
					+ GeometryIndex.COLUMN_MAX_Y + ") FROM "
					+ GeometryIndex.TABLE_NAME + " WHERE "
					+ GeometryIndex.COLUMN_TABLE_NAME + " = ?", new DataType[] {
					DataType.DOUBLE, DataType.DOUBLE, DataType.DOUBLE,
					DataType.DOUBLE }, tableName);
			values = results.getFirstResult();
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to query for indexed feature bounds: " + tableName,
					e);
		} finally {
			if (results != null) {
				try {
					results.close();
				} catch (IOException e) {
					logger.log(Level.WARNING,
							"Failed to close bounds query results", e);
				}
			}
		}

		BoundingBox boundingBox = new BoundingBox((double) values[0],
				(double) values[1], (double) values[2], (double) values[3]);

		return boundingBox;
	}
537952
def get_geoms_for_bounds(self, bounds):
        

        params = {'service'      : 'WFS',
                  'request'      : 'GetFeature',
                  'typeName'     : self._feature_name,
                  'outputFormat' : 'json',
                  'version'      : '1.0.0',
                  'bbox'         : ','.join((str(b) for b in wkt.loads(bounds).bounds))}

        raw_geojson_response = requests.get(self._wfs_server, params=params)
        raw_geojson_response.raise_for_status()
        geojson = raw_geojson_response.json()

        return [g['geometry'] for g in geojson['features']]
1061554
public BoundingBox overlap(BoundingBox projectedCoverage) {
		BoundingBox overlap = null;
		if (point) {
			overlap = projectedBoundingBox;
		} else {
			overlap = projectedBoundingBox.overlap(projectedCoverage);
		}
		return overlap;
	}
529276
function (x, y) {
		var polygons = this.polygons;
		for (var i = 0, n = polygons.length; i < n; i++)
			if (this.polygonContainsPoint(polygons[i], x, y)) return this.boundingBoxes[i];
		return null;
	}
618697
protected Bbox getTotalBounds(List<Feature> features) {
		Bbox total = null;
		for (Feature featureDto : features) {
			org.geomajas.geometry.Geometry geom = featureDto.getGeometry();
			if (geom != null) {
				Bbox b = GeometryService.getBounds(geom);
				if (total == null) {
					total = b;
				} else {
					total = BboxService.union(total, b);
				}
			}
		}
		return total;
	}
1024025
public List<GeometryIndex> queryForTableName(String tableName) {
		List<GeometryIndex> results = null;
		try {
			results = queryForEq(GeometryIndex.COLUMN_TABLE_NAME, tableName);
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to query for Geometry Index objects by Table Name: "
							+ tableName);
		}
		return results;
	}
615003
@Override
	public AxisAlignedBB[] getBoundingBoxes(Block block, IBlockAccess world, BlockPos pos, IBlockState state, BoundingBoxType type)
	{
		boolean corner = isCorner(state);
		if (type == BoundingBoxType.SELECTION && corner)
			return AABBUtils.identities();

		AxisAlignedBB aabb = new AxisAlignedBB(0, 0, 0, 1, 1, 3 / 16F);
		if (world == null)
			aabb = AABBUtils.rotate(aabb.offset(0, 0, 0.5F), -1);

		if (!corner)
			return new AxisAlignedBB[] { aabb };

		return new AxisAlignedBB[] { aabb, AABBUtils.rotate(aabb, -1) };
	}
538295
public static BoundingBox getBoundingBox(GoogleMap map) {

        LatLngBounds visibleBounds = map.getProjection()
                .getVisibleRegion().latLngBounds;
        LatLng southwest = visibleBounds.southwest;
        LatLng northeast = visibleBounds.northeast;

        double minLatitude = southwest.latitude;
        double maxLatitude = northeast.latitude;

        double minLongitude = southwest.longitude;
        double maxLongitude = northeast.longitude;
        if (maxLongitude < minLongitude) {
            maxLongitude += (2 * ProjectionConstants.WGS84_HALF_WORLD_LON_WIDTH);
        }

        BoundingBox boundingBox = new BoundingBox(minLongitude, minLatitude, maxLongitude, maxLatitude);

        return boundingBox;
    }
1036549
public static boolean isPointInBoundingBox(Point point,
			BoundingBox boundingBox) {
		BoundingBox pointBoundingbox = new BoundingBox(point.getX(),
				point.getY(), point.getX(), point.getY());
		return boundingBox.intersects(pointBoundingbox, true);
	}