Riverscapes / riverscapes-tools

Open-source Python 3.0 tools for the Riverscapes organization
https://tools.riverscapes.net/
GNU General Public License v3.0
10 stars 8 forks source link

Summarize RME area processed by state #1022

Closed philipbaileynar closed 6 days ago

philipbaileynar commented 6 days ago

Going to close this straight away... Just wanted to put this SQL somewhere safe.

This is the SQL I used to calculate the area of RME that we have processed by US state.

select us.state_abbr, processed_acres, total_acres, 100 * processed_acres / total_acres processed_percent
from (select state_abbr, sum(area) / 4046.85642 total_acres from us_states_5070_geom us group by state_abbr) us
         inner join (select state_abbr, sum(area) / 4046.85642 processed_acres
                    from rme_complete_5070_fixed_geom us
                    group by state_abbr) rme on us.state_abbr = rme.state_abbr;

I used EPSG5070 for this exercise.