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.


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.



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.