ST_SetSRID assigns an SRID to a geometry as metadata without changing its coordinates. It is especially useful after creating a point with ST_MakePoint. section 10.5.1
Create a point for distance searches
WITH roost_hotel AS ( SELECT ST_SetSRID( ST_MakePoint(-9178356.224987695, 3242002.0503882724), 3857) AS point ) SELECT p.name, p.amenity, round(ST_Distance(h.point, p.way)) AS distance_meters, round(ST_Distance(h.point, p.way) * 3.28) AS distance_feet FROM roost_hotel AS h JOIN florida.planet_osm_point AS p ON ST_DWithin(h.point, p.way, 500) WHERE p.amenity = 'restaurant' ORDER BY distance_meters LIMIT 5; The query returns Wagamama at 68 meters, followed by Boulon Brasserie at 132 meters. section 10.5.1
