Created
February 11, 2021 16:24
-
-
Save nautilytics/4b90c9bbb7b820be84eb3cb3ea0c9bab to your computer and use it in GitHub Desktop.
Create a GeoJSON of the Differences of the Countries Surrounding the Disputed India Boundary
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_Intersection(st_transform(a.geom, 4326), st_transform(b.geom, 4326)))::json AS geometry, | |
ROW_TO_JSON( | |
(SELECT l | |
FROM | |
(SELECT b.iso_a3 AS "ISO_A3", 'red' AS fill) AS l)) AS properties | |
FROM ne_10m_admin_0_countries b | |
JOIN india_boundary a ON ST_Intersects(a.geom, b.geom) | |
WHERE NOT ADMIN = 'India' | |
) f) fc ) TO '/Users/christopherlanoue/Desktop/india-surrounding-differences-w_o-full-countries.json'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment