Last active
September 14, 2020 21:40
-
-
Save ashaw/f8ed7c985720b5f6b052223eff8ca136 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select jsonb_build_object( | |
'type', 'FeatureCollection', | |
'features', jsonb_agg(features.feature) | |
) | |
from( | |
select jsonb_build_object( | |
'type', 'Feature', | |
'id', ogc_fid, | |
'geometry', ST_AsGeoJSON(the_geom)::jsonb, | |
'properties', to_jsonb(inputs) - 'gid' | |
) as feature from ( | |
(select YOUR QUERY) | |
inputs) features |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment