Last active
February 11, 2021 16:04
-
-
Save nautilytics/cd2d4329333cfb8761c1ec867138f722 to your computer and use it in GitHub Desktop.
Create a GeoJSON of India from ne_10m_admin_0_countries
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
COPY | |
( | |
SELECT row_to_json(fc) AS json_out | |
FROM ( | |
SELECT 'FeatureCollection' AS type, | |
array_to_json(array_agg(f)) AS features | |
FROM ( | |
SELECT 'Feature' AS type, | |
st_asgeojson(st_transform(st_union(geom), 4326))::json AS geometry | |
FROM ne_10m_admin_0_countries | |
WHERE iso_a3 = 'IND' | |
GROUP BY iso_a3 ) f) fc ) TO '/Users/<user_name>/Desktop/india.json'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment