4 - ExtractingAndProcessingIUCNRedListSpeciesDataUsingVectorsQGIS - v1 - 0 (728652)
4 - ExtractingAndProcessingIUCNRedListSpeciesDataUsingVectorsQGIS - v1 - 0 (728652)
4 - ExtractingAndProcessingIUCNRedListSpeciesDataUsingVectorsQGIS - v1 - 0 (728652)
The UN-REDD Programme is the United Nations Collaborative initiative on Reducing Emissions from
Deforestation and forest Degradation (REDD) in developing countries. The Programme was launched
in September 2008 to assist developing countries prepare and implement national REDD+ strategies,
and builds on the convening power and expertise of the Food and Agriculture Organization of the
United Nations (FAO), the United Nations Development Programme (UNDP) and the United Nations
Environment Programme (UNEP).
The United Nations Environment Programme World Conservation Monitoring Centre (UNEP-WCMC)
is the specialist biodiversity assessment centre of the United Nations Environment Programme
(UNEP), the world’s foremost intergovernmental environmental organisation. The Centre has been in
operation for over 30 years, combining scientific research with practical policy advice.
Prepared by Corinna Ravilious, Lucy Goodman, Blaise Bodin, Lisen Runsten and Matea Osti
Copyright: UNEP
Copyright release: This publication may be reproduced for educational or non-profit purposes
without special permission, provided acknowledgement to the source is made. Re-use of any figures
is subject to permission from the original rights holders. No use of this publication may be made for
resale or any other commercial purpose without permission in writing from UNEP. Applications for
permission, with a statement of purpose and extent of reproduction, should be sent to the Director,
UNEP-WCMC, 219 Huntingdon Road, Cambridge, CB3 0DL, UK.
Disclaimer: The contents of this report do not necessarily reflect the views or policies of UNEP,
contributory organisations or editors. The designations employed and the presentations of material in
this report do not imply the expression of any opinion whatsoever on the part of UNEP or
contributory organisations, editors or publishers concerning the legal status of any country, territory,
city area or its authorities, or concerning the delimitation of its frontiers or boundaries or the
designation of its name, frontiers or boundaries. The mention of a commercial entity or product in
this publication does not imply endorsement by UNEP.
We welcome comments on any errors or issues. Should readers wish to comment on this document,
they are encouraged to get in touch via: [email protected].
Citation: Ravilious, C., Goodman, L., Bodin, B., Runsten, L. and Osti, M. (2015) Using spatial
information to support decisions on safeguards and multiple benefits for REDD+. Step-by-step tutorial
v1.0: Extracting and processing IUCN Red List species data using a vector method in a combination of
QGIS 1.8 and 2.8. Prepared on behalf of the UN-REDD Programme. UNEP World Conservation
Monitoring Centre, Cambridge, UK.
Acknowledgements: With thanks to support provided by IUCN, the Global Forest Resource
Assessment of the FAO, the FAO-Finland Technical Collaboration Programme, Tanzanian Forest
Service, FAO Tanzania, Sokoine University, André Mazinga (OSFAC) and Eric Lutete (OSFAC).
These training materials have been produced from materials generated for working sessions held in
Tanzania with the National Forestry Resources Monitoring and Assessment of Tanzania, FAO Tanzania
and Sokoine University, and the Democratic Republic of the Congo with OSFAC, to aid the production
of multiple benefits maps to inform REDD+ planning and safeguards policies using open source GIS
software.
Using open source GIS software to support REDD+ planning
Contents
1. Introduction ...................................................................................................................... 1
2. Using IUCN Red List species data and generating species richness maps .............................. 1
2.1. Selecting and downloading species data from the IUCN Red List website ...................... 1
2.1.3. Download the IUCN Red List spatial data layers ...................................................... 5
2.2.1. Format species CSV file in preparation for joining to the spatial data..................... 6
2.2.2. Use SQL query to select species of interest from spatial dataset ............................ 9
2.2.3. From the previous selection select out the current native species range ............... 12
2.2.4. From the previous selection select out terrestrial species ranges........................... 13
2.2.5. Split the final subset IUCN dataset into separate files by species ........................... 14
2.2.6. Batch clip the separate species datasets to area of interest ................................... 15
2.3. Vector analysis to create species richness (in QGIS 1.8 only as requires QMarxan plugin) 25
2.3.1. Generate a dataset of hexagons or squares using the Qmarxan plugin .................. 25
2.3.3. Check any errors located in the error log and spot-check for quality control ......... 27
1. Introduction
REDD+ has the potential to deliver multiple benefits beyond carbon. For example, it can promote
biodiversity conservation and secure ecosystem services from forests such as water regulation,
erosion control and non-timber forest products. Some of the potential benefits from REDD+, such as
biodiversity conservation, can be enhanced through identifying areas where REDD+ actions might
have the greatest impact using spatial analysis.
Open Source GIS software can be used to undertake spatial analysis of datasets of relevance to
multiple benefits and environmental safeguards for REDD+. Open-source software is released under a
license that allow software to be freely used, modified, and shared (http://opensource.org/licenses).
Open Source GIS software can be used to undertake spatial analysis of datasets of relevance to
multiple benefits and environmental safeguards for REDD+. Open-source software is released under a
license that allow software to be freely used, modified, and shared (http://opensource.org/licenses).
Therefore, using open source software has great potential in building sustainable capacity and critical
mass of experts with limited financial resources.
This tutorial demonstrates how a species richness grid could be created using species range data from
the IUCN Red List (IUCN, 2013). It provides full instructions of how to select and analyze and export
information from the non-spatial species data on the IUCN Red List website and how to further
analyze the information along- side the IUCN spatial data using QGIS, an open-source desktop GIS
software. Please note that the last part of the tutorial can currently only run in QGIS version 1.8 as it
is reliant on the QMarxan plugin that is not yet available in more recent versions.
2. Using IUCN Red List species data and generating species richness maps
2.1. Selecting and downloading species data from the IUCN Red List website
The IUCN Red List of Threatened Species website allows users to search for and extract tabular
information (in comma separated values (CSV) file format) on the status of threatened species. The
website provides a user friendly interface and gives the user flexibility to customize searches based on
a range of criteria. Users must register with the website to save and export customized searches.
1
Using open source GIS software to support REDD+ planning
This search below is an EXAMPLE search for mammals, birds and amphibians with threat status of
Critically Endangered (CR), Endangered (EN), Vulnerable (VU), Lower Risk: Conservation Dependent
(LR), Near Threatened (NT), Data Deficient (DD) or Least Concern (LC).
a. Click on Other
Search Options
b. Click on Taxonomy
c. Expand ANIMALIA
d. Expand CHORDATA
e. Tick AMPHIBIA,
AVES and MAMMALIA,
f. Press the arrow key to send the
selection across to the Your Search
Criteria panel
You may want to limit the
search to a single location e.g.
a single country or group of
locations only.
g. Click on Location, expand
land regions, expand and tick
the country of interest
h. Press the arrow key to send
the selection across to the
Your Search Criteria panel
This search will result in a list of species within the AMPHIBIA, AVES and MAMMALIA taxonomic groups
that have critically endangered, Endangered, Vulnerable, Lower Risk: Conservation Dependent, Near
2
Using open source GIS software to support REDD+ planning
Threatened, Data Deficient or Least Concern Red List status. The search will produce a list of species
with additional attribute data, including the threat status of each of the species.
There are other criteria that you may want to include. For example, to limit the search to species
dependent upon a particular habitat type you would click on Habitat, the expand and tick the relevant
habitat type and send that across to the search criteria panel.
a. Click
Save/Export Search
b. If already registered,
fill in your email address
and password and click
login
An account is
needed in order to
save and export
the search results.
Click on Submit
3
Using open source GIS software to support REDD+ planning
j. Refresh the browser to see the status change to show the export is complete or if it is taking
a long time log out and once the email has been received, log back in to the Red List website
and click on the My Downloads Tab to get back to your saved searches.
4
Using open source GIS software to support REDD+ planning
The next steps are for downloading spatial data. It is only possible to download the whole global
dataset. It is not possible to filter by county prior to download. It is important to note that some of the
spatial datasets are very large. If you have received the spatial data directly from IUCN you can skip
this section.
5
Using open source GIS software to support REDD+ planning
d. Click the links to navigate to each dataset and download the following global datasets:
Mammals
Amphibians
Birds (via the link to the BirdLife Data Zone)
(Leave Reptiles for now as assessment is not yet complete for all species)
These files are all stored in geographic coordinate system (EPSG: 4326). Be aware the files are
very large and will take some time to download.
Note: If you have received the spatial data directly from IUCN they may have delivered as a
single geodatabase containing all taxa in a single feature class rather than as separate files.
2.2.1. Format species CSV file in preparation for joining to the spatial data
a. Open the 'exported search' results csv file (that was downloaded in section 2.3 step m) e.g.
NGA_AmpAveMam.CSV in this example. Open the file Excel (or if using completely open
source software in Gnumeric or Libre Office Calc) (The Screengrab examples below use Excel.
6
Using open source GIS software to support REDD+ planning
b. Scroll along the column headings of the table. Some will need to be changed as GIS software
such as QGIS will not accept them. Change the ones listed below in red
OLD Field Name New Field Name
Species ID = Species_ID
Kingdom = Kingdom
Phylum = Phylum
Class = Class
Order = Order
Family = Family
Genus = Genus
Species = Species
Binomial = Binomial
Authority = Authority
Stock/subpopulation = stk_subpop
Synonyms = Synonyms
Petitioned = Petitioned
7
Using open source GIS software to support REDD+ planning
c. Click File>>Save to save the file (keeping the file format as csv). If it asks if you want to keep
the file in this format click yes
Keep the CSV file open as it will be used in section 2.6 where we will use the 'species_id'
column to prepare an SQL query to be used in QGIS.
d. Open a text editor and create a new empty csv file and add the following text to correspond
to the data types of each of the columns in the .csv file. e.g. the Species_ID column should
contain integer values
"integer","string","string","string","string","string","string","string","string","integer","string",
"string","string","string","string","string","string","string","string","string","string","string","st
ring"
These are the data types for each of the fields in the species csv file.
e. Save the file with the same name and in the same folder as the species csv file but with the
a .csvt ending e.g. NGA_AmpAveMam.csvt in this example
This will ensure that when the file is opened later in QGIS that the numeric (Integer) fields are read
with the correct data type, otherwise QGIS will default to making all the fields text (string).
The next steps will prepare an SQL query which will be used QGIS to select out the polygons from
the large spatial dataset which are in the species list. This method is being used rather than using a
'join' to join the species list to the spatial data because the join function often fails or causes errors
on this very large spatial dataset.
8
Using open source GIS software to support REDD+ planning
g. In row 2 of column A type "id_no" = a (make sure you put a space after the equals sign as this
is important for the SQL syntax we are creating
h. In row2 of column C type OR(this time make sure you put a space before the OR as this is
important for the SQL syntax we are creating.)
i. In row 2 of column D type =A2&B2&C2
l. Save the worksheet for later to a new file e.g. in this example called
formatted_for_SQL_query.xlsx and close
2.2.2. Use SQL query to select species of interest from spatial dataset
The next section prepares the spatial data ready for analysis. The IUCN spatial dataset is a complex
dataset as it contains many overlapping polygons for each species for the entire world. Even
subsetting the dataset for your area of interest can be problematic so these set of instructions are
important steps to make sure the analysis runs as smoothly as possible and to reduce the risk of
errors in processing.
a. Open QGIS
b. Add in the IUCN Species
spatial dataset(s) (the data
are in geographic
coordinate system (i.e.
EPSG:4326)
9
Using open source GIS software to support REDD+ planning
d. Add in a polygon dataset of the area of interest (e.g. country boundary) e.g. in this
example nga_border_dd.shp. Make sure the dataset is in geographic coordinate
system (i.e. EPSG:4326) to match the coordinate system of the IUCN spatial data
e. Click on the IUCN spatial dataset in the table of contents to make it the active layer
e.g. in this example iucn_rl_species_2014_2_no_sens
g. A Query window appears. Copy and paste into the Query window the SQL query that
you created earlier. This will select out only those species present in the exported
species list
h. Remove the OR from the last row and click Test to
check you got the syntax correct. This may take 5 -
10 minutes or longer depending on how many
records are being selected. If correct it should
return the number of rows selected
10
Using open source GIS software to support REDD+ planning
Note: This number does not equate to the number of species but to the number of
polygons so you cannot use this to check that the number of species it has selected is
correct.
Note the attribute table shows only the records filtered by the SQL query.
11
Using open source GIS software to support REDD+ planning
2.2.3. From the previous selection select out the current native species range
c. Click Test
d. Click OK to close the
Query Result window
12
Using open source GIS software to support REDD+ planning
i. Click OK
2.2.4. From the previous selection select out terrestrial species ranges
13
Using open source GIS software to support REDD+ planning
f. Right click on the subset IUCN spatial dataset e.g nga_iucn_selection_PO.shp in this
example and Click Save as
g. Save the file with a new name. e.g. nga_iucn_selection_PO_T.shp in this example
2.2.5. Split the final subset IUCN dataset into separate files by species
14
Using open source GIS software to support REDD+ planning
d. Select an output folder for the split species range files. e.g. in this example
C:\NGA_SpeciesRichness\nga_iucn_selection_PO_T_splits
e. Click OK
a. In QGIS 1.8 go to Analysis>>SEXTANTE toolbox (or in QGIS 2.8. Processing menu >>
Toolbox.
d. In the input layer column, click on the ‘...’ box and select all of the species range files
that you want to clip (use the shift key to select multiple files).
e. In the clip layer column, click on the ‘...’ box and select the vector boundary file
covering your area of interest.
f. Double click on the top of the clip layer column, to fill every cell. (This is the bit that
does not work in QGIS 1.8 and you have to copy and paste the contents into every row)
15
Using open source GIS software to support REDD+ planning
g. In the clipped column, click on the ‘...’ box and select the location to store your clipped
files and type a new name e.g. clip.shp (this will be the name preceding the filename of
the clipped files)
h. In the pop-up box, under Autofill
Mode select Fill with parameter
values.
i. These parameter values should be set
from the input layer.
j. Click OK.
k. Click Run
16
Using open source GIS software to support REDD+ planning
d. Double click on the SAGA Merge shapes layers tool. This is the only tool currently available
that lets you merge more than two shapefiles at once.
e. Click on the … next to the Main Layer and navigate to the folder containing the clipped
shapefiles. Pick the first shapefile in the list e.g. in this example
clipnga_iucn_selection_PO_id_no__219.0.shp
17
Using open source GIS software to support REDD+ planning
As we removed all other layers from the table of contents we can click ‘select all’. This adds the
rest of the species layers which will be merged with the layer chosen as the main layer.
h. Click OK
i. Click on the … next to Merged Layer and navigate to an output folder and save the Merged
Layer with a new name e.g. in this example mergedclips_nga_iucn_selection_PO.shp
18
Using open source GIS software to support REDD+ planning
j. Click Run
h. Click OK
19
Using open source GIS software to support REDD+ planning
i. Remove all layers from your QGIS project except the singlepart species dataset generated in
the previous step
e.g. in this example C:\Workspace\NGA_Species_richness\SP_dissolvedmergedclips
_nga_iucn_selection_PO .shp
In subsequent steps a layer called a planning unit layer will be generated in order to summarise the
species range data to create a species richness map. The planning unit layer may simply be a regular
grid of squares or hexagons across the area of interest or an irregular summary unit for example
territories within a country. The species range and the planning units layers must be projected to an
equal area projection (e.g. Lambert Azimuthal Equal Area). Using an equal area projection allows the
true area of the species ranges in each planning unit to be calculated. Whichever projection is chosen,
both the species ranges and the planning units must be in exactly the same projection.
In this example, the data are in CRS EPSG:4326 (a geographic coordinate system with units in decimal
degrees). In order to generate a planning units dataset of hexagons with a specific area, the data need
to be projected into an equal area CRS with units of meters. In the following example Lambert-
azimuthal-equal-area projection is used.
Note: - The there is currently a bug in the project tool in QGIS 2.8 and therefore below we are using
the right-click>> save-as option to change the projection
There may be an appropriate equal area projection that is already defined within QGIS suitable for
your area of interest, or you may have already defined a custom projection. To create a new a custom
projection follow the instructions in Box D.
a. To project the data Right Click on the singlepart species dataset and Click Save as...
20
Using open source GIS software to support REDD+ planning
b. Choose Selected CRS and click Browse next to the Save as box to create a new output
dataset e.g. SP_dissolvedmergedclips_nga_iucn_selection_PO_la.shp in this example
c. Click on Change to change the output ptojection. In this example we are using a custom
Lambert -azimuthal-
equal-area
projection.
b. Remove the
Geographic version
of the datasets from
the QGIS project to
reduce confusion.
21
Using open source GIS software to support REDD+ planning
Box D
22
Using open source GIS software to support REDD+ planning
Check for topological errors in the data as these could prevent the Qmarxan plugin working correctly.
Check for geometry errors in the projected IUCN and the country boundaries shapefiles
j. From the vector menu click Geometry Tools>>Check geometry validity. Run for both
dataset. (Remember to click OK to run the tool)
If errors are reported continue to step 2.2.11, otherwise go straight to section 2.3
23
Using open source GIS software to support REDD+ planning
Note: If the dataset is very large and QGIS is failing to clean the dataset the clean tool can be run in
the native GRASS interface. Some guidance notes are provided in the Annex for cleaning a dataset
natively in GRASS.
24
2.3. Vector analysis to create species richness (in QGIS 1.8 only as requires QMarxan
plugin)
a. The next step is to use the planning units file to generate a count of number of
threatened species in each planning unit hexagon
b. From the Plugins menu click
Qmarxan>>Calculate Conservation Values
26
Using open source GIS software to support REDD+ planning
l. Click Save
m. Click Run
2.3.3. Check any errors located in the error log and spot-check for quality control
27
Using open source GIS software to support REDD+ planning
b) Right Click on the Planning Unit Layer and open the attribute table
c) Select the PU and zoom to it in the map canvas
f) The number selected should match with the count in the ‘mam’ field in the Planning Unit
Layer. Check again by drawing the polygon around the hexagon and if necessary alter the
value in the ‘mam’ field to match the number selected
The dataset can then be symbolized and placed in a map layout as in the example below
Below is an Example map output
Example Map
28
Annex1 : Cleaning the topology using GRASS GIS
GRASS GIS works best as a standalone programme, although it does have a QGIS plug-in, so many of
the GRASS tools are also available in QGIS. You may have used the GRASS v.clean tool from within in
QGIS). This example runs through cleaning of the IUCN data which can be a very large dataset
depedning on your area of interest and how many species you are working with. The standalone
version of GRASS is automatically installed when you install QGIS.
d. Click Next
f. Click Next
Using open source GIS software to support REDD+ planning
i. Click Finish
j. Click OK
30
Using open source GIS software to support REDD+ planning
b. Click Run.
c. Check the command console to
find the results of the v.build. If
there is no warning message you
can now export the file from GRASS (goto step p)
If there is an error message, you now have two choices (see Box B or Box C)
31
Using open source GIS software to support REDD+ planning
If the import didn’t take too long, you might prefer to re-import the file into GRASS, but this
time setting a snapping threshold.
a. To re-import the file and set a
snapping threshold, go back to
[v.in.ogr], as in step k, but this
time inlude an additional step
and click Command dialog
b. In the new window, browse to
find your species range file, and
select a name for output vector
map (the name of the new file
within GRASS)
32
Using open source GIS software to support REDD+ planning
If the import was very slow, the other option is to continue using the uncleaned species range file
(the one that existed prior to the import into GRASS). Follow sections 2.9 and 2.10 to reproject
the file and to split it, creating separate files for each species. Then check for topology errors in
these separate species files (section 2.7) and where necessary clean these in GRASS, by repeating
the process described in section 2.8. If the files have been reprojected, they will require a new
‘project location’ in GRASS (simply repeat the process described in 2.8 a).
p. To export the file from GRASS, go to the File menu >> Export vector map > >Common
export formats [v.out.ogr]
q. Select the name of the file you want to export (it will have @PERMANENT at the end of
the file name) and under OGR output datasource name write the file path of the chosen
export location.
33
Using open source GIS software to support REDD+ planning
u. Close GRASS.
v. Open QGIS and add the cleaned file that you exported from GRASS.
w. Use the ‘Add Vector layer button.
x. Check whether any topological errors remain (see section 2.7).
Make note of the species that are still affected by these errors, you may need to check these
manually and select them out and clean them on their own.
34