Skip to content

Biodiversity & Protected Areas

Class Key params Returns Data source Description
KeyBiodiversityAreas country_code_iso3=None, worldpop_version=1 raster S3 WRI cities-indicators KBA GeoJSONs, rasterized Binary mask of pixels inside a Key Biodiversity Area.
ProtectedAreas status=[...], status_year=2024, iucn_cat=[...] vector GEE WCMC/WDPA/current/polygons Officially protected area polygons (WDPA), filtered by status/IUCN category.
SpeciesRichness taxon=GBIFTaxonClass.BIRDS, start_year=2019, end_year=2024, mask_layer=None vector (1-row) GBIF occurrence API (research-grade) Estimated species richness via species-accumulation curve extrapolation.

API

city_metrix.layers.key_biodiversity_areas.KeyBiodiversityAreas

KeyBiodiversityAreas(country_code_iso3=None, worldpop_version=1, **kwargs)

Bases: Layer

OUTPUT_FILE_FORMAT class-attribute instance-attribute

OUTPUT_FILE_FORMAT = GTIFF_FILE_EXTENSION

MAJOR_NAMING_ATTS class-attribute instance-attribute

MAJOR_NAMING_ATTS = ['country_code_iso3']

MINOR_NAMING_ATTS class-attribute instance-attribute

MINOR_NAMING_ATTS = ['worldpop_version']

Attributes: country_code_iso3 must be one of the countries currently supported in Cities Data (plus USA for testing)

country_code_iso3 instance-attribute

country_code_iso3 = country_code_iso3

worldpop_version instance-attribute

worldpop_version = worldpop_version

get_data

get_data(bbox: GeoExtent, spatial_resolution=None, resampling_method=None, force_data_refresh=False)

city_metrix.layers.protected_areas.ProtectedAreas

ProtectedAreas(status=['Inscribed', 'Adopted', 'Designated', 'Established'], status_year=2024, iucn_cat=['Ia', 'Ib', 'II', 'III', 'IV', 'V', 'VI', 'Not Applicable', 'Not Assigned', 'Not Reported'], **kwargs)

Bases: Layer

OUTPUT_FILE_FORMAT class-attribute instance-attribute

OUTPUT_FILE_FORMAT = GEOJSON_FILE_EXTENSION

MAJOR_NAMING_ATTS class-attribute instance-attribute

MAJOR_NAMING_ATTS = None

MINOR_NAMING_ATTS class-attribute instance-attribute

MINOR_NAMING_ATTS = ['status_year', 'status', 'iucn_cat']

Attributes: status: Proposed, Inscribed, Adopted, Designated, or Established status_year: integer, year when status was set iucn_cat: IUCN management category, one of: Ia (strict nature reserve), Ib (wilderness area), II (national park), III (natural monument or feature), IV (habitat/species management area), V (protected landscape/seascape), VI (PA with sustainable use of natural resources), Not Applicable, Not Assigned, or Not Reported.

status instance-attribute

status = status

status_year instance-attribute

status_year = status_year

iucn_cat instance-attribute

iucn_cat = iucn_cat

get_data

get_data(bbox: GeoExtent, spatial_resolution=None, resampling_method=None, force_data_refresh=False)

city_metrix.layers.species_richness.GBIFTaxonClass

Bases: Enum

VASCULAR_PLANTS class-attribute instance-attribute

VASCULAR_PLANTS = {'taxon': 'Tracheophyta', 'taxon_key': 7707728}

ARTHROPODS class-attribute instance-attribute

ARTHROPODS = {'taxon': 'Arthropoda', 'taxon_key': 54}

BIRDS class-attribute instance-attribute

BIRDS = {'taxon': 'Aves', 'taxon_key': 212}

city_metrix.layers.species_richness.SpeciesRichness

SpeciesRichness(taxon=GBIFTaxonClass.BIRDS, start_year=2019, end_year=2024, mask_layer=None, **kwargs)

Bases: Layer

Layer for estimating species richness using GBIF/iNaturalist data.

Attributes: taxon: Enum value from GBIFTaxonClass start_year, end_year: years used for data retrieval mask_layer: Optional mask to filter valid regions

OUTPUT_FILE_FORMAT class-attribute instance-attribute

OUTPUT_FILE_FORMAT = GEOJSON_FILE_EXTENSION

MAJOR_NAMING_ATTS class-attribute instance-attribute

MAJOR_NAMING_ATTS = ['taxon']

MINOR_NAMING_ATTS class-attribute instance-attribute

MINOR_NAMING_ATTS = ['start_year', 'end_year']

API_URL class-attribute instance-attribute

API_URL = 'https://api.gbif.org/v1/occurrence/search/'

DATASETKEY class-attribute instance-attribute

DATASETKEY = '50c9509d-22c7-4a22-a47d-8c48425ef4a7'

LIMIT class-attribute instance-attribute

LIMIT = 300

NUM_CURVEFITS class-attribute instance-attribute

NUM_CURVEFITS = 200

taxon instance-attribute

taxon = taxon

start_year instance-attribute

start_year = start_year

end_year instance-attribute

end_year = end_year

mask_layer instance-attribute

mask_layer = mask_layer

get_data

get_data(bbox: GeoExtent, spatial_resolution=None, resampling_method=None, allow_cache_retrieval=False)