I have the following table called locations with the following columns:
latitudelongitude
now I would like to query all entries that are within a specific radius from a given lat/long point.
SELECT * FROM locations
WHERE ST_DWithin(
ST_MakePoint(longitude, latitude),
ST_MakePoint(-0.63098, 51.18291),
100
);
The query above explains what data I have as an input and the data I have to query against.
Any thoughts?
ST_Distancewould be more straightforward IMHO. - pozs100mradius from the input long/lat coordinates.ST_Distancereturns only the distance between 2 points, what I want to achieve, is return all locations within a specific radius from a point - Andrei StalbeWHERE ST_Distance(point_in_table, queried_point) < queried_max_distance- pozsST_DistanceandST_DWithinthe result is the same. Even though the distance/radius are set to 1m, some of the rows are considerable farer than that. - Andrei Stalbe