Created
November 3, 2015 19:43
-
-
Save alexanno/52198608b78650e8d305 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.geom, 4)::json As geometry | |
, row_to_json((SELECT l FROM (SELECT fylkesnr, navn) As l | |
)) As properties | |
FROM sandbox.fylker As lg ) As f ) As fc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment