I'm trying to select POIs from around given location within some distance. I tried so far two approaches I found online, but unfortunately none seems to be working - I'm getting no rows despite the fact I can find records from that area by hand.
My current code is:
(1)
SELECT * FROM public.planet_osm_point
WHERE ST_DWITHIN(public.planet_osm_point.way,
ST_TRANSFORM(ST_SETSRID(ST_MAKEPOINT(40.6978,-73.9792),4326),3857), 50);
(2)
SELECT *
FROM public.planet_osm_point
WHERE ST_DWithin(
ST_SetSRID(ST_Point(40.6978,-73.9792), 3857),
ST_Transform(public.planet_osm_point.way, 3857),
500
)
LIMIT 200;
Find_SRID
, I think the issue is probably because of difference between coordinates system used. postgis.refractions.net/documentation/manual-1.5/Find_SRID.html