Skip to content

Commit

Permalink
updated on 20200527 at 21:58:13
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamandrici committed May 27, 2020
1 parent 12f471e commit 90b99ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion processing/cep/cep_derived_indicators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ Protection Coverage

### Ecoregions statistics

Protection Coverage
Protection Coverage: [ecoregion protection coverage sql](./ecoregion_coverage.sql) to be manually executed. Fully commented.

### Protected areas statistics

Ecoregion Coverage





Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
WITH
-- current ecoregions
current_ecoregion AS (SELECT * FROM habitats_and_biotopes.ecoregions_2019),--this defines current attributes
-- raster total surface
a1 AS (SELECT ecoregion fid,SUM(a.sqkm) rtotsqkm FROM (SELECT UNNEST(eco) ecoregion,sqkm FROM cep.cep_last) a GROUP BY ecoregion ORDER BY ecoregion),
-- raster protected surface
a2 AS (SELECT ecoregion fid,SUM(a.sqkm) rprotsqkm FROM (SELECT UNNEST(eco) ecoregion,sqkm FROM cep.cep_last WHERE NOT (ARRAY[0] && pa)) a GROUP BY ecoregion ORDER BY ecoregion),
-- ecoregion attributes
b AS (SELECT first_level_code fid,first_level "name","source",sqkm FROM habitats_and_biotopes.ecoregions_2019 ORDER BY fid),
b AS (SELECT first_level_code fid,first_level "name","source",sqkm FROM current_ecoregion ORDER BY fid),
-- objects assigned to multiple ecoregions (by qid)
c AS (SELECT qid,eco,cardinality(eco) AS cardinality FROM cep.cep_last WHERE cardinality(eco) <> 1),
-- ecoregions assigned to multiple object (by ecoid)
Expand Down

0 comments on commit 90b99ae

Please sign in to comment.