0

I have table with Polygon geometries. I'd like to filter the table to include rows that are at a certain distance from a Point coordinate.

Here's a fiddle link for table schema, data etc.

https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=2c3c5863af9fe855491e4ef71f21a64b

Filter query based on proximity and distance.

select *
from geo
where st_distance(geometry, Point({lat},{lng})) <= {dist};

Basically, I'd to calculate the distance between a Polygon and Point and filter rows. Time it takes the query to run matters, so I am looking for a time-efficient solution.

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.