Connecting Wildlife Habitat

Kamille Mendoza
Kamille Mendoza

September 30, 2024


'''''''''''''''''''''''''''
Terrain Ruggedness - DEM
'''''''''''''''''''''''''''
env.workspace = ws
prjDEM = Raster("DEM")

#create the terrain ruggedness from the DEM using FOCAL STATISTICS
#calculate the range of the DEM with a 3x3 rectangle

Ruggedness = FocalStatistics(prjDEM, NbrRectangle(3, 3, "CELL"), "RANGE")

#save the raster
Ruggedness.save("Terrain_R") #saves the raster
messages()

'''''''''''''''''''''''''''
Reclassify Landcover
'''''''''''''''''''''''''''

#convert LC feature class to raster
arcpy.conversion.PolygonToRaster("AB_Landcover", "LC_class", "LandCover", "CELL_CENTER", "", 25, "BUILD")

#set raster as object
LC = Raster("LandCover")

#reclassify Landcover
rclass_LC = Reclassify(LC, "VALUE", RemapValue([[20, 10], [31, 8], [32,7], [33,6], [34,10], [50, 3], [110,2], [120, 9], [210,1], [220,1], [230, 1]]))
print(f"{LC} reclassified")
rclass_LC.save("rclass_LC")
messages()
#set the workspace
env.workspace = wsScratch

#use Weighted Sum to combine all cost surfaces
weighted_sum = WeightedSum(WSTable([[rscale_Hydro, 'VALUE', 1], [rscale_Trails, 'VALUE', 1], \
[rscale_Road, 'VALUE', 1], [rscale_tr, 'VALUE', 1], [rclass_LC, 'VALUE', 1]]))
print("Cost surface created using the weighted sum tool")
messages()
#save the combined cost surface
weighted_sum.save("cost_surface")

'''''''''''''''''''''''''''
Create Optimal Routes
'''''''''''''''''''''''''''
#create the Optimal Routes using the OPTIMAL REGION CONNECTIONS TOOL
optimal_routes = OptimalRegionConnections("Layer", "Routes","", weighted_sum)
print ("Optimal Routes created")
messages()

#use zonal statists as table to determine the average elevation of Kananaskis Country
ZonalStatisticsAsTable(InZoneData, ZoneField, InValueRaster, OutTable, "", "MEAN")
print("Create table that contains the average elevation")
messages()
print("")

Project Overview:

Grizzly bears and black bears need room to roam, and the topography of Kananaskis Country west of

Calgary provide these bears the space they need to scavenge, hunt and breed. The bear habitat is

becoming fragmented into isolated patches because of the increase in human population. Connecting

the habitat patches by creating wildlife corridors will provide adequate space for the bear population

and will also allow bears in the different patches to breed, keeping up the population and genetic

diversity. In this project, you will use Python to create a geoprocessing model identifying the optimal

routes for these corridors. (GEOS456 Final Project)

Objective: Write a script using Python to create a geoprocessing model that identifies the potential routes for wildlife corridors


Plug-ins used

arcpyos

tags

ArcpyautomationPythonSpatial Analysis

You might also like

Join the community!

We're a place where geospatial professionals showcase their works and discover opportunities.