Here’s a query I use to find find the closest X locations to a particular latitude and longitude. I usually end up combining it with a lot of other query business, but in this case I’ve tried to remove everything that isn’t related to the proximity
query.