Skip to content

Commit

Permalink
Merge pull request #252 from unepwcmc/develop
Browse files Browse the repository at this point in the history
statistics update for Nov 2023
  • Loading branch information
IMDaniyal authored Nov 10, 2023
2 parents 8ab7078 + 95dd393 commit ee4f77f
Show file tree
Hide file tree
Showing 10 changed files with 797 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ coverage
/TAGS

.directory

/vendor/bundle
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.4.9

* Update global and country habitat stats for 2023-11 period.

## 1.4.8

* Update global and country habitat stats for 2023-07 period.
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,24 @@ To lint your factories, run `rake factory_bot:lint`

The current procedure for updating statistics is as follows:

* Obtain the global and country statistics from the Ocean Plus Habitats team.
* Obtain the global and country statistics from the Ocean Plus Habitats team (There will be 2 types of files for each habitat type i.e., one for country and one global such as Seagrass_country.csv).
* Ensure the country statistics CSVs conform to the format: `<habitat-type><plural-modifier>_country_output_<YYYY>-<MM>-01.csv`.
I.e. ensure that the match the current format within `lib/data/habitat_coverage_protection/country/*.csv`.
For example, for the Seagrass habitat you will be given Seagrass_country.csv you would need to rename it to seagrasses_country_output_<YYYY>-<MM>-01.csv

:sos:

###### If received over Slack, you can quickly save to the simplest location on disk possible (as there is currently no "download all") and then move all by command line e.g. `mv ~/Desktop/*country*01-01.csv lib/data/habitat_coverage_protection/country/`.

* In each CSV, check that the columns are correct and that the data format appears to be the same according to previous months.
Most commonly, you will need to rename `"iso3"` to `"iso3"` as the ISO column in each CSV.
* In each new country CSV, check that the columns are correct and that the data format appears to be the same according to previous months.
Most commonly, you will need to rename `"country"` to `"iso3"` as the ISO column in each CSV.

As of writing, the global statistics needs to be copied in from each CSV provided into the corresponding habitat within `config/habitats.yml`.
Previously, this data would have been calculated automatically based on the country statistics. But due to inaccuracies
caused (perhaps) by borders and non-national areas not being included within the counts, we currently depend on the data
being made available in the habitats YAML file.

* Copy in the `total_area` and `protected_area` from each CSV into each habitat in `config/habitats.yml`.
* Copy in the `total_area` and `protected_area` from each global CSV (Such as Seagrass_global.csv) into each habitat in `config/habitats.yml`.

* Finally, update the `CHANGELOG.md` with a minor version increment e.g. `1.3.4` -> `1.3.5`. Add a suitable line within
the file to describe changes that have been applied in this release. Be sure to check whether any commits have since
Expand Down
20 changes: 10 additions & 10 deletions config/habitats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,41 @@ habitats:
poly_table: 'wcmc008_coralreef2010_py_v4'
point_table: 'wcmc008_coralreef2010_pt_v4'
wms_url: 'https://gis.unep-wcmc.org/arcgis/rest/services/marine/WCMC_008_CoralReefs_WMS/MapServer/export?transparent=true&format=png32&bbox={bbox-epsg-3857}&bboxSR=EPSG:3857&imageSR=EPSG:3857&size=256,256&f=image'
total_area: 149887.00602318588
protected_area: 59048.58808924451
total_area: 149887.006023024
protected_area: 59060.350315439
saltmarshes:
name: 'saltmarshes'
title: 'Saltmarshes'
theme: 'green'
poly_table: 'wcmc027_saltmarshes_py_v6'
point_table: 'wcmc027_saltmarshes_pt_v6'
wms_url: 'https://gis.unep-wcmc.org/arcgis/rest/services/marine/WCMC_027_Saltmarsh_WMS/MapServer/export?transparent=true&format=png32&bbox={bbox-epsg-3857}&bboxSR=EPSG:3857&imageSR=EPSG:3857&size=256,256&f=image'
total_area: 224435.08671777754
protected_area: 111448.83385231806
total_area: 224435.086718921
protected_area: 111729.682419654
mangroves:
name: 'mangroves'
title: 'Mangroves'
theme: 'yellow'
poly_table: 'wcmc011_atlasmangrove2010_py_v3'
point_table:
wms_url: 'https://gis.unep-wcmc.org/arcgis/rest/services/marine/WCMC_011_WorldAtlasMangroves_WMS/MapServer/export?transparent=true&format=png32&bbox={bbox-epsg-3857}&bboxSR=EPSG:3857&imageSR=EPSG:3857&size=256,256&f=image'
total_area: 145690.86258473454
protected_area: 58190.30073525994
total_area: 145690.862584734
protected_area: 58289.8799881305
seagrasses:
name: 'seagrasses'
title: 'Seagrasses'
theme: 'blue'
poly_table: 'wcmc_013_014_seagrassespy_v6'
point_table: 'wcmc_013_014_seagrassespt_v6'
wms_url: 'https://gis.unep-wcmc.org/arcgis/rest/services/marine/WCMC_013_014_Seagrass_WMS/MapServer/export?transparent=true&format=png32&bbox={bbox-epsg-3857}&bboxSR=EPSG:3857&imageSR=EPSG:3857&size=256,256&f=image'
total_area: 321681.6803360866
protected_area: 77611.15419283173
total_area: 321681.489675504
protected_area: 77743.4899683079
coldcorals:
name: 'coldcorals'
title: 'Cold-water corals'
theme: 'pink'
poly_table: 'wcmc001_coldcorals2017_py_v5'
point_table: 'wcmc001_coldcorals2017_pt_v5'
wms_url: 'https://gis.unep-wcmc.org/arcgis/rest/services/marine/WCMC_001_ColdCorals2017_WMS/MapServer/export?transparent=true&format=png32&bbox={bbox-epsg-3857}&bboxSR=EPSG:3857&imageSR=EPSG:3857&size=256,256&f=image'
total_area: 15335.16715418157
protected_area: 4183.125417260921
total_area: 15335.1671541816
protected_area: 4192.9801760175
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
iso3,total_area,protected_area,percent_protected
ABNJ,1873.7177273202005,320.6197588962698,17.11142261298993
ABW,3.5489363135378773,0.0,0.0
AGO,3.3957705381855146,0.0,0.0
AIA,3.3837592056320918,0.0,0.0
ALB,5.9866916811037045,0.0,0.0
ARG,61.82852730626974,6.984473589267755,11.296522646690134
ASM,0.9984762212467504,0.0,0.0
ATA,18.935034189334523,5.419337752508409,28.620691667728504
ATF,14.319754921529706,14.319754921529706,100.0
ATG,0.9977819550249165,0.0,0.0
AUS,333.43951105970643,122.41855346199155,36.713871452405954
BEN,0.9977819136826168,0.0,0.0
BES,9.611173575041004,9.611173575041004,100.0
BHS,412.77598177309,32.613330579376004,7.900975836647421
BLM,0.997781927543084,0.997781927543084,100.0
BLZ,2.9933457956211695,1.995563863276511,66.66666665093392
BMU,26.39903293652263,0.0,0.0
BRA,233.17334608564835,1.9955638580648243,0.8558284604844248
BRB,6.379919950121969,0.0,0.0
CAN,204.28760178877934,29.40293660259849,14.392912905698163
CHL,86.86105669451882,46.236798327638304,53.23075735798179
CHN,0.9977819487052932,0.0,0.0
CIV,9.977819345465567,0.0,0.0
COK,2.3826790428843605,2.3826790428843605,100.0
COL,57.14742884714409,13.006806017068302,22.760089612882574
CPV,34.31626461171713,0.0,0.0
CRI,8.980037309457495,2.9933458229253938,33.33333392471427
CUB,56.279727927623775,0.0,0.0
CUW,4.988909640429588,0.0,0.0
CYM,1.9955638765052153,0.0,0.0
CYP,0.9981373746226947,0.0,0.0
DMA,7.365405498792133,0.0,0.0
DNK,2.993764830394916,0.0,0.0
DOM,20.070809253148195,17.43240849282978,86.8545372185002
DZA,2.5291194531432604,0.0,0.0
ECU,53.62723299290079,50.63388715548906,94.41823553005618
ERI,2.7458720758686495,0.0,0.0
ESP,1469.0931987860808,1257.6286937537022,85.60578013654187
FJI,2.9933458467307847,0.0,0.0
FRA,239.9038773722686,178.918468280804,74.57923158247624
FRO,287.55737507551225,0.0,0.0
FSM,1.9955638294317926,0.0,0.0
GBR,360.6223395525168,87.04463595445158,24.137338818904595
GHA,7.615791507884201,0.0,0.0
GIN,0.9981819845049886,0.9981819845049886,100.0
GLP,9.195072844504477,9.170160788166008,99.72907168045595
GNB,0.9977819760308732,0.0,0.0
GNQ,4.397738886740219,3.2601734853193656,74.13294807359372
GRC,17.060624739510015,0.9977819186452773,5.848448892581022
GRD,14.96552348907311,0.27828746247279595,1.8595237425271762
GRL,18.332575025240633,0.0,0.0
GTM,0.9977819299042725,0.0,0.0
GUF,5.986691636663096,0.0,0.0
GUY,15.455887059255623,0.0,0.0
HMD,1.995563845829504,0.9977819029310011,49.99999899859125
HND,12.384872443765689,0.997781953190164,8.056457244276494
HRV,72.38543879487888,0.9977819327190921,1.3784290726571973
HTI,3.9911277788249344,0.0,0.0
IDN,144.2600866336678,1.9955638423025226,1.3833097489883195
IND,10.975601403923086,0.0,0.0
IRL,474.3814586327239,187.91921891858692,39.61352525459431
ISL,528.3651495436322,316.8678478466978,59.971375500520395
ITA,166.13409978908095,48.93932071020497,29.457721667217573
JAM,20.597871101224065,0.9977819390756885,4.844102257812428
JPN,95.20378565027627,9.599247289931387,10.082842005036941
KEN,3.9911277017246602,0.0,0.0
KIR,1.9955639126738562,0.0,0.0
KNA,6.5113279362990575,0.0,0.0
LBR,6.933860801875532,0.0,0.0
LCA,12.384803268975064,1.761208863159796,14.220725391510793
LKA,3.9911277852404856,0.0,0.0
MAR,152.07398354788404,0.0,0.0
MDG,9.374370780023018,0.9977819247864043,10.643721570227397
MEX,117.74237369547171,45.99564363125614,39.06464783037162
MHL,8.98003749361563,0.0,0.0
MLT,4.34724423616734,3.337980434692657,76.78382564572723
MMR,5.986691621615517,0.0,0.0
MNE,1.9955639569078092,0.0,0.0
MOZ,11.97338343020944,0.0,0.0
MRT,39.62161159662208,0.0,0.0
MSR,6.969981091220023,0.0,0.0
MTQ,6.547047313442882,6.547047311298974,99.99999996725381
MUS,0.9977819274357467,0.0,0.0
MYS,7.471920383236969,0.0,0.0
NAM,1.9955639066018582,0.0,0.0
NCL,69.60114522077166,61.64722490767424,88.5721416107911
NFK,41.78853865650521,41.69673250160867,99.78030781202672
NGA,9.19180648643246,0.0,0.0
NIC,5.4981863051584225,0.42257383221799366,7.685695041318135
NOR,3017.0553003647137,240.37314716937829,7.967144226369369
NZL,831.0969692279239,236.7748392637048,28.489436014147053
OMN,4.9889096818539445,0.0,0.0
PAN,32.92680385367623,0.12107466832520045,0.3677085357669254
PER,8.980037546911117,0.9977819443413564,11.111111051919439
PHL,174.3579603467947,7.144163088131265,4.097411482631283
PLW,3.2425315042882232,3.2425315042882237,100.00000000000003
PNG,1.9955638702484575,0.0,0.0
PRI,33.81578221618871,6.4717716857539624,19.138317263753006
PRT,369.80496657697216,105.47404750473825,28.52153352104443
RUS,17.948906218106874,0.0,0.0
SAU,6.98447364521704,0.0,0.0
SEN,4.193878985840989,0.0,0.0
SGS,1.1510947897075685,0.11610919788362715,10.08684939952897
SHN,14.365178505251604,8.283886048932771,57.666433075679215
SJM,2.9933458356720593,0.0,0.0
SOM,8.980037462859446,0.0,0.0
SPM,2.9933458679453278,0.0,0.0
STP,0.9977819650855877,0.0,0.0
SUR,34.42374041262175,0.0,0.0
SWE,31.053846159550474,19.36961393512966,62.37428315839267
SYC,3.445712481649176,0.0,0.0
TCA,2.99334580224527,0.0,0.0
THA,3.9911277709803312,0.0,0.0
TLS,6.035162450650015,0.0,0.0
TON,1.995563871771799,0.0,0.0
TTO,14.010479358837777,0.0,0.0
TUN,11.252984304462988,0.0,0.0
TUV,0.9977819636963793,0.0,0.0
TWN,4.12533131113959,0.0,0.0
UMI,9.388182863676938,9.388182863676938,100.0
URY,22.22263302328826,0.0,0.0
USA,2137.31035658978,398.4369171760014,18.641977565286016
VCT,10.273117939285749,0.0,0.0
VEN,68.05729420557905,1.9955639162569005,2.932182273113809
VGB,7.982293069964635,0.0,0.0
VIR,7.982255504548303,0.04248770948914524,0.5322769919471466
VNM,1.3186708390574422,0.0,0.0
VUT,18.10153847349926,0.0,0.0
WLF,33.113367798363086,0.0,0.0
WSM,1.9955638143651835,0.0,0.0
YEM,0.9977819187575693,0.0,0.0
ZAF,44.62201090444775,25.22056114531606,56.52044951385678
DPT,220.3669274055397,180.4483835989626,81.8854197966307
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
iso3,total_area,protected_area,percent_protected
ABW,66.52574334127935,0.49424907181423244,0.7429440799762548
AIA,24.333790339795488,11.061888408326782,45.458961607950435
ARE,126.75742600755113,59.99761087490683,47.332620079657254
ASM,45.15909042041572,12.87310815005171,28.506128069027664
ATF,104.55465683870095,16.63068479405613,15.906211446624226
ATG,54.89462880457145,34.032086159817034,61.995293348231826
AUS,31720.32718306621,27425.283542921876,86.45964899618933
BES,200.08751301122163,197.64607661457885,98.77981571168519
BGD,4.530974409911617,0.0,0.0
BHR,207.79037187877657,121.91995588592471,58.6744971788452
BHS,2226.5234433082846,359.0522019090076,16.12613615132249
BLM,10.71307865732701,10.608337520553464,99.02230591108457
BLZ,894.5724436780819,368.99983003928435,41.248736493840795
BMU,528.9152953987899,0.14305569664298126,0.02704699559409046
BRA,697.5084628464472,633.5378210650583,90.82869309996148
BRB,31.222700321200605,0.28462515641465885,0.9115968621759304
BRN,62.73609394858926,0.0,0.0
CCK,115.15279640568365,7.118533195607167,6.181815307835473
CHN,577.9761278820785,0.027174142170944552,0.00470160286213218
COK,253.26791817121992,110.19062096746212,43.50753216716875
COL,934.9776318818261,871.8957458939174,93.25311281929342
COM,218.9769921105796,130.27077307749184,59.49062128486419
CRI,69.85698110100031,24.502651966384303,35.075452131202155
CUB,2649.281413026542,741.759521500818,27.998517554744446
CUW,38.67322699015488,5.416876376176303,14.006786600857716
CXR,5.034412331896763,0.6699767110851547,13.307942753126351
CYM,136.70345408134514,51.39597986935134,37.596694403031144
DJI,247.310877423655,0.0,0.0
DMA,16.358963340543166,0.7270079632900999,4.44409555884463
DOM,350.60497640508447,229.4714769283875,65.4501482783459
ECU,125.4135685740079,125.4135685740079,100.0
EGY,2207.801031141701,1158.296274357484,52.46379805151664
ERI,1583.1875828874865,0.0,0.0
FJI,3366.671287438954,1172.4901898517364,34.826393483269236
FSM,3172.7537503620806,0.0,0.0
GLP,113.33177213282379,111.92196408764705,98.75603458884906
GRD,45.77989009051002,2.994566045876158,6.541225939939332
GTM,7.063370181810658,5.086827733490295,72.01700608287123
GUM,136.86836873582672,9.50685509097762,6.945984071255393
HND,717.9162224370284,243.94614949335752,33.97975165754875
HTI,325.60271929185234,114.1214959255253,35.049306766763536
IDN,20103.48160222032,3200.0337434732405,15.917808699960778
IND,2035.405325283069,0.0,0.0
IRN,117.52499627483158,1.7228963459107516,1.4659828976992841
ISR,1.0414204882536482,0.7245948708765373,69.5775509555805
JAM,412.6811251059203,76.19439735648693,18.463262000880363
JOR,2.8607043246599693,0.319393215376903,11.164845406204883
JPN,1038.5806342238413,769.8847226734417,74.12854595048336
KEN,405.1927053571919,119.26470477698076,29.434070061020627
KHM,47.463692662868446,8.036414293092124,16.931708938396888
KIR,1960.044500848155,72.81001928193325,3.7147125613947405
KNA,41.82074854873749,0.0,0.0
KWT,72.74552158347085,0.0,0.0
LCA,29.475816406509892,3.7440410726046123,12.702077598019374
LKA,108.90397173338692,0.9892049363296586,0.9083276951104952
MAF,6.210131709812069,6.186231383349951,99.61513978158699
MDG,2401.192627532065,818.0734325077623,34.069462946359884
MDV,2696.112214723826,119.53934396904023,4.433767382389354
MEX,1560.5058869161649,1089.2487423913742,69.80100181127301
MHL,1991.5338335542233,358.4655151009012,17.999469005312346
MMR,606.8330996681176,38.033392091336246,6.267521022194908
MNP,81.4012004902518,6.742555001952817,8.283114943446408
MOZ,1675.0552502526766,156.92854977655563,9.368559619325003
MSR,2.423375783096336,0.0,0.0
MTQ,72.00618166082369,71.84219578514188,99.77226139214793
MUS,2551.109184872324,1839.1713685278683,72.09300877570686
MYS,2147.975894874664,65.33882742271993,3.0418789884293607
MYT,3.990298610527118,3.411375194906553,85.49172700776676
NCL,4574.815510640366,3618.373448476945,79.09331950241769
NIC,460.09638148850155,280.5298721849184,60.97197967029203
NIU,15.381856342028044,0.37972877478953904,2.4686797636511613
NRU,5.9154310117242135,0.0,0.0
OMN,266.19150054595286,54.353643159404015,20.419000249040973
PAN,630.5289309805049,68.3134741982274,10.83431240688614
PCN,39.40428572947964,35.36326982700377,89.7447299762811
PHL,13441.321221752207,2127.530555980714,15.828284443777093
PLW,506.39938450148173,504.58819216732456,99.64233915174677
PNG,7292.80777959616,297.1703485691125,4.074841371803829
PRI,158.13999980324064,33.66839273686355,21.29024457996339
PYF,3004.1808256689533,4.077394182079282,0.13572399328430412
QAT,155.3617998002534,0.5677542091234108,0.36544003085273524
REU,12.123152691834154,10.148626729388782,83.71276834799448
SAU,3415.2468899222768,438.95154133863775,12.852703054467234
SDN,706.6933382796577,215.09290860873637,30.436526985290225
SGP,3.8504992524289867,0.0,0.0
SLB,2803.6837073085276,144.4684626172593,5.152808865018006
SOM,398.67982279353123,0.0,0.0
SXM,1.6981884431816758,0.014465755356661907,0.851834518998333
SYC,1493.6110553707329,1402.4911813198833,93.89935728426752
TCA,191.62565700370033,16.94974468068311,8.845237608425165
THA,183.97268317946296,116.05194151871135,63.08107242503181
TKL,96.57210193165062,0.0,0.0
TLS,35.04405281104145,9.498752869335144,27.105177932908315
TON,992.0450510303411,164.60043729963246,16.592032501818128
TTO,32.02584825063897,4.995227869480552,15.597488098947975
TUV,885.565367119753,66.24503464187521,7.48053583637006
TWN,375.174086685729,193.21825567170868,51.50095982869981
TZA,1819.322314772502,685.1468753427627,37.65945537959485
UMI,171.3611773938962,171.3611773938962,100.0
USA,4090.7906779018963,3574.6641745215366,87.38320916373377
VCT,38.36967795943739,18.742066983015324,48.84603671375233
VEN,344.8588528440778,186.45053149296197,54.06575181564571
VGB,137.28867323009132,0.6172444815533248,0.4495960715701894
VIR,33.36445671750513,11.653230766913216,34.927080832097545
VNM,478.14661590094545,105.45405280026931,22.054752515934474
VUT,706.9345379253534,2.4094102003855227,0.3408250794276424
WLF,411.1630353998213,0.0,0.0
WSM,199.99594300787012,20.073211656277522,10.03680942442298
YEM,656.0890307547116,1.6557893697723065,0.2523726647079621
ZAF,1.398813345061877,1.398813345061877,100.0
xPI,0.9222265880019235,0.0,0.0
xSI,0.5639401017337318,0.0,0.0
xSK,0.14362494735942083,0.0,0.0
xSR,45.93171463977536,0.0,0.0
DPT,2011.3486326181699,1276.5861161295463,63.46916170707889
Loading

0 comments on commit ee4f77f

Please sign in to comment.