a guest Nov 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- select json_build_object(
- 'type', 'FeatureCollection',
- 'features', json_agg(ST_AsGeoJSON(t.*)::json)
- FROM (SELECT parking.osm_id, parking.access, parking.name, st_transform(parking.way::geometry, 4326), ST_Distance(parking.way, point.way) distance FROM planet_osm_point point CROSS JOIN planet_osm_polygon parking WHERE point.name = 'Cortlandt Town Center (Walmart)' AND parking.amenity = 'parking' AND ST_DWithin(parking.way, point.way, 10000) ORDER BY distance ASC LIMIT 5)
- AS t(id, access, name, geom, distance);
RAW Paste Data