Created
April 17, 2022 16:27
-
-
Save rchardptrsn/ca587cf8ec2a801c2d8eda88f330db51 to your computer and use it in GitHub Desktop.
create temp table from spatial join
This file contains hidden or 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 TEMP TABLE fracking AS | |
SELECT f.name, f.operator, f.status, f.type, co.county | |
FROM fractracker f | |
JOIN co_counties co | |
ON ST_COVEREDBY(f.geom, co.geom); | |
-- query on TEMP TABLE to find count per county | |
SELECT county, COUNT(county) well_count | |
FROM fracking | |
GROUP BY county | |
ORDER BY well_count desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment