Due: 5pm Fri, Mar 20 2015 via GauchoSpace


In this conservation planning lab, you’ll work with software Marxan to select sites for a reserve network that maximise species richness while minimizing site selection cost. In previous labs, you built a single species distribution model, evaluated connectivity between species habitat patches and calculated community metrics for species diversity between sites. As explained by Watson et al (2011) from this week’s readings, site selection for a reserve network should include additional sites which are complimentary to existing sites for maximizing species diversity. This problem is generally formulated in one of two ways:

  1. Minimum set problem. Given a set of sites with various species compositions and costs for selection, what is the minimum set of sites that represents all species at the lowest cost?

  2. Maximal coverage problem. Given a budget limit to total cost of sites selected, what is the maximum coverage of species representation possible?

In practice, these conservation features of interest may be “fine filter” targets such as individual species, or “coarse filter” targets such as a general habitat (ie land cover class, or other environmental proxy).

Marxan uses the following input files [rows X columns] which you can find in the provided scenario_01/input folder:

Marxan uses an objective function to minimize the value (\(V\)) of selecting sites, ie planning units, with minimal cost along with minimal penalty (\(spf\)) of excluding conservation feature targets:

\[ V = \sum_{pu_+} cost + \sum_{spp_-} spf + [BLM \sum_{pu_+} boundary] \]


Optionally, clumping of sites can be encouraged by penalizing more boundary length with the boundary length modifier (\(BLM\)). Boundaries that are shared between sites get dropped.

Set Environment

Set your working directory in the R chunk below.

Planning Units and Species

For conservation features, you’ll use Maxent species distribution models from the 20 species selected by students in lab 6 (see data/lab6_species.csv). For planning units, you’ll use hexagons roughly equivalent to pixels 4 x 4 km (edge = 2.3 km * 6 = 13.9 km; area = 13.9 km\(^2\)). The hexagon planning units are much bigger than the original Maxent outputs (0.5 minute), and also constrained to Santa Barbara County which is a tighter extent than the Maxent bounding box. The Maxent outputs were converted to binary based on a 20% threshold as with lab 6 and the proportion of presence pixels (versus not) assigned to the \(amount\) of species present in the pixel in the pu_vs_spp.csv file. To see how these data were prepared, you can look at lab9_prep.R which generated the data/pu.shp and scenario_01/input files for you.

Let’s look at our planning units (pu):

plot of chunk plot_pu-id

And our total species amounts per planning unit:

plot of chunk plot_spp-amounts

And table of species by sorted in descending order by sum of total amount:

species_id name amount_sum
8 Buteo regalis 450.364
20 Solanum xanti 427.140
19 Sciurus griseus 425.132
2 Accipiter striatus 417.392
7 Athene cunicularia 398.177
16 Phrynosoma coronatum 391.439
11 Elanus leucurus 356.974
15 Passerina caerulea 328.305
6 Antrozous pallidus 317.469
1 Accipiter cooperii 291.556
4 Ammodramus savannarum 274.460
14 Mimulus aurantiacus 259.778
13 Lanius ludovicianus 207.936
18 Quercus parvula 206.407
10 Cnemidophorus tigris 199.492
17 Pinus muricata 189.641
12 Icteria virens 178.191
5 Amphispiza belli 92.414
9 Catharus ustulatus 30.520
3 Agelaius tricolor 8.799

Notice that some species still have relatively low abundance. Let’s plot a few different species amounts to see the spatial differences…

plot of chunk plot_species-examplesplot of chunk plot_species-examplesplot of chunk plot_species-examplesplot of chunk plot_species-examplesplot of chunk plot_species-examples

1 Run Marxan [scenario_01]

For your first Marxan scenario scenario_01, the input files have been created for you. Notice that the input paramaters (including paths to input files) are described in the input.dat text file can be edited in a GUI by double-clicking on Inedit.exe.

For quick tips on any of these parameters hover your cursor over the parameter. For thorough details, check out the manual and handbook in the references folder.

For this scenario, you shouldn’t change any of the paramaters or input files. You just need to double-click the marxan.exe executable inside the scenario_01 folder to run Marxan. You should see a black command window open and show log output of Marxan for each run.

Once it’s finished, you can press return to exit.

Look at the output files generated by running Marxan, with dimensions [rows X columns] given for csv files:

Knit this document again to consume the Marxan outputs and plot a figure of the best solution (best) and sum of all solutions (ssoln), which for any planning unit has the maximum value of the number of runs. If a planning unit is at the max possible value of runs, then it may be considered “irreplacable” whereas the other planning units with lower values can be more flexibly swapped out to acheive a similar result.

## [1] "Marxan output file not found: scenario_01/output/out_best.txt"

Question: How many of the conservation features have their target amount met by the best solution?

2 Explore tradeoff between planning unit cost and conservation feature penalty [scenario_02]

Make a copy of scenario_01 and rename to scenario_02. I recommend deleting the files inside the output subfolder when you do this so you don’t get confused as to whether you ran Marxan yet or not for this scenario.

For this scenario, let’s explore the tradeoff between cost of planning units and penalty of not meeting conservation features. Based on the objective function (above equation), you would expect that if the cost of planning units was sufficiently high relative to the penalty of conservation features, you would get a best solution that would not meet all conservation feature targets, effectively switching the problem from a minimum set to maximum coverage problem.

Try this in by either increasing the cost of all planning units (pu.csv:cost = 1) or reducing the penalty of all conservation features (spp.csv:spf = 10) until you get an unmet conservation feature in the best solution, which you can quickly tell by any of the following methods:

  1. in command window, scroll up to run of best solution, value to right of Missing > 0? (quickest)

  2. in output_mvbest.txt:“Target Met” column has a No?

  3. in output_sum.txt:“Missing_Values” column for run of best solution > 0?

Until you get an unmet conservation feature target, sequence by orders of magnitude (ie cost 1 to 10 to 100…, or spf 10 to 1 to 0.1…). (I recommend doing this by double-clicking the file to open in Excel, updating the first value and using the lower-right of cell crosshair double-click trick to automatically fill down. Save the file to update CSV and disregard Excel’s suggestion to save in native format when closing.)

Knit again to plot the result below.

## [1] "Marxan output file not found: scenario_02/output/out_best.txt"

Question: At what combination of values for planning unit cost vs. conservation feature penalty did you get an unmet conservation feature in the selected set?

Question: Were more or fewer sites selected in the best solution than in scenario_01? Was there more or less flexibility in selection of sites between scenarios as evidenced in sum of solutions? Does this make sense to you based on the objective function?

3 Explore use of boundary length modifier (BLM) [scenario_03, scenario_04, scenario_05]

Make a copies of scenario_01 and rename to scenario_03, scenario_04, scenario_05. I recommend deleting the files inside the output subfolder when you do this so you don’t get confused as to whether you ran Marxan yet or not for this scenario.

For these scenarios, you’ll investigate the use of the boundary length modifier to clump selected planning units. Use the Inedit.exe to enter alternative values of BLM. Try 0.1, 1 and 10 for scenarios 3, 4 and 5 respectively.

## [1] "Marxan output file not found: scenario_03/output/out_best.txt"
## [1] "Marxan output file not found: scenario_04/output/out_best.txt"
## [1] "Marxan output file not found: scenario_05/output/out_best.txt"

Question: How many components (contiguous clusters of sites) are in each of your best solutions as a function of BLM?

4 Vary planning unit cost by landcover [scenario_06]

For the next two scenarios, you’ll use the national landcover dataset (NLCD 2011) to impose higher planning unit cost on developed areas and add “coarse filter” habitats as additional conservation features.

The new spatially heterogenous planning unit cost values were extracted from the NLCD reclassifed by the values in data/nlcd_cost.csv.

code nlcd_class pu_cost
0 No Data 0
11 Open Water 0
21 Developed, Open Space 50
22 Developed, Low Intensity 100
23 Developed, Medium Intensity 250
24 Developed, High Intensity 500
31 Barren Land (Rock/Sand/Clay) 0
41 Deciduous Forest 0
42 Evergreen Forest 0
43 Mixed Forest 0
52 Shrub/Scrub 0
71 Grassland/Herbaceous 0
81 Pasture/Hay 50
82 Cultivated Crops 50
90 Woody Wetlands 0
95 Emergent Herbaceous Wetlands 0

In the following three plots, you see:

  1. the original landcover NLCD 2011 raster with the empty planning unit hexagons on top

  2. the NLCD reclassified to cost using the table above, again with empty planning unit hexagons on top

  3. the cost per hexagonal planning unit, which is the extracted average cost of pixels inside

plot of chunk plot_costplot of chunk plot_costplot of chunk plot_cost