Created
June 4, 2013 18:24
-
-
Save andybega/5708247 to your computer and use it in GitHub Desktop.
My first real SQL query in PostGIS. It subsets the geo-referenced ethnic groups (GREG) data to only groups that are present in Afghanistan (instead of including hundreds of groups for the entire world).
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
CREATE TABLE afg_greg AS | |
SELECT * | |
FROM greg | |
WHERE ( ST_contains((SELECT the_geom FROM afg_adm0), geom) OR | |
ST_overlaps((SELECT the_geom FROM afg_adm0), geom) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment