How to query via point + radius/distance? #61
-
Hi, I was able to use the library to query a geopackage based on a bounding box. I was wondering if there was a way to query features based on point + radius/distance? I saw the Any pointers would be appreciated, thanks! Nicolas |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
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.
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 query method with both bounds and projection.
We do similar things in our apps, but calculate based on screen pixel bounds. After the initial query, we sometimes do fine filtering on the results. |
Beta Was this translation helpful? Give feedback.
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.
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