How to exclude sensor with lon/lat not within lon/lat range

This post shows how to get distances between people and zones along with distance between zones. It might give you some ideas on how to do it.

Distances between zones or persons - Share your Projects! / Dashboards & Frontend - Home Assistant Community (home-assistant.io)