Which areas are good cougar habitat?

Introduction

Cascadia state park is a recreational paradise for camping, picnicking and hiking in the state of Oregon, US. Many visitors usually hike from the park to Soda Creek Falls on trails or old logging roads that continue into the Willamette national forest. It is about a mile and half from park. Research by US forest service indicates that the national forest is a habitat of approximate 6,400 cougar's population. With increase in cougar population, there is a tremendous increase in sightings by people. Park officials are therefore concerned about the safety of their visitors. On the other hand, they don't want to alarm potential visitors as this would mean reduced funding for the park in next year's state budget.

In view of this, a technical committee is set up, with wildlife experts from three agencies (State Park, National Forest, state's Department of Fish and Wildlife) to undertake a study of cougar populations in and around the park.

This sample presents an approach to using ArcGIS API for Python to help committee identify potential cougar habitat. The process uses suitability analysis to identify areas that meet the specified criteria. Through this notebook, we will demonstrate the utility of a number of spatial analysis tools including create_buffer, extract_data, dissolve_boundaries, and derive_new_locations.

Further, based on the results of the analysis, the committee can identify large habitat areas for various management goals - conservation, management of wildlife, recreation, and so on.

Workflow

Necessary Imports

Input
%matplotlib inline

import pandas as pd
import matplotlib.pyplot as plt
from IPython.display import display
from datetime import datetime as dt

from arcgis.gis import GIS
from arcgis.features.use_proximity import create_buffers
from arcgis.features.manage_data import dissolve_boundaries
from arcgis.features.manage_data import extract_data
from arcgis.features.find_locations import derive_new_locations

Connect to your GIS

Input
gis = GIS('home')

Get the data for analysis

Search the GIS for feature layer collections by specifying the item type as 'Feature Layer Collection' or 'Feature Layer'. We will specify our search by specific tag as cougar_habitat_case_study.

Input
items = gis.content.search('cougar_habitat_case_study', 'Feature Layer')
Input
for item in items:
    display(item)
cougar_habitat_case_study
Which areas are good cougar habitat?Feature Layer Collection by api_data_owner
Last Modified: December 04, 2019
0 comments, 4 views

We will use the first item for our analysis. Since the item is a Feature Layer Collection, accessing the layers property will give us a list of FeatureLayer objects.

Input
cougar_item = items[0]

The code below cycles through the layers and prints their names.

Input
for lyr in cougar_item.layers:
    print(lyr.properties.name)
state_park
vegetation
slope
subwatersheds
highways
streams

Let us assign a variable to each of these feature layers.

Input
state_park = cougar_item.layers[0]
vegetation = cougar_item.layers[1]
slope = cougar_item.layers[2]
sub_watershed = cougar_item.layers[3]
highways = cougar_item.layers[4]
streams = cougar_item.layers[5]

Let's plot the state park on map for visualization.

Input
m1 = gis.map('oregon')
m1
Output
Input
m1.zoom_to_layer(state_park)
m1.add_layer(state_park)

Defining the project boundary

Park officials are mainly concerned with the area in and around the park where visitors might encounter a cougar. Their surveys have found that many people hike, at most, about three miles from the park (a six-mile round trip), an area that encompasses the trails leading into the national forest.

Identify the area within three miles around the state park

To create the buffer layer, we will use create_buffers tool and specify the distance of 3 miles. This will create proposed area boundary for park officials.

Input
buffer_park = create_buffers(state_park, 
                             dissolve_type='Dissolve', 
                             distances=[3],
                             ring_type='Rings', 
                             units='Miles', 
                             output_name="BufferPark" + str(dt.now().microsecond))
Input
buffer_park
Output
BufferPark502634
Feature Layer Collection by arcgis_python
Last Modified: December 04, 2019
0 comments, 0 views
Input
m2 = gis.map('oregon')
m2
Output
Input
m2.zoom_to_layer(buffer_park.layers[0])
m2.add_layer(buffer_park.layers[0])

However, since DFW has several cougar habitat mapping projects in progress, they have been mapping wildlife habitat watershed-by-watershed in other parts of the state. Therefore, they suggest major watersheds that includes the park and the western portions of the forest as the study area. Given the available funding, the committee members decide to limit the study area to three sub watersheds in the southeast portion of the major watershed. This area encompasses the state park and a portion of the national forest.

Create the study area boundary

We will apply a filter on sub watersheds layer to select the ones that cover state park as well as major portion of national forest.

Input
sub_watershed.filter = '(HUC5_ID = 550) OR (HUC5_ID = 556) OR (HUC5_ID = 569)'

Then we will use the dissolve_boundaries tool to erase the boundaries between the filtered sub-watersheds, creating a new layer containing the study area boundary.

Input
state_area_boundary = dissolve_boundaries(sub_watershed, 
                                          output_name='DissolveBoundaries' + str(dt.now().microsecond))
Input
state_area_boundary
Output
DissolveBoundaries65627
Feature Layer Collection by arcgis_python
Last Modified: December 04, 2019
0 comments, 0 views
Input
m3 = gis.map('oregon')
m3
Output
Input
m3.zoom_to_layer(state_area_boundary.layers[0])
m3.add_layer(state_area_boundary.layers[0])

Create a layer of highway features within the study area

The extract_data tool is used to extract data from one or more layers within a given extent. The extracted data format can be a file geodatabase, shapefiles, csv, or kml. File geodatabases and shapefiles are added to a zip file that can be downloaded. for more details click here.

To clip features using another layer, we will extract the features to a file, download the file to local device, and then add the file containing the features back into layer.

Input
ext_state_highway = extract_data(input_layers=[highways],
                                 extent=state_area_boundary.layers[0],
                                 clip=True,
                                 data_format='shapefile',
                                 output_name='ext_state_highway' + str(dt.now().microsecond))
Input
ext_state_highway
Output
ext_state_highway472341
Analysis file item generated from running the Extract Data tool.Shapefile by arcgis_python
Last Modified: December 04, 2019
0 comments, 0 views

The shapefile can now be published as feature layer collection by using publish method.

Input
clipped_highway_lyr = ext_state_highway.publish()
Input
display(clipped_highway_lyr)
ext_state_highway472341
Analysis file item generated from running the Extract Data tool.Feature Layer Collection by arcgis_python
Last Modified: December 04, 2019
0 comments, 0 views
Input
m4 = gis.map('oregon')
m4
Output
Input
m4.zoom_to_layer(clipped_highway_lyr)
m4.add_layer(state_area_boundary)
m4.add_layer(clipped_highway_lyr)

What is suitable cougar habitat?

In order to find out suitable cougar habitat, the method that DFW has been using for its other habitat studies is suitability analysis, and, for consistency, the committee members decide to stick with this approach for the current study.

In suitability analysis, criteria are specified for what makes an area suitable for a particular use such as a housing subdivision, a wind farm, or cougar habitat. The criteria are often based on firsthand experience, expert knowledge (including published studies), or industry standards.

The committee discuss the following criteria for the study area:

  1. slope: The first criterion is terrain. Earlier studies by DFW indicate that cougars are generally found on steep slopes. Hence, it is a preferred habitat.
  2. Vegetation: Studies by wildlife experts indicate that cougars are likely to be found in forested areas that provide cover for hunting. Three forest types within the study area clearly constitute suitable habitat i.e. True Fir-Hemlock Montane Forest (code 34), Douglas Fir-Western Hemlock-Red Cedar Forest (code 49), and Mixed Conifer/Mixed Deciduous Forest (code 67). State park officials considers including Regenerating young forest (code 121) as one of the preferred areas of cougar habitat.
  3. Streams: The DFW experts present research showing that cougars have a wide home area and can easily find water, although the presence of streams might provide better habitat. The research has found that the area within 2,500 feet of a stream can be considered preferred habitat. The experts from the state park counter with a study by a local college showing that cougars often use streams and riparian areas as corridors to move around their territory. They believe preferred habitat should be limited to areas within 500 feet of a stream.
  4. Highways: The experts from DFW and the national forest cite research showing that in areas where there are many roads there may be fewer prey (deer and elk), which can make the area less desirable habitat for cougars. But there is only one major road in the study area. They believe that cougars might stay at most 500 feet away from the highway, but even then they would likely approach or cross the highway in search of prey. The experts from the state park believe that the presence of cars and people on the roads within the park would tend to make the immediate area less desirable for cougars. They suggest excluding as habitat the area within 1,500 feet of the highway, which would cover the roads inside the park.

The state park officials are mainly interested in identifying cougar habitat in the vicinity of the park, to ensure the safety of their visitors. The table below lists general criteria and specific values for both approaches.

Identify the area that are suitable cougar habitat using the criteria defined by the experts from the state park

The derive_new_locations tool allows you to combine attribute and spatial criteria in a single statement by adding a set of expressions, one at a time. A new layer of areas that meet the specified criteria is created.

Before running derive_new_locations, we will filter the vegetation layer to select three vegetation types to be included: codes 34, 49, 67. We can actually specify the vegetation criteria in the Derive New Locations tool, but using the filter first will create a simpler selection statement. It will also streamline the process when we run the analysis again using the criteria defined by the Department of Fish and Wildlife.)

Input
vegetation.filter = '(VEG_CODE = 34) OR (VEG_CODE = 49) OR (VEG_CODE = 67)'

Criteria defined by park officials for identifying suitable cougar habitat.

  • Slope where GRIDCODE is 1
  • Slope intersects Vegetation
  • Slope within a distance of 500 feet from Stream
  • Slope not within a distance of 1500 feet from Highway
Input
potential_cougar_habitat_A = derive_new_locations(input_layers=[slope, vegetation, streams, highways],
                                           expressions=[{"operator":"","layer":0,"selectingLayer":1,"spatialRel":"intersects"},
                                                        {"operator":"and","layer":0,"selectingLayer":2,"spatialRel":"withinDistance","distance":500,"units":"Feet"},
                                                        {"operator":"and","layer":0,"selectingLayer":3,"spatialRel":"notWithinDistance","distance":1500,"units":"Feet"},
                                                        {"operator":"and","layer":0,"where":"GRIDCODE = 1"}],
                                           output_name='derive_new_loactions' + str(dt.now().microsecond))
Input
m5 = gis.map('oregon')
m5
Output
Input
m5.zoom_to_layer(potential_cougar_habitat_A.layers[0])
m5.add_layer(potential_cougar_habitat_A)

Identify areas that are suitable cougar habitat using the criteria defined by the experts from DFW

First, we will edit the Vegetation filter to add the timber harvest areas. Add a fourth expression and specify VEG_CODE is 121

Input
vegetation.filter = '(VEG_CODE = 121)'

Criteria defined by DFW for identifying suitable cougar habitat.

  • Slope where GRIDCODE is 1
  • Slope intersects Vegetation
  • Slope within a distance of 2500 feet from Stream
  • Slope not within a distance of 500 feet from Highway
Input
potential_cougar_habitat_B = derive_new_locations(input_layers=[slope, vegetation, streams, highways],
                                           expressions=[{"operator":"","layer":0,"selectingLayer":1,"spatialRel":"intersects"},
                                                        {"operator":"and","layer":0,"selectingLayer":2,"spatialRel":"withinDistance","distance":2500,"units":"Feet"},
                                                        {"operator":"and","layer":0,"selectingLayer":3,"spatialRel":"notWithinDistance","distance":500,"units":"Feet"},
                                                        {"operator":"and","layer":0,"where":"GRIDCODE = 1"}],
                                           output_name='derive_new_loactions' + str(dt.now().microsecond))
Input
m6 = gis.map('oregon')
m6
Output
Input
m6.zoom_to_layer(potential_cougar_habitat_B.layers[0])
m6.add_layer(potential_cougar_habitat_B)

Conclusion

The state park officials can see that their criteria resulted in a very limited cougar habitat area. The staff from DFW and the national forest, however, are confident that the results created using their criteria are a good first attempt at identifying potential cougar habitat.

Thus, scientists from DFW and the national forest decide to work together to field check the results, looking for evidence of cougars inside, as well as outside, the potential habitat areas.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.