All Projects → prioritizr → wdpar

prioritizr / wdpar

Licence: other
Interface to the World Database on Protected Areas

Programming Languages

r
7636 projects
Makefile
30231 projects

Projects that are alternatives of or similar to wdpar

OZtree
OneZoom Tree of Life Explorer
Stars: ✭ 53 (+96.3%)
Mutual labels:  conservation, biodiversity
rredlist
IUCN Red List API Client
Stars: ✭ 31 (+14.81%)
Mutual labels:  conservation, biodiversity
bookvis
Sources of the book "Displaying time series, spatial and space-time data with R" (2nd Edition)
Stars: ✭ 52 (+92.59%)
Mutual labels:  spatial
rafagas
Daily geospatial links curated by Raf Roset
Stars: ✭ 17 (-37.04%)
Mutual labels:  biodiversity
delaunator-rs
Fast 2D Delaunay triangulation in Rust. A port of Delaunator.
Stars: ✭ 115 (+325.93%)
Mutual labels:  spatial
general
The Catalogue of Life
Stars: ✭ 39 (+44.44%)
Mutual labels:  biodiversity
GeoJSON4EntityFramework
Create GeoJSON from Entity Framework Spatial Data or WKT
Stars: ✭ 18 (-33.33%)
Mutual labels:  spatial
awesome-forests
🌳 A curated list of ground-truth forest datasets for the machine learning and forestry community.
Stars: ✭ 111 (+311.11%)
Mutual labels:  biodiversity
impact-tools
Simple blueprints for change-makers
Stars: ✭ 34 (+25.93%)
Mutual labels:  spatial
geojson
GeoJSON classes for R
Stars: ✭ 32 (+18.52%)
Mutual labels:  spatial
GeoJSON.Net.Contrib
Repository for all GeoJSON.Net *.Contrib projects
Stars: ✭ 31 (+14.81%)
Mutual labels:  spatial
geometa
R tools to write, read & validate geographic metadata (OGC/ISO 19110, 19115, 19119, 19136 and 19139)
Stars: ✭ 37 (+37.04%)
Mutual labels:  spatial
CAST
Developer Version of the R package CAST: Caret Applications for Spatio-Temporal models
Stars: ✭ 65 (+140.74%)
Mutual labels:  spatial
gnparser
GNparser normalises scientific names and extracts their semantic elements.
Stars: ✭ 26 (-3.7%)
Mutual labels:  biodiversity
mapr
Map species occurrence data
Stars: ✭ 34 (+25.93%)
Mutual labels:  biodiversity
trends.earth
trends.earth - measure land change
Stars: ✭ 69 (+155.56%)
Mutual labels:  conservation
R-Geospatial-Fundamentals
This is the repository for D-Lab's Geospatial Fundamentals in R with sf workshop.
Stars: ✭ 42 (+55.56%)
Mutual labels:  spatial
ows4R
R Interface for OGC Web-Services (OWS)
Stars: ✭ 29 (+7.41%)
Mutual labels:  spatial
laravel-eloquent-spatial
Laravel Eloquent spatial package.
Stars: ✭ 90 (+233.33%)
Mutual labels:  spatial
scanstatistics
An R package for space-time anomaly detection using scan statistics.
Stars: ✭ 41 (+51.85%)
Mutual labels:  spatial

wdpar: Interface to the World Database on Protected Areas

lifecycle R-CMD-check-Ubuntu R-CMD-check-Windows R-CMD-check-Mac-OSX Coverage Status CRAN_Status_Badge

Overview

Protected Planet provides the most comprehensive data for conservation areas worldwide. Specifically, it provides the World Database on Protected Areas (WDPA) and the World Database on Other Effective Area-Based Conservation Measures (WDOECM). These databases are used to monitor the performance of existing protected areas, and identify priority areas for future conservation efforts. Additionally, these databases receive monthly updates from government agencies and non-governmental organizations. However, they are associated with several issues that need to be addressed prior to analysis and the dynamic nature of these databases means that the entire data cleaning process needs to be repeated after obtaining a new version.

The wdpar R package provides an interface to data provided by Protected Planet. Specifically, the package can automatically data from the World Database on Protected Areas (WDPA) and the World Database on Other Effective Area-Based Conservation Measures (WDOECM). It also provides methods for cleaning data from these databases following best practices (outlined in Butchart et al. 2015; Protected Planet 2021; Runge et al. 2015). The main functions are wdpa_fetch() for downloading data and wdpa_clean() for cleaning data. For more information, please see the package vignette.

Installation

Package installation

The latest official version of the wdpar R package can be installed using the following R code. Please note that this package requires the curl and sf R packages which may require additional software to be installed. If you encounter problems installing the wdpar R package, please consult the installation instructions for these packages.

install.packages("wdpar", repos = "https://cran.rstudio.com/")

Alternatively, the latest developmental version can be installed using the following R code. Please note that while developmental versions may contain additional features not present in the official version, they may also contain coding errors.

if (!require(remotes))
  install.packages("remotes")
remotes::install_github("prioritizr/wdpar")

Additional dependencies

The wdpar R package can leverage the prepr R package to augment data cleaning procedures. Since the prepr R package is not available on the Comprehensive R Archive Network, it is listed as an optional dependency. In some cases, the prepr R package is required to complete the data cleaning procedures (e.g. to fix especially extreme geometry issues) and the wdpar R package will throw an error if the package is not available. To install the prepr R package, please use the following R code.

if (!require(remotes))
  install.packages("remotes")
remotes::install_github("dickoa/prepr")

Note that the prepr R package has system dependencies that need to be installed before the package itself can be installed (see below for platform-specific instructions).

Windows

The Rtools software needs to be installed to install the prepr R package package from source. This software provides system requirements from rwinlib.

Ubuntu

The gmp, mpfr, and several spatial libraries need to be installed. For recent versions of Ubuntu (18.04 and later), these libraries are available through official repositories. They can be installed using the following system commands:

apt-get -y update
apt-get install -y libgmp3-dev libmpfr-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev
Linux

For Unix-alikes, gmp (>= 4.2.3), mpfr (>= 3.0.0), and gdal (>= 3.2.2) are required.

MacOS

The gmp, mpfr, and gdal libraries are required. The easiest way to install these libraries is using HomeBrew. After installing HomeBrew, these libraries can be installed using the following commands in the system terminal:

brew install pkg-config
brew install gmp
brew install mpfr
brew install gdal

Usage

Here we will provide a short introduction to the wdpar R package. First, we will load the wdpar R package. We will also load the dplyr and ggmap R packages to help explore the data.

# load packages
library(wdpar)
library(dplyr)
library(ggmap)

Now we will download protected area data for Malta from Protected Planet. We can achieve this by specifying Malta’s country name (i.e. "Malta") or Malta’s ISO3 code (i.e. "MLT"). Since data are downloaded to a temporary directory by default, we will specify that the data should be downloaded to a persistent directory. This means that R won’t have to re-download the same dataset every time we restart our R session, and R can simply re-load previously downloaded datasets as needed.

# download protected area data for Malta
mlt_raw_pa_data <- wdpa_fetch("Malta", wait = TRUE,
                              download_dir = rappdirs::user_data_dir("wdpar"))

Next, we will clean the data set. Briefly, the cleaning steps include: excluding protected areas that are not yet implemented, excluding protected areas with limited conservation value, replacing missing data codes (e.g. "0") with missing data values (i.e. NA), replacing protected areas represented as points with circular protected areas that correspond to their reported extent, repairing any topological issues with the geometries, and erasing overlapping areas. For more information, see ?wdpa_clean.

# clean Malta data
mlt_pa_data <- wdpa_clean(mlt_raw_pa_data)

Print preview of the data associated with each protected area.

# print preview
head(mlt_pa_data)
## Simple feature collection with 6 features and 32 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 1382584 ymin: 4280853 xmax: 1399759 ymax: 4299615
## CRS:           +proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +datum=WGS84 +ellps=WGS84 +units=m +no_defs
## Precision:     1500 
## # A tibble: 6 × 33
##      WDPAID WDPA_PID  PA_DEF NAME  ORIG_NAME DESIG DESIG_ENG DESIG_TYPE IUCN_CAT
##       <dbl> <chr>     <chr>  <chr> <chr>     <chr> <chr>     <chr>      <chr>   
## 1    194420 194420    PA     Filf… Filfla    Rise… Nature R… National   Ia      
## 2    194425 194425    PA     Il-G… Il-Gżejj… Rise… Nature R… National   Ia      
## 3 555588631 555588631 PA     Il-M… Il-Majji… Park… National… National   II      
## 4    174757 174757    PA     Il-Ġ… Il-Ġonna… List… List of … National   III     
## 5    174758 174758    PA     Bidn… Bidnija,… List… List of … National   III     
## 6    194415 194415    PA     Il-Ġ… Il-Ġonna… List… List of … National   III     
## # … with 24 more variables: INT_CRIT <chr>, MARINE <chr>, REP_M_AREA <dbl>,
## #   GIS_M_AREA <dbl>, REP_AREA <dbl>, GIS_AREA <dbl>, NO_TAKE <chr>,
## #   NO_TK_AREA <dbl>, STATUS <chr>, STATUS_YR <dbl>, GOV_TYPE <chr>,
## #   OWN_TYPE <chr>, MANG_AUTH <chr>, MANG_PLAN <chr>, VERIF <chr>,
## #   METADATAID <int>, SUB_LOC <chr>, PARENT_ISO <chr>, ISO3 <chr>,
## #   SUPP_INFO <chr>, CONS_OBJ <chr>, GEOMETRY_TYPE <chr>, AREA_KM2 <dbl>,
## #   geometry <MULTIPOLYGON [m]>

Finally, after cleaning the data, let’s plot a map showing Malta’s protected areas and color each area according to its management category (as defined by the The International Union for Conservation of Nature).

# reproject data to longitude/latitude for plotting
mlt_pa_data <- st_transform(mlt_pa_data, 4326)

# download basemap imagery
bg <- get_stamenmap(unname(st_bbox(mlt_pa_data)), zoom = 8,
                    maptype = "watercolor", force = TRUE)

# make map
ggmap(bg) +
geom_sf(aes(fill = IUCN_CAT), data = mlt_pa_data, inherit.aes = FALSE) +
theme(axis.title = element_blank(), legend.position = "bottom")

If you need to calculate protected area coverage statistics for a country, please note that you will need to manually clip the cleaned protected area data to the countries’ coastline and its Exclusive Economic Zone (EEZ) to obtain accurate results (see official data cleaning guidelines). This step is not performed by the wdpar R package because there is no single “best” coastline and Exclusive Economic Zone (EEZ) dataset, since the “best” dataset for any given project depends on the level of required precision and available computational resources. For more examples—including an example of clipping the cleaned data to a coastline—please refer to the package vignette.

Citation

Please cite the wdpar R package and the relevant databases used in publications.

To cite the latest official version, please use:

Hanson JO (2021). wdpar: Interface to the World Database on Protected Areas. R package version 1.3.2. Available at https://CRAN.R-project.org/package=wdpar.

To cite the latest development version, please use:

Hanson JO (2022). wdpar: Interface to the World Database on Protected Areas. R package version 1.3.2.1. Available at https://github.com/prioritizr/wdpar.

To cite the World Database on Protected Areas (WDPA), please use:

UNEP-WCMC and IUCN ([insert year of the version downloaded]) Protected Planet: The World Database on Protected Areas (WDPA), [insert month/year of the version downloaded], Cambridge, UK: UNEP-WCMC and IUCN. Available at: www.protectedplanet.net.

To cite the World Database on Other Effective Area-Based Conservation Measures (WDOECM), please use:

UNEP-WCMC and IUCN ([insert year of the version downloaded]) Protected Planet: The world database on other effective area-based conservation measures, [insert month/year of the version downloaded], Cambridge, UK: UNEP-WCMC and IUCN. Available at: www.protectedplanet.net.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].