<div dir="ltr"><div dir="ltr">It has been many years since I last worked with postGIS, I don't do GIS for a living anymore but I still like to have fun with it. I'm looking to export some old data I have as GeoJSON and projecting it to display in a Google Map Overlay. I can get the two individual queries below to work, but I cannot figure out how to combine them. I want to transform and output to GeoJSON with attributes stored in the DB.<div><br></div><div><div>SELECT</div><div>  ST_AsGeoJSON(ST_Transform(ST_SetSRID(trails_01.geom, 26918), 4326)),</div><div>  <a href="http://trails_01.name">trails_01.name</a>,</div><div>  <a href="http://trails_01.id">trails_01.id</a></div><div>FROM</div><div>  topology.trails_01;</div><div><br></div><div>SELECT jsonb_build_object(</div><div>    'type',     'FeatureCollection',</div><div>    'features', jsonb_agg(features.feature)</div><div>)</div><div>FROM (</div><div>  SELECT jsonb_build_object(</div><div>    'type',       'Feature',</div><div>    'id',         gid,</div><div>    'geometry',   ST_AsGeoJSON(geom)::jsonb,</div><div>    'properties', to_jsonb(inputs) - 'gid' - 'geom'</div><div>  ) AS feature</div><div>  FROM (SELECT * FROM topology.trails_01) inputs) features;</div></div><div><br></div><div>Any help would be appreciated as I start down this path of reteaching myself postGIS.</div><div><br></div><div>Thank you,</div><div>Sean</div><div><br></div></div></div>