Created
April 25, 2016 07:43
-
-
Save arion/2a9aeefe6d60d55c88bac2f39691233b to your computer and use it in GitHub Desktop.
This file contains 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 row_to_json(fc) | |
FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features | |
FROM (SELECT 'Feature' As type | |
, ST_AsGeoJSON(lg.area)::json As geometry | |
, row_to_json((SELECT l FROM (SELECT id, name) As l | |
)) As properties | |
FROM geofences As lg ) As f ) As fc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment