Skip to content

How to query via point + radius/distance? #61

Answered by bosborn
nguillaumin asked this question in Q&A
Discussion options

You must be logged in to vote

GeometryEnvelope is just the simple features container, bounds without any projections.

You could expand the bounding box and query for that box. If your projection/ feature table is already in meters (mercator, web mercator, etc), just expand by the distance in each direction.

BoundingBox queryBox = new BoundingBox(
		bbox.getMinLongitude() - meters,
		bbox.getMinLatitude() - meters,
		bbox.getMaxLongitude() + meters,
		bbox.getMaxLatitude() + meters);

If your bounding box / feature table is in degrees / WGS84, you could project it to a meter projection, expand it, and query with that projection provided. This method converts a WG84 bounding box to a Web Mercator bounding box.

Then call a

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@nguillaumin
Comment options

@bosborn
Comment options

@nguillaumin
Comment options

Answer selected by nguillaumin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants