I am currently storing the locations with a SRID of 4326 (what seems to be most commonly suggested for lat, long).
I need to be able to run a query in postgres to find all locations that are within X miles.
Here's my current query:
SELECT * FROM users WHERE ST_Distance(location, ST_SetSRID(ST_Point(40, -70), 4326)) < 200;
From what I understand, this finds all points (location column in users) within 200 meters of New York (40, -70).
Would a standard conversion from meters to miles after the query or is there a better/more correct way to do this with miles?