-
Notifications
You must be signed in to change notification settings - Fork 2
Home
This document is to guide you through the usage of RAMBO, a quality assurance tool developed for the World Database on Protected Areas.
Author: Stijn den Haan
Supervisor: Yichuan Shi
Bioinformatics internship • UNEP-WCMC • 10 June - 9 August 2019
Installing and using RAMBO in ArcGIS Pro
Updating and re-installing RAMBO
Exploring RAMBO's output in Excel
RAMBO was created to make the quality assurance of the World Database on Protected Areas (WDPA) more systematic, efficient, thorough, and less labour-intensive. RAMBO finds the errors and creates an error report in Excel where the nature and number of errors can be explored. Subsequent changes to the WDPA data need to be made manually.
- ArcGIS Pro
2.4
or later
Required, but included in ArcGIS Pro 2.4
:
- Python
3.6.8
or later (included in ArcGIS Pro2.4
) - Python packages required (versions stated below or later):
- pandas
0.24.2
- numpy
1.16.2
- openpyxl
2.6.1
- pandas
Note: installing Anaconda is not required. Refrain from using any other Conda installation than the one that is installed by ArcGIS Pro by default.
This file is the ArcGIS toolbox to be loaded into an ArcGIS project
These checks are built according to the following principles:
-
Per type of check (e.g. looking for inconsistencies among WDPAID duplicates in a particular field), there is a single Factory Function. This is a Python function that performs the actual check.
-
For each field to check per Factory Function, there is an Input Function. These Input Functions provide the variables (fields and values) that need to be passed to the Factory Function to check for errors. Each of these Input Functions calls the corresponding Factory Function at the end of the function. In this way the Factory Function is re-used for multiple input variables.
-
Some types of checks do not have a Factory Function - these are hardcoded checks that have only a single input.
export.py
is a Python script that exports the results of RAMBO to an Excel Workbook.
- Download RAMBO (the WDPA QA tool), 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 RAMBO, select the
.tbx
file (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.
If you wish to update or re-install RAMBO, please follow the steps below.
- In ArcGIS Pro, delete the 'WDPA Quality Assurance' toolbox via the catalog.
- Verify that step 1 deleted the RAMBO
.tbx
file andwdpa
folder from your computer. If that did not happen, manually delete these. - Close ArcGIS Pro.
- Follow steps 1-10 of the paragraph above ('Installing and using RAMBO in ArcGIS Pro').
The Excel workbook with QA results is still open and RAMBO is trying to overwrite it. Close the workbook and give it a new name if it should not be overwritten, then try again.
Your input was Points data while you tried to run the Polygon script. Specify the correct input and output, and try again.
You do not have an internet connection. Connect to the internet, ensure that you are logged into the ArcGIS Pro portal, and try again.
4. You are analysing polygon data, but there are fewer checks present in the Excel Summary sheet than you were expecting.
You may have run the 'WDPA QA Points' script instead of the 'WDPA QA Polygons' script. The former script does not include any GIS-related checks, e.g. gis_m_area_gt_gis_area (whether GIS_M_AREA > GIS_AREA), and therefore contains fewer checks than the WDPA QA Polygon script. Run RAMBO again and ensure you are using the correct script for the correct input type.
- The filename of the Excel workbook is comprised of the day RAMBO was run, along with the type of input ('poly' or 'points'). The filename is written as per the following:
[present_date]
WDPA_QA_checks[datatype]
.xlsx
- The RAMBO output file will be overwritten without warning, if you have run a toolbox script (e.g. the WDPA QA for points data), and you run the same script again on the same day while leaving the output folder unchanged. If you wish to run the same script multiple times on one day, either change the output filename after running the script, or specify a different output folder.
This sheet contains an overview of the checks' results.
There are 3 labels:
-
Fail (red): violations of the WDPA rules or general logic
- E.g. PA_DEF = 5
- E.g. REP_M_AREA > REP_AREA.
-
Check (yellow): verification required whether these are true errors (e.g. ‘tiny_gis_area’ shows areas with a size smaller than 100 m2).
- E.g. for the same WDPAID, the associated WDPA_PIDs have different values for field NAME.
- Pass (green): no errors found.
In the Summary sheet, the checks' names are hyperlinks: clicking one of them will bring you directly to the Excel sheet containing all errors found by that check.
Each sheet contains a hyperlink in cell A1, called 'To Summary'. Clicking this will bring you back to the Summary sheet.
By default the first column and first row are frozen, so that the headers are always visible, and you can always click the 'To Summary' hyperlink to return to the Summary sheet.
Each check that returned errors has its own Excel sheet. The name of this sheet is the same as the name of the check as listed in the Summary sheet. Sheets' tabs are colour-coded, and tab colours correspond with the Summary result (red for 'Fail', orange for 'Check').
This is a list describing all QA checks that are included in RAMBO.
Note: the checks have different names in the Excel file than in the quality assurance script (qa.py
). The overview below shows both the name of the check as used in the Excel file, and the name of function in the script.
Duplicate WDPA_PIDs present. WDPA_PIDs must be unique throughout the entire WDPA.
The REP_AREA is smaller than 0.0001 km² (100 m²). This only requires a check, as the is the protected area could be extremely small.
MARINE = 1 or 2, but REP_M_AREA is smaller than or equal to 0. This only requires a check, as REP_M_AREA could be 0 due to the way data providers share their information.
REP_M_AREA is greater than REP_AREA. REP_M_AREA can only be equal to or smaller than REP_AREA.
NO_TK_AREA is larger than REP_M_AREA. NO_TK_AREA can only be equal to or smaller than REP_M_AREA.
NO_TAKE value is 'All', but NO_TK_AREA is not the same value as REP_M_AREA.
DESIG_ENG is neither 'Ramsar Site, Wetland of International Importance', nor 'World Heritage Site (natural or mixed)', and the INT_CRIT is not the accepted value 'Not Applicable'.
Note: 'Not Applicable' is the only accepted value if DESIG_ENG is not 'Ramsar Site, Wetland of International Importance' or 'World Heritage Site (natural or mixed)'.
DESIG_ENG is neither 'UNESCO-MAB Biosphere Reserve' nor 'World Heritage Site (natural or mixed)', and the IUCN_CAT is not any of the following accepted values:
- Ia
- Ib
- II
- III
- IV
- V
- VI
- Not Reported
- Not Assigned
Note: 'Not Applicable' is only accepted if DESIG_ENG is 'UNESCO-MAB Biosphere Reserve' or 'World Heritage Site (natural or mixed)'.
Inconsistencies in the NAME field for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in NAME per parcel (WDPA_PID).
Inconsistencies in the ORIG_NAME field for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in ORIG_NAME per parcel (WDPA_PID).
Inconsistencies in the DESIG field for WDPA_PIDs with the same WDPAID. It must be one protected area (and WDPAID) per designation. WDPA_PIDs with the same WDPAID (i.e. parcels) cannot have different designations.
Inconsistencies in the DESIG_ENG field for WDPA_PIDs with the same WDPAID. It must be one protected area (and WDPAID) per designation. WDPA_PIDs with the same WDPAID cannot have different designations.
Inconsistencies in DESIG_TYPE for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in DESIG_TYPE per parcel (WDPA_PID).
Inconsistencies in INT_CRIT for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in INT_CRIT per parcel (WDPA_PID).
Inconsistencies in NO_TAKE for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in NO_TAKE per parcel (WDPA_PID).
Inconsistencies in STATUS for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in STATUS per parcel (WDPA_PID).
Inconsistencies in STATUS_YR for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in STATUS_YR per parcel (WDPA_PID).
Inconsistencies in GOV_TYPE for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in GOV_TYPE per parcel (WDPA_PID).
Inconsistencies in OWN_TYPE for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in OWN_TYPE per parcel (WDPA_PID).
Inconsistencies in MANG_AUTH for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in MANG_AUTH per parcel (WDPA_PID).
Inconsistencies in MANG_PLAN for WDPA_PIDs with the same WDPAID. This only requires a check as the same protected area (WDPAID) is allowed to have a different value in MANG_PLAN per parcel (WDPA_PID).
Inconsistencies in VERIF for WDPA_PIDs with the same WDPAID. The same protected area (WDPAID) cannot have a different value in VERIF per parcel (WDPA_PID).
Inconsistencies in METADATAID for WDPA_PIDs with the same WDPAID. The same protected area (WDPAID) cannot have a different value in METADATAID per parcel (WDPA_PID).
Inconsistencies in SUB_LOC for WDPA_PIDs with the same WDPAID. The same protected area (WDPAID) cannot have a different value in SUB_LOC per parcel (WDPA_PID).
Inconsistencies in PARENT_ISO3 for WDPA_PIDs with the same WDPAID. The same protected area (WDPAID) cannot have a different value in PARENT_ISO3 per parcel (WDPA_PID).
Inconsistencies in ISO3 for WDPA_PIDs with the same WDPAID. The same protected area (WDPAID) cannot have a different value in ISO3 per parcel (WDPA_PID).
PA_DEF is unequal to 1, which is the only accepted value.
DESIG_TYPE is 'International', but DESIG_ENG is not any of the following accepted values for International sites:
- Ramsar Site, Wetland of International Importance
- UNESCO-MAB Biosphere Reserve
- World Heritage Site (natural or mixed)
DESIG_TYPE is not 'International', but DESIG_ENG is any of the following accepted values for International sites:
- Ramsar Site, Wetland of International Importance
- UNESCO-MAB Biosphere Reserve
- World Heritage Site (natural or mixed)
DESIG_TYPE is 'Regional', but DESIG_ENG is not any of the following accepted values for Regional sites:
- 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)
DESIG_TYPE is not 'Regional', but DESIG_ENG is any of the following accepted values for Regional sites:
- 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)
DESIG_ENG is 'Ramsar Site, Wetland of International Importance' or 'World Heritage Site (natural or mixed)', but INT_CRIT is not one of the accepted values (>1000 possible values), which is any combination of the following:
- (i)
- (ii)
- (iii)
- (iv)
- (v)
- (vi)
- (vii)
- (viii)
- (ix)
- (x)
Note: combinations of accepted values should not contain any symbols (e.g. commas) or spaces in between them.
Example
Accepted format: (i)(ii)(vi)
Not accepted: (i) (ii) (vi)
Not accepted: (i),(ii),(vi)
Not accepted: (i);(ii);(vi)
Etc.
DESIG_TYPE is not any of the following accepted values:
- National
- Regional
- International
- Not Applicable
IUCN_CAT is not any of the following accepted values:
- Ia
- Ib
- II
- III
- IV
- V
- VI
- Not Reported
- Not Applicable
- Not Assigned
DESIG_ENG is 'UNESCO-MAB Biosphere Reserve' or 'World Heritage Site (natural or mixed)', but IUCN_CAT is a different value than 'Not Applicable'.
MARINE is unequal to 0, 1, or 2
Note: datatype for field MARINE is string.
MARINE = 0, but NO_TAKE is a different value than 'Not Applicable'.
I.e. terrestrial protected areas (MARINE = 0) have a NO_TAKE other than 'Not Applicable'.
MARINE = 1 or 2, but NO_TAKE is not any of the following accepted values:
- All
- Part
- None
- Not Reported
MARINE = 0, but NO_TK_AREA is unequal to 0.
I.e. terrestrial protected areas (MARINE = 0) have a NO_TK_AREA other than 0.
NO_TK_AREA is unequal to 0 while NO_TAKE is 'Not Applicable'.
STATUS is not any of the following accepted values:
- Proposed
- Inscribed
- Adopted
- Designated
- Established
STATUS_YR is invalid. It can only be between 1750 and present year, or the value of 0 (if the year is not reported).
GOV_TYPE is not any of the following accepted values:
- Federal or national ministry or agency
- Sub-national ministry or agency
- Government-delegated management
- Transboundary governance
- Collaborative governance
- Joint governance
- Individual landowners
- Non-profit organisations
- For-profit organisations
- Indigenous peoples
- Local communities
- Not Reported
OWN_TYPE is not any of the following accepted values:
- State
- Communal
- Individual landowners
- For-profit organisations
- Non-profit organisations
- Joint ownership
- Multiple ownership
- Contested
- Not Reported
VERIF is not any of the following accepted values:
- State Verified
- Expert Verified
- Not Reported
PARENT_ISO3 is not any of the accepted ISO3 values, or 'ABNJ'.
The accepted values are obtained from a .csv file located on a GitHub repository (latest update: 19 March 2019):
Link to the repository:
https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv
Note: this list is updated periodically. Please check with the WDPA and/or data manager to make sure you are using the most up to date list.
ISO3 is not any of the accepted ISO3 values, or 'ABNJ'. For accepted ISO3 values, see 'check_parent_iso3' above.
DESIG_TYPE is 'Not Applicable', but STATUS is not 'Established'.
Forbidden characters present in NAME.
Forbidden characters:
<
>
?
*
-
\r
(new-line character) -
\n
(new-line character)
Note: if a WPDA_PID has been flagged but you cannot see anything wrong, it is most likely a new-line character error. Double click on the cell in ArcGIS Pro to see (they do not consistently appear in Excel). The new-line characters appear as one or multiple empty white lines below or above the cell's value when you explore this in ArcGIS Pro, or they break up a value in two lines.
Forbidden characters present in ORIG_NAME.
Forbidden characters:
<
>
?
*
-
\r
(new-line character) -
\n
(new-line character)
Note: if a WPDA_PID has been flagged but you cannot see anything wrong, it is most likely a new-line character error. Double click on the cell in ArcGIS Pro to see (they do not consistently appear in Excel). The new-line characters appear as one or multiple empty white lines below or above the cell's value when you explore this in ArcGIS Pro, or they break up a value in two lines.
Forbidden characters present in DESIG.
Forbidden characters:
<
>
?
*
-
\r
(new-line character) -
\n
(new-line character)
Note: if a WPDA_PID has been flagged but you cannot see anything wrong, it is most likely a new-line character error. Double click on the cell in ArcGIS Pro to see (they do not consistently appear in Excel). The new-line characters appear as one or multiple empty white lines below or above the cell's value when you explore this in ArcGIS Pro, or they break up a value in two lines.
Forbidden characters present in DESIG_ENG.
Forbidden characters:
<
>
?
*
-
\r
(new-line character) -
\n
(new-line character)
Note: if a WPDA_PID has been flagged but you cannot see anything wrong, it is most likely a new-line character error. Double click on the cell in ArcGIS Pro to see (they do not consistently appear in Excel). The new-line characters appear as one or multiple empty white lines below or above the cell's value when you explore this in ArcGIS Pro, or they break up a value in two lines.
Forbidden characters present in MANG_AUTH.
Forbidden characters:
<
>
?
*
-
\r
(new-line character) -
\n
(new-line character)
Note: if a WPDA_PID has been flagged but you cannot see anything wrong, it is most likely a new-line character error. Double click on the cell in ArcGIS Pro to see (they do not consistently appear in Excel). The new-line characters appear as one or multiple empty white lines below or above the cell's value when you explore this in ArcGIS Pro, or they break up a value in two lines.
Forbidden characters present in MANG_PLAN.
Forbidden characters:
<
>
?
*
-
\r
(new-line character) -
\n
(new-line character)
Note: if a WPDA_PID has been flagged but you cannot see anything wrong, it is most likely a new-line character error. Double click on the cell in ArcGIS Pro to see (they do not consistently appear in Excel). The new-line characters appear as one or multiple empty white lines below or above the cell's value when you explore this in ArcGIS Pro, or they break up a value in two lines.
Forbidden characters present in SUB_LOC.
Forbidden characters:
<
>
?
*
-
\r
(new-line character) -
\n
(new-line character)
Note: if a WPDA_PID has been flagged but you cannot see anything wrong, it is most likely a new-line character error. Double click on the cell in ArcGIS Pro to see (they do not consistently appear in Excel). The new-line characters appear as one or multiple empty white lines below or above the cell's value when you explore this in ArcGIS Pro, or they break up a value in two lines.
Scipt function name: nan_present_name
NaN / NA present in NAME. These values are 'Not a Number' and could be the result of a range of errors or a calculation such as division by 0.
NaN / NA present in ORIG_NAME. These values are 'Not a Number' and could be the result of a range of errors or a calculation such as division by 0.
NaN / NA present in DESIG. These values are 'Not a Number' and could be the result of a range of errors or a calculation such as division by 0.
NaN / NA present in DESIG_ENG. These values are 'Not a Number' and could be the result of a range of errors or a calculation such as division by 0.
NaN / NA present in MANG_AUTH. These values are 'Not a Number' and could be the result of a range of errors or a calculation such as division by 0.
NaN / NA present in MANG_PLAN. These values are 'Not a Number' and could be the result of a range of errors or a calculation such as division by 0.
NaN / NA present in SUB_LOC. These values are 'Not a Number' and could be the result of a range of errors or a calculation such as division by 0.
GIS_AREA is too large compared to REP_AREA. This may not be an error and can just be attributed to a lack of reporting from the data provider.
WDPA_PIDs will be picked up if they comply with two rules:
- The absolute difference between the two areas is greater than 50 km².
- The proportion of GIS_AREA compared to REP_AREA falls outside of a distribution calculated.
This distribution is produced by calculating the following for each WDPA_PID in the WDPA:
(REP_AREA + GIS_AREA) / REP_AREA
Then, the mean and standard deviation of this distribution is calculated. However, if the product of this calculation is larger than 100 (e.g. if REP_AREA is 0) or smaller than 0 (e.g. if REP_AREA is negative), then these WDPA_PIDs are left out to calculate the mean and standard deviation.
Subsequently, the maximum accepted value is calculated as per the following:
mean + 2 * standard deviation
If the product of (REP_AREA + GIS_AREA) / REP_AREA is larger than this maximum, the WDPA_PID will be output as an error.
REP_AREA is too large compared to GIS_AREA. This may not be an error and can just be attributed to a lack of reporting from the data provider.
WDPA_PIDs will be picked up if they comply with two rules:
- The absolute difference between the two areas is greater than 50 km².
- The proportion of REP_AREA compared to GIS_AREA falls outside of a distribution calculated.
This distribution is produced by calculating the following for each WDPA_PID in the WDPA:
(REP_AREA + GIS_AREA) / GIS_AREA
Then, the mean and standard deviation of this distribution is calculated. However, if the product of this calculation is larger than 100 (e.g. if GIS_AREA is 0) or smaller than 0 (e.g. if GIS_AREA is negative), then these WDPA_PIDs are left out to calculate the mean and standard deviation.
Subsequently, the maximum accepted value is calculated as per the following:
mean + 2 * standard deviation
If the product of (REP_AREA + GIS_AREA) / GIS_AREA is larger than this maximum, the WDPA_PID will be output as an error.
GIS_M_AREA is too large compared to REP_M_AREA. This may not be an error and can just be attributed to a lack of reporting from the data provider.
WDPA_PIDs will be picked up if they comply with two rules:
- The absolute difference between the two areas is greater than 50 km².
- The proportion of GIS_M_AREA compared to REP_M_AREA falls outside of a distribution calculated.
This distribution is produced by calculating the following for each WDPA_PID in the WDPA:
(REP_M_AREA + GIS_M_AREA) / REP_M_AREA
Then, the mean and standard deviation of this distribution is calculated. However, if the product of this calculation is larger than 100 (e.g. if REP_M_AREA is 0) or smaller than 0 (e.g. if REP_M_AREA is negative), then these WDPA_PIDs are left out to calculate the mean and standard deviation.
Subsequently, the maximum accepted value is calculated as per the following:
mean + 2 * standard deviation
If the product of (REP_M_AREA + GIS_M_AREA) / REP_M_AREA is larger than this maximum, the WDPA_PID will be output as an error.
REP_M_AREA is too large compared to GIS_M_AREA. This may not be an error and can just be attributed to a lack of reporting from the data provider.
WDPA_PIDs will be picked up if they comply with two rules:
- The absolute difference between the two areas is greater than 50 km².
- The proportion of REP_M_AREA compared to GIS_M_AREA falls outside of a distribution calculated.
This distribution is produced by calculating the following for each WDPA_PID in the WDPA:
(REP_M_AREA + GIS_M_AREA) / GIS_M_AREA
Then, the mean and standard deviation of this distribution is calculated. However, if the product of this calculation is larger than 100 (e.g. if GIS_M_AREA is 0) or smaller than 0 (e.g. if GIS_M_AREA is negative), then these WDPA_PIDs are left out to calculate the mean and standard deviation.
Subsequently, the maximum accepted value is calculated as per the following:
mean + 2 * standard deviation
If the product of (REP_M_AREA + GIS_M_AREA) / GIS_M_AREA is larger than this maximum, the WDPA_PID will be output as an error.
The GIS_AREA is smaller than 0.0001 km² (100 m²). This only requires a check, as the is the protected area could be extremely small.
NO_TK_AREA is larger than GIS_M_AREA. The NO_TK_AREA can only be equal to or smaller than the GIS_M_AREA.
GIS_M_AREA is larger than GIS_AREA. The GIS_M_AREA can only be equal to or smaller than the GIS_AREA.
GIS_M_AREA is smaller than or equal to 0 while MARINE = 1 or 2.
The MARINE value is incorrect based on GIS calculations.
This check produces two new columns. One column, named marine_GIS_proportion, is the product of the following calculation:
GIS_M_AREA / GIS_AREA
The second column, named marine_GIS_value, contains a value (0, 1, or 2) based on the official WDPA manual (v1.6) thresholds to designate the MARINE value, as stated below.
- marine_GIS_value = 0 if:
GIS_M_AREA / GIS_AREA
is smaller than or equal to 0.1
- marine_GIS_value = 1 if:
GIS_M_AREA / GIS_AREA
is larger than 0.1 but smaller than 0.9
- marine_GIS_value = 2 if:
GIS_M_AREA / GIS_AREA
is larger than or equal to 0.9
If the marine_GIS_value is unequal to the MARINE value, then this is an error.
This is not required to run RAMBO, but it is optional. Doing this will allow you to update Python packages individually, e.g. to use new functionality of a package without having to wait for an ArcGIS Pro update. During ArcGIS Pro updates, Python packages are updated, but this happens infrequently.
Step 1: 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]
Step 2: 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. The new Python environment will now be loaded by default when starting ArcGIS Pro.
You are now ready to use your own Python environment that contains ArcPy.
- 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, add the toolbox and the WDPA folder (containing the QA scripts) collectively in a single compressed file. Subsequently, wherever this folder is uncompressed, the toolbox will be in the same folder as the WDPA QA scripts. This makes RAMBO portable.
END OF WIKI.