-
Notifications
You must be signed in to change notification settings - Fork 2
Home
This document is to guide you through the usage of the Quality Assurance of the World Database on Protected Areas.
Author: Stijn den Haan
Supervisor: Yichuan Shi
Bioinformatics internship • UNEP-WCMC • 10 June - 9 August 2019
- ArcGIS Pro
2.3.1
or later - Python
3.6
or later (included in ArcGIS Pro2.3.1
) - Python packages required:
- ArcPy
- Pandas
0.25
- NumPy
1.16.4
- OpenPyXL
2.6.1
- Pandas
Note: installing Anaconda is not required. Refrain from using any other Conda installation than the one that comes with ArcGIS Pro's installation.
This is not essential to run the QA toolbox, but it is highly recommended. Doing this will allow you to updated Python packages (see list above) and prevent incompatibility errors.
- Clone ArcGIS Pro's default Python environment called
arcgispro-py3
-
Open ESRI's
Python Command Prompt
- this comes with ArcGIS Pro's installation. In Windows, see folderArcGIS
in the Start menu. -
In the terminal, the first line should look similar to this:
(arcgispro-py3) C:\Users\[UserName]\AppData\Local\ESRI\conda\envs\
-
Enter the following in the command-prompt:
# Display Python environments present
conda info --envs
# Become root (obtain administrator permissions)
conda activate root
# If that yields an error, use:
activate root
# Clone the default ArcPy environment
conda create --name [NameOfNewEnvironment] --clone arcgispro-py3
# Activate the new environment
conda activate [NameOfNewEnvironment]
# If that yields an error, use:
activate [NameOfNewEnvironment]
# View all installed packages
conda list
# Install required packages, e.g. pandas
conda install [nameOfPackage]
- Make the new Python environment ArcGIS Pro's default environment
In ArcGIS Pro, go to Settings --> Python. This will display the Python Package Manager. Access 'Manage Environments', select the environment you just created, press OK and restart ArcGIS Pro.
You are now ready to use the WDPA Quality Assurance toolbox.
- Download the WDPA QA toolbox from this GitHub repository
- Unzip the file in a folder of your choosing
- Open a (non-empty / empty) project in ArcGIS Pro
- On the ribbon, select Insert --> Toolbox --> Add Toolbox
- Go to the folder where you unzipped the toolbox, select the toolbox (with red icon), and press 'OK'
- Open the Catalog pane --> Toolboxes --> The WDPA QA toolbox should now be visible.
- Expand the toolbox, so that the embedded scripts become visible.
- Right-click the script to run (e.g. for polygons or points), click Open, and specify the input table (feature class attribute table) to be checked, and the output directory.
- Click Run, and click 'View Details' if you wish to see the progress
- The Excel output will be present in the previously specified output directory.
- Open a blank project in ArcGIS Pro
- On the ribbon, select Insert --> Toolbox --> New Toolbox
- Specify the name of the toolbox
- Once created, the toolbox will be present in the Catalog, under Toolboxes.
- Right-click the created toolbox --> New --> Script
- In tab 'General', specify the name and label, then point to a script containing the main functions (
poly.py
orpoint.py
). - Ensure boxes 'Import script' and 'Store tool with relative path' are checked
- In tab 'Parameters', add two parameters to specify the input type and the output folder
- Label: WDPA polygon, Data Type: Feature Class, Type: Required, Direction: Input
- Label: Output folder, Data Type: Folder, Type: Required, Direction: Input
- Repeat steps 5-8 for another script if required (i.e.
poly.py
orpoint.py
) - Finally, store the toolbox in a folder along with the WDPA folder that contains the QA scripts and compress this folder. Subsequently, wherever this folder is uncompressed and the toolbox is used, the toolbox will be in the same folder as the WDPA QA scripts. This makes the QA portable.
The Excel workbook with QA results is still open. Close the workbook and try again.
The functions have two names: one that is present in the script, and one that is displayed in the Excel output.
Rule: if the WDPAID
is the same among a group of WDPA_PID
s, then related fields (e.g. ISO3
) must be the same for the entire group. Output the WDPA_PIDs that do not adhere to this rule.
Find WDPA_PIDs that share the same WDPAID, but have inconsistencies in field NAME
.
Find WDPA_PIDs that share the same WDPAID, but have inconsistencies in field ORIG_NAME
.
Rule: for a number of fields, only a set number of values are allowed. Output the WDPA_PIDs that do not adhere to this rule.
Find WDPA_PIDs that have a value unequal to 1 in field PA_DEF
.
4.3.b. Invalid DESIG_ENG
- international - ivd_desig_eng_international - invalid_desig_eng_international
Find WDPA_PIDs whose DESIG_ENG
is unequal to:
- Ramsar Site, Wetland of International Importance
- UNESCO-MAB Biosphere Reserve
- World Heritage Site (natural or mixed)
While DESIG_TYPE
= 'International'
Find WDPA_PIDs whose DESIG_ENG
is unequal to:
- Baltic Sea Protected Area (HELCOM)
- Specially Protected Area (Cartagena Convention)
- Marine Protected Area (CCAMLR)
- Marine Protected Area (OSPAR)
- Site of Community Importance (Habitats Directive)
- Special Protection Area (Birds Directive)
- Specially Protected Areas of Mediterranean Importance (Barcelona Convention)
While DESIG_TYPE
= 'Regional'