Criterion B Details

# Default ecosystem code for template development.
# This line is replaced by build_ecosystem_pages.py for each ecosystem.
ecosystem_code = 'FM1.2.1'

Import Python modules.

import os
import yaml
from pathlib import Path
from lonboard import Map
from rle_python_gee.ecosystems import Ecosystems
from rle_python_gee.eoo import make_eoo
from rle_python_gee.aoo import make_aoo_grid

Load the country config file.

project_root = os.environ.get('PIXI_PROJECT_ROOT', str(Path('..').resolve()))
config_path = Path(project_root) / 'config' / 'country_config.yaml'
with open(config_path) as f:
    config = yaml.safe_load(f)

Load & Filter Ecosystem Data

Load data for all the ecosystems.

source = config['ecosystem_source']
ecosystems = Ecosystems.from_file(
    source['data'],
    ecosystem_column=source['ecosystem_code_column'],
    ecosystem_name_column=source['ecosystem_name_column'],
    functional_group_column=source['functional_group_column']
)

Filter by the FM1.2.1 and check the number of features.

ecosystem = ecosystems.filter(ecosystem_code)
has_data = ecosystem.size() > 0
print(f'{ecosystem.size() = }')
if not has_data:
    from IPython.display import Markdown, display
    display(Markdown(
        f'**No spatial data found for {ecosystem_code}.** '
        f'Criterion B calculations are skipped.'
    ))
ecosystem.size() = 118

Extent of Occurrence (EOO) (subcriterion B1)

Extent of occurrence (EOO). The EOO of an ecosystem is the area (km2) of a minimum convex polygon – the smallest polygon in which no internal angle exceeds 180° that encompasses all known current spatial occurrences of the ecosystem type.

The minimum convex polygon (also known as a convex hull) must not exclude any areas, discontinuities or disjunctions, regardless of whether the ecosystem can occur in those areas or not. Regions such as oceans (for terrestrial ecosystems), land (for coastal or marine ecosystems), or areas outside the study area (such as in a different country) must remain included within the minimum convex polygon to ensure that this standardised method is comparable across ecosystem types. In addition, these features contribute to spreading risks across the distribution of the ecosystem by making different parts of its distribution more spatially independent.

Calculate EOO

Start by calculating the convex hull of the ecosystem’s distribution.

import geopandas as gpd

if has_data:
    ecosystem_geometry = ecosystem.geometry.union_all()
    gdf_ecosystem_polygons = gpd.GeoDataFrame(geometry=[ecosystem_geometry], crs=ecosystem.geometry.crs)
    hull = ecosystem_geometry.convex_hull
    gdf_hull = gpd.GeoDataFrame(geometry=[hull], crs=ecosystem.geometry.crs)

Display the ecosystem’s distribution and the convex hull.

from lonboard import Map, PolygonLayer
from rle_python_gee.viz import smart_map

if has_data:
    eoo_hull = make_eoo(ecosystem).compute()
    display(smart_map([eoo_hull, ecosystem]))
/home/runner/work/rle-tyler-20/rle-tyler-20/.pixi/envs/default/lib/python3.11/site-packages/lonboard/_geoarrow/ops/reproject.py:116: UserWarning: Input being reprojected to EPSG:4326 CRS.
Lonboard is only able to render data in EPSG:4326 projection.
  warnings.warn(
/home/runner/work/rle-tyler-20/rle-tyler-20/.pixi/envs/default/lib/python3.11/site-packages/lonboard/_geoarrow/ops/reproject.py:116: UserWarning: Input being reprojected to EPSG:4326 CRS.
Lonboard is only able to render data in EPSG:4326 projection.
  warnings.warn(
if has_data:
    hull_ea = gdf_hull.to_crs("ESRI:54034")
    eoo = hull_ea.geometry.iloc[0].area / 1e6
    print(f'EOO is {eoo:.1f} km2')
EOO is 167989.1 km2

Then calculate the area of the convex hull polygon.

Direct calculation of EOO

EOO can also be calculated directly using …

if has_data:
    ecosystem.eoo

Verify that the area returned by calling make_eoo(ecosystem).compute().area_km2 is the same as the area of the convex hull polygon.

if has_data:
    assert ecosystem.eoo == eoo

Area of Occupancy (AOO) (subcriterion B2)

The protocol for this adjustment includes the following steps:

  1. Intersect AOO grid with the ecosystem’s distribution map.
  2. Calculate extent of the ecosystem type in each grid cell (area) and sum these areas to obtain the total ecosystem area (total area).
  3. Arrange grid cells in ascending order based on their area (smaller first). Calculate accumulated sum of area per cell (cumulative area).
  4. Calculate cumulative proportion by dividing cumulative area by total area (cumulative proportion takes values between 0 and 1)
  5. Calculate AOO by counting the number of cells with a cumulative proportion greater than 0.01 (i.e. exclude cells that in combination account for up to 1% of the total mapped extent of the ecosystem type).

AOO Calculation Details

Intersect AOO grid and ecosystem map

  1. Intersect AOO grid with the ecosystem’s distribution map
from pathlib import Path
from rle_python_gee.aoo import make_aoo_grid_cached

if has_data:
    cache_path = Path(project_root) / '.cache' / 'aoo_grid.parquet'
    aoo_grid = make_aoo_grid_cached(ecosystems, cache_path=cache_path)
    aoo_grid_filtered = aoo_grid.filter_by_ecosystem(ecosystem_code)

Visualize variations in the AOO grid.

from matplotlib.colors import LinearSegmentedColormap
from lonboard.colormap import apply_continuous_cmap
from rle_python_gee.aoo import slugify_ecosystem_name

ecosystem_column = slugify_ecosystem_name(ecosystem_code)
if has_data:
    cmap = LinearSegmentedColormap.from_list("white_red", ["white", "red"])
    values = aoo_grid_filtered.grid_cells[ecosystem_column].values
    normalized = (values - values.min()) / (values.max() - values.min())
    colors = apply_continuous_cmap(normalized, cmap)
    display(smart_map([(aoo_grid_filtered, {"get_fill_color": colors}), ecosystem]))
/home/runner/work/rle-tyler-20/rle-tyler-20/.pixi/envs/default/lib/python3.11/site-packages/lonboard/_geoarrow/ops/reproject.py:116: UserWarning: Input being reprojected to EPSG:4326 CRS.
Lonboard is only able to render data in EPSG:4326 projection.
  warnings.warn(

Calculate grid cell area and total area

  1. Calculate extent of the ecosystem type in each grid cell (area) and sum these areas to obtain the total ecosystem area (total area).
if has_data:
    keep = ['geometry', 'grid_col', 'grid_row', ecosystem_column]
    gdf = aoo_grid_filtered.grid_cells[keep]
    display(gdf)
geometry grid_col grid_row FM1_2_1
0 POLYGON ((-77.43478 6.6162, -77.43478 6.70724,... -863 73 0.001647
1 POLYGON ((-77.43478 6.70724, -77.43478 6.79829... -863 74 0.001688
2 POLYGON ((-77.34495 6.6162, -77.34495 6.70724,... -862 73 0.000557
3 POLYGON ((-77.25511 0.36175, -77.25511 0.45219... -861 4 0.000505
4 POLYGON ((-76.80596 8.53173, -76.80596 8.62317... -856 94 0.044752
5 POLYGON ((-76.71613 8.44032, -76.71613 8.53173... -855 93 0.022322
6 POLYGON ((-76.71613 8.53173, -76.71613 8.62317... -855 94 0.057113
7 POLYGON ((-75.90764 9.35542, -75.90764 9.44706... -846 103 0.024071
8 POLYGON ((-75.81781 9.26381, -75.81781 9.35542... -845 102 0.086008
9 POLYGON ((-75.81781 9.35542, -75.81781 9.44706... -845 103 0.119280
10 POLYGON ((-75.72798 9.35542, -75.72798 9.44706... -844 103 0.063379
11 POLYGON ((-75.63815 9.6304, -75.63815 9.72211,... -843 106 0.011293
12 POLYGON ((-75.63815 9.72211, -75.63815 9.81384... -843 107 0.008378
13 POLYGON ((-75.54832 9.35542, -75.54832 9.44706... -842 103 0.021243
14 POLYGON ((-75.54832 9.6304, -75.54832 9.72211,... -842 106 0.014252
15 POLYGON ((-75.54832 9.81384, -75.54832 9.9056,... -842 108 0.003192
16 POLYGON ((-75.54832 9.9056, -75.54832 9.99738,... -842 109 0.002260
17 POLYGON ((-75.54832 9.99738, -75.54832 10.0891... -842 110 0.035258
18 POLYGON ((-75.54832 10.08919, -75.54832 10.181... -842 111 0.064693
19 POLYGON ((-75.54832 10.18102, -75.54832 10.272... -842 112 0.018072
20 POLYGON ((-75.45848 9.99738, -75.45848 10.0891... -841 110 0.091269
21 POLYGON ((-75.45848 10.08919, -75.45848 10.181... -841 111 0.029295
22 POLYGON ((-75.45848 10.36476, -75.45848 10.456... -841 114 0.163103
23 POLYGON ((-75.45848 10.45667, -75.45848 10.548... -841 115 0.070992
24 POLYGON ((-75.45848 10.54861, -75.45848 10.640... -841 116 0.003542
25 POLYGON ((-75.36865 10.64057, -75.36865 10.732... -840 117 0.044347
26 POLYGON ((-75.27882 10.64057, -75.27882 10.732... -839 117 0.045761
27 POLYGON ((-75.18899 10.64057, -75.18899 10.732... -838 117 0.075760
28 POLYGON ((-75.18899 10.73256, -75.18899 10.824... -838 118 0.092873
29 POLYGON ((-74.73983 10.91663, -74.73983 11.008... -833 120 0.048276
30 POLYGON ((-74.73983 11.0087, -74.73983 11.1008... -833 121 0.162663
31 POLYGON ((-74.65 10.91663, -74.65 11.0087, -74... -832 120 0.363704
32 POLYGON ((-74.65 11.0087, -74.65 11.1008, -74.... -832 121 0.198907
33 POLYGON ((-74.56017 10.54861, -74.56017 10.640... -831 116 0.001967
34 POLYGON ((-74.56017 10.64057, -74.56017 10.732... -831 117 0.089389
35 POLYGON ((-74.56017 10.73256, -74.56017 10.824... -831 118 0.520031
36 POLYGON ((-74.56017 10.82458, -74.56017 10.916... -831 119 0.526266
37 POLYGON ((-74.56017 10.91663, -74.56017 11.008... -831 120 0.859791
38 POLYGON ((-74.56017 11.0087, -74.56017 11.1008... -831 121 0.052180
39 POLYGON ((-74.47034 10.54861, -74.47034 10.640... -830 116 0.152588
40 POLYGON ((-74.47034 10.64057, -74.47034 10.732... -830 117 0.363212
41 POLYGON ((-74.47034 10.73256, -74.47034 10.824... -830 118 0.701252
42 POLYGON ((-74.47034 10.82458, -74.47034 10.916... -830 119 0.821747
43 POLYGON ((-74.47034 10.91663, -74.47034 11.008... -830 120 0.658818
44 POLYGON ((-74.38051 10.54861, -74.38051 10.640... -829 116 0.010663
45 POLYGON ((-74.38051 10.64057, -74.38051 10.732... -829 117 0.043383
46 POLYGON ((-74.38051 10.73256, -74.38051 10.824... -829 118 0.921582
47 POLYGON ((-74.38051 10.82458, -74.38051 10.916... -829 119 1.000000
48 POLYGON ((-74.38051 10.91663, -74.38051 11.008... -829 120 0.580106
49 POLYGON ((-74.29067 10.73256, -74.29067 10.824... -828 118 0.196165
50 POLYGON ((-74.29067 10.82458, -74.29067 10.916... -828 119 0.663676
51 POLYGON ((-74.29067 10.91663, -74.29067 11.008... -828 120 0.651738
52 POLYGON ((-74.20084 10.73256, -74.20084 10.824... -827 118 0.025147
53 POLYGON ((-74.20084 10.82458, -74.20084 10.916... -827 119 0.073626
54 POLYGON ((-74.20084 10.91663, -74.20084 11.008... -827 120 0.245530

The column FM1_2_1 contains the (fractional) area of the ecosystem in each grid cell.

Sum up the areas of each grid cell to get the total area.

if has_data:
    total_area = gdf[ecosystem_column].sum()
    display(total_area)
np.float64(11.149309448144923)

Calculate cumulative area

  1. Arrange grid cells in ascending order based on their area (smaller first). Calculate accumulated sum of area per cell (cumulative area).
if has_data:
    gdf = gdf.sort_values(by=ecosystem_column)
    gdf["cumulative_area"] = gdf[ecosystem_column].cumsum()
    display(gdf)
geometry grid_col grid_row FM1_2_1 cumulative_area
3 POLYGON ((-77.25511 0.36175, -77.25511 0.45219... -861 4 0.000505 0.000505
2 POLYGON ((-77.34495 6.6162, -77.34495 6.70724,... -862 73 0.000557 0.001062
0 POLYGON ((-77.43478 6.6162, -77.43478 6.70724,... -863 73 0.001647 0.002709
1 POLYGON ((-77.43478 6.70724, -77.43478 6.79829... -863 74 0.001688 0.004396
33 POLYGON ((-74.56017 10.54861, -74.56017 10.640... -831 116 0.001967 0.006363
16 POLYGON ((-75.54832 9.9056, -75.54832 9.99738,... -842 109 0.002260 0.008623
15 POLYGON ((-75.54832 9.81384, -75.54832 9.9056,... -842 108 0.003192 0.011815
24 POLYGON ((-75.45848 10.54861, -75.45848 10.640... -841 116 0.003542 0.015357
12 POLYGON ((-75.63815 9.72211, -75.63815 9.81384... -843 107 0.008378 0.023735
44 POLYGON ((-74.38051 10.54861, -74.38051 10.640... -829 116 0.010663 0.034398
11 POLYGON ((-75.63815 9.6304, -75.63815 9.72211,... -843 106 0.011293 0.045692
14 POLYGON ((-75.54832 9.6304, -75.54832 9.72211,... -842 106 0.014252 0.059943
19 POLYGON ((-75.54832 10.18102, -75.54832 10.272... -842 112 0.018072 0.078015
13 POLYGON ((-75.54832 9.35542, -75.54832 9.44706... -842 103 0.021243 0.099258
5 POLYGON ((-76.71613 8.44032, -76.71613 8.53173... -855 93 0.022322 0.121580
7 POLYGON ((-75.90764 9.35542, -75.90764 9.44706... -846 103 0.024071 0.145651
52 POLYGON ((-74.20084 10.73256, -74.20084 10.824... -827 118 0.025147 0.170798
21 POLYGON ((-75.45848 10.08919, -75.45848 10.181... -841 111 0.029295 0.200092
17 POLYGON ((-75.54832 9.99738, -75.54832 10.0891... -842 110 0.035258 0.235351
45 POLYGON ((-74.38051 10.64057, -74.38051 10.732... -829 117 0.043383 0.278733
25 POLYGON ((-75.36865 10.64057, -75.36865 10.732... -840 117 0.044347 0.323080
4 POLYGON ((-76.80596 8.53173, -76.80596 8.62317... -856 94 0.044752 0.367833
26 POLYGON ((-75.27882 10.64057, -75.27882 10.732... -839 117 0.045761 0.413593
29 POLYGON ((-74.73983 10.91663, -74.73983 11.008... -833 120 0.048276 0.461870
38 POLYGON ((-74.56017 11.0087, -74.56017 11.1008... -831 121 0.052180 0.514049
6 POLYGON ((-76.71613 8.53173, -76.71613 8.62317... -855 94 0.057113 0.571163
10 POLYGON ((-75.72798 9.35542, -75.72798 9.44706... -844 103 0.063379 0.634541
18 POLYGON ((-75.54832 10.08919, -75.54832 10.181... -842 111 0.064693 0.699234
23 POLYGON ((-75.45848 10.45667, -75.45848 10.548... -841 115 0.070992 0.770226
53 POLYGON ((-74.20084 10.82458, -74.20084 10.916... -827 119 0.073626 0.843852
27 POLYGON ((-75.18899 10.64057, -75.18899 10.732... -838 117 0.075760 0.919612
8 POLYGON ((-75.81781 9.26381, -75.81781 9.35542... -845 102 0.086008 1.005620
34 POLYGON ((-74.56017 10.64057, -74.56017 10.732... -831 117 0.089389 1.095008
20 POLYGON ((-75.45848 9.99738, -75.45848 10.0891... -841 110 0.091269 1.186278
28 POLYGON ((-75.18899 10.73256, -75.18899 10.824... -838 118 0.092873 1.279151
9 POLYGON ((-75.81781 9.35542, -75.81781 9.44706... -845 103 0.119280 1.398431
39 POLYGON ((-74.47034 10.54861, -74.47034 10.640... -830 116 0.152588 1.551019
30 POLYGON ((-74.73983 11.0087, -74.73983 11.1008... -833 121 0.162663 1.713682
22 POLYGON ((-75.45848 10.36476, -75.45848 10.456... -841 114 0.163103 1.876785
49 POLYGON ((-74.29067 10.73256, -74.29067 10.824... -828 118 0.196165 2.072950
32 POLYGON ((-74.65 11.0087, -74.65 11.1008, -74.... -832 121 0.198907 2.271857
54 POLYGON ((-74.20084 10.91663, -74.20084 11.008... -827 120 0.245530 2.517386
40 POLYGON ((-74.47034 10.64057, -74.47034 10.732... -830 117 0.363212 2.880598
31 POLYGON ((-74.65 10.91663, -74.65 11.0087, -74... -832 120 0.363704 3.244302
35 POLYGON ((-74.56017 10.73256, -74.56017 10.824... -831 118 0.520031 3.764333
36 POLYGON ((-74.56017 10.82458, -74.56017 10.916... -831 119 0.526266 4.290600
48 POLYGON ((-74.38051 10.91663, -74.38051 11.008... -829 120 0.580106 4.870706
51 POLYGON ((-74.29067 10.91663, -74.29067 11.008... -828 120 0.651738 5.522443
43 POLYGON ((-74.47034 10.91663, -74.47034 11.008... -830 120 0.658818 6.181261
50 POLYGON ((-74.29067 10.82458, -74.29067 10.916... -828 119 0.663676 6.844938
41 POLYGON ((-74.47034 10.73256, -74.47034 10.824... -830 118 0.701252 7.546189
42 POLYGON ((-74.47034 10.82458, -74.47034 10.916... -830 119 0.821747 8.367937
37 POLYGON ((-74.56017 10.91663, -74.56017 11.008... -831 120 0.859791 9.227728
46 POLYGON ((-74.38051 10.73256, -74.38051 10.824... -829 118 0.921582 10.149309
47 POLYGON ((-74.38051 10.82458, -74.38051 10.916... -829 119 1.000000 11.149309

Calculate cumulative proportion

  1. Calculate cumulative proportion by dividing cumulative area by total area (cumulative proportion takes values between 0 and 1)
if has_data:
    gdf["cumulative_proportion"] = gdf["cumulative_area"] / total_area
    display(gdf)
geometry grid_col grid_row FM1_2_1 cumulative_area cumulative_proportion
3 POLYGON ((-77.25511 0.36175, -77.25511 0.45219... -861 4 0.000505 0.000505 0.000045
2 POLYGON ((-77.34495 6.6162, -77.34495 6.70724,... -862 73 0.000557 0.001062 0.000095
0 POLYGON ((-77.43478 6.6162, -77.43478 6.70724,... -863 73 0.001647 0.002709 0.000243
1 POLYGON ((-77.43478 6.70724, -77.43478 6.79829... -863 74 0.001688 0.004396 0.000394
33 POLYGON ((-74.56017 10.54861, -74.56017 10.640... -831 116 0.001967 0.006363 0.000571
16 POLYGON ((-75.54832 9.9056, -75.54832 9.99738,... -842 109 0.002260 0.008623 0.000773
15 POLYGON ((-75.54832 9.81384, -75.54832 9.9056,... -842 108 0.003192 0.011815 0.001060
24 POLYGON ((-75.45848 10.54861, -75.45848 10.640... -841 116 0.003542 0.015357 0.001377
12 POLYGON ((-75.63815 9.72211, -75.63815 9.81384... -843 107 0.008378 0.023735 0.002129
44 POLYGON ((-74.38051 10.54861, -74.38051 10.640... -829 116 0.010663 0.034398 0.003085
11 POLYGON ((-75.63815 9.6304, -75.63815 9.72211,... -843 106 0.011293 0.045692 0.004098
14 POLYGON ((-75.54832 9.6304, -75.54832 9.72211,... -842 106 0.014252 0.059943 0.005376
19 POLYGON ((-75.54832 10.18102, -75.54832 10.272... -842 112 0.018072 0.078015 0.006997
13 POLYGON ((-75.54832 9.35542, -75.54832 9.44706... -842 103 0.021243 0.099258 0.008903
5 POLYGON ((-76.71613 8.44032, -76.71613 8.53173... -855 93 0.022322 0.121580 0.010905
7 POLYGON ((-75.90764 9.35542, -75.90764 9.44706... -846 103 0.024071 0.145651 0.013064
52 POLYGON ((-74.20084 10.73256, -74.20084 10.824... -827 118 0.025147 0.170798 0.015319
21 POLYGON ((-75.45848 10.08919, -75.45848 10.181... -841 111 0.029295 0.200092 0.017947
17 POLYGON ((-75.54832 9.99738, -75.54832 10.0891... -842 110 0.035258 0.235351 0.021109
45 POLYGON ((-74.38051 10.64057, -74.38051 10.732... -829 117 0.043383 0.278733 0.025000
25 POLYGON ((-75.36865 10.64057, -75.36865 10.732... -840 117 0.044347 0.323080 0.028978
4 POLYGON ((-76.80596 8.53173, -76.80596 8.62317... -856 94 0.044752 0.367833 0.032992
26 POLYGON ((-75.27882 10.64057, -75.27882 10.732... -839 117 0.045761 0.413593 0.037096
29 POLYGON ((-74.73983 10.91663, -74.73983 11.008... -833 120 0.048276 0.461870 0.041426
38 POLYGON ((-74.56017 11.0087, -74.56017 11.1008... -831 121 0.052180 0.514049 0.046106
6 POLYGON ((-76.71613 8.53173, -76.71613 8.62317... -855 94 0.057113 0.571163 0.051229
10 POLYGON ((-75.72798 9.35542, -75.72798 9.44706... -844 103 0.063379 0.634541 0.056913
18 POLYGON ((-75.54832 10.08919, -75.54832 10.181... -842 111 0.064693 0.699234 0.062715
23 POLYGON ((-75.45848 10.45667, -75.45848 10.548... -841 115 0.070992 0.770226 0.069083
53 POLYGON ((-74.20084 10.82458, -74.20084 10.916... -827 119 0.073626 0.843852 0.075686
27 POLYGON ((-75.18899 10.64057, -75.18899 10.732... -838 117 0.075760 0.919612 0.082482
8 POLYGON ((-75.81781 9.26381, -75.81781 9.35542... -845 102 0.086008 1.005620 0.090196
34 POLYGON ((-74.56017 10.64057, -74.56017 10.732... -831 117 0.089389 1.095008 0.098213
20 POLYGON ((-75.45848 9.99738, -75.45848 10.0891... -841 110 0.091269 1.186278 0.106399
28 POLYGON ((-75.18899 10.73256, -75.18899 10.824... -838 118 0.092873 1.279151 0.114729
9 POLYGON ((-75.81781 9.35542, -75.81781 9.44706... -845 103 0.119280 1.398431 0.125428
39 POLYGON ((-74.47034 10.54861, -74.47034 10.640... -830 116 0.152588 1.551019 0.139113
30 POLYGON ((-74.73983 11.0087, -74.73983 11.1008... -833 121 0.162663 1.713682 0.153703
22 POLYGON ((-75.45848 10.36476, -75.45848 10.456... -841 114 0.163103 1.876785 0.168332
49 POLYGON ((-74.29067 10.73256, -74.29067 10.824... -828 118 0.196165 2.072950 0.185926
32 POLYGON ((-74.65 11.0087, -74.65 11.1008, -74.... -832 121 0.198907 2.271857 0.203767
54 POLYGON ((-74.20084 10.91663, -74.20084 11.008... -827 120 0.245530 2.517386 0.225789
40 POLYGON ((-74.47034 10.64057, -74.47034 10.732... -830 117 0.363212 2.880598 0.258366
31 POLYGON ((-74.65 10.91663, -74.65 11.0087, -74... -832 120 0.363704 3.244302 0.290987
35 POLYGON ((-74.56017 10.73256, -74.56017 10.824... -831 118 0.520031 3.764333 0.337629
36 POLYGON ((-74.56017 10.82458, -74.56017 10.916... -831 119 0.526266 4.290600 0.384831
48 POLYGON ((-74.38051 10.91663, -74.38051 11.008... -829 120 0.580106 4.870706 0.436862
51 POLYGON ((-74.29067 10.91663, -74.29067 11.008... -828 120 0.651738 5.522443 0.495317
43 POLYGON ((-74.47034 10.91663, -74.47034 11.008... -830 120 0.658818 6.181261 0.554408
50 POLYGON ((-74.29067 10.82458, -74.29067 10.916... -828 119 0.663676 6.844938 0.613934
41 POLYGON ((-74.47034 10.73256, -74.47034 10.824... -830 118 0.701252 7.546189 0.676830
42 POLYGON ((-74.47034 10.82458, -74.47034 10.916... -830 119 0.821747 8.367937 0.750534
37 POLYGON ((-74.56017 10.91663, -74.56017 11.008... -831 120 0.859791 9.227728 0.827650
46 POLYGON ((-74.38051 10.73256, -74.38051 10.824... -829 118 0.921582 10.149309 0.910308
47 POLYGON ((-74.38051 10.82458, -74.38051 10.916... -829 119 1.000000 11.149309 1.000000

Count AOO cells

  1. Calculate AOO by counting the number of cells with a cumulative proportion greater than 0.01 (i.e. exclude cells that in combination account for up to 1% of the total mapped extent of the ecosystem type).
if has_data:
    aoo = len(gdf[gdf["cumulative_proportion"] > 0.01])
    print(f'AOO is {aoo} cells')
AOO is 41 cells

AOO Calculation (direct call)

if has_data:
    aoo_count = ecosystem.aoo
    print(f'AOO: {aoo_count} grid cells')
AOO: 41 grid cells
if has_data:
    display(smart_map([aoo_grid_filtered, ecosystem]))
/home/runner/work/rle-tyler-20/rle-tyler-20/.pixi/envs/default/lib/python3.11/site-packages/lonboard/_geoarrow/ops/reproject.py:116: UserWarning: Input being reprojected to EPSG:4326 CRS.
Lonboard is only able to render data in EPSG:4326 projection.
  warnings.warn(

Criterion B Summary

Ecosystem Code Ecosystem Name EOO AOO
FM1.2.1 INDEF 167989 km² 41 cells