Methodology
Overview of steps:
- Turn cultural resources, natural resource, infrastructure/facilities into a mosaic raster.
- Re-scale the elevation measurements so the lowest elevation is 1 and the highest elevation is 0.
- Code the land cover using reclassify (Dense vegetation = 0, Shrubs/mixed vegetation = 0.5, No vegetation = 1).
- Re-scale the distance from the sandy shorelines so the cells closest to sandy shorelines are 1 and the cells furthest from the sandy shorelines are 0.
- Re-scale the distance from retreating bluffs so the cells closest to bluff are 1 and the cells furthest from the bluff are 0.
- Calculate cell statistics of CFEP zones of Mass CZM rasters. Use this information to reclassify values into 10% and 1% raster grids. Areas within CFEP zones are valued at 1 and outside of zones are 0. Repeat this process for each Sea Level Rise Scneario (2030, 2050, and 2070).
Workspace set-up
#Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
= "C:/BOHA_SpatialDecisionSupportSystem/Data"
arcpy.env.workspace ="C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Scratch.gdb" env.scratchWorkspace
Data processing and clean-up for Coastal Exposure raster grid inputs
R1. Focal Resources Raster Mosaic.
Focal Resources
Input Group 1: Natural Resources (salt marshes, coastal bird habitats, coastal dunes, rare plant species,
Input Group 2: Cultural Resources (National Historic Landmarks, Native American burial sites, etc.)
Input Group 3: Infrastructure/Facilties (piers, park facilities, cottages, shops, etc.)
#Local variables = "Vector_Data.gdb/Focal_Resources_Polys_Merge" Focal_Resources_Polys_Merge = ("C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Scratch.gdb/FR_Merge_PolygonToRaster") Output_Raster_Dataset = ("C:/Users/amyca/OneDrive/Documents/GTECH732_AdvGIS/Final_Project/BOHA_SpatialDecisionSupportSystem/Data/Raster_Output.gdb/FR_Grid") FR_Grid # Step 1. Polygon to Raster (Polygon to Raster) (conversion) = Focal_Resources_Polys_Merge, arcpy.conversion.PolygonToRaster(in_features = "Value", value_field = Output_Raster_Dataset, out_rasterdataset ="CELL_CENTER", cell_assignment="NONE", priority_field="1") cellsize # Step 2. Reclassify Raster (0 = No Focal Resources, 1 = Focal Resources) = Reclassify(in_raster = Output_Raster_Dataset, reclass_field="VALUE", FR_r ="1 1;NODATA 0") remap FR_r.save(FR_Grid)
R2. Raster of localized Boston Harbor Islands conditions that contributes to coastal exposure risk
Erosion Risk
Input 1: Retreating Bluff Zones (0-1)
# Local variables = "Vector_Data.gdb/Bluffs_Retreating" #Polyline vector data of bluffs retreating > 0.1m inSourceData_BR = 1 cellSize = "Vector_Data.gdb/Amy_BOHA9_POLYS" #Boston Harbor 9 Islands Boundary mask_features # Local output save locations = "C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Scratch.gdb/BR_EucDistOut" in_raster_BR = "C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Outputs.gdb/BluffRetreat_Grid" BluffRetreat_Grid #Step 1: Euclidean distance tool with arcpy.EnvManager(mask = mask_features): = arcpy.sa.EucDistance(in_source_data = inSourceData_BR, cell_size = cellSize) BOHA_BluffsRetreating_EucDistance BOHA_BluffsRetreating_EucDistance.save(in_raster_BR)= arcpy.Raster(in_raster_BR) in_raster_BR #Step 2: Re-scale the distance from the fluff retreat zones so the cells closest to bluff retreat zones are 1 and the cells furthest from the bluff retreat zones are 0. = (1-(in_raster_BR - in_raster_BR.minimum)/(in_raster_BR.maximum-in_raster_BR.minimum)) BluffRetreat_Grid BluffRetreat_Grid.save(BluffRetreat_Grid)
Input 2: Distance from sandy shorelines (0-1)
#Local variables = "Vector_Data.gdb/Sandy_Shoreline" #Polyline vector data of "sandy" shorelines inSourceData_SS = "Vector_Data.gdb/Amy_BOHA9_POLYS" #Boston Harbor 9 Islands Boundary mask_features = 1 cellSize # Local output save locations = "C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Scratch.gdb/SS_EucDistOut" in_raster_SS = "C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Outputs.gdb/SandyShoreline_Grid" SandyShoreline_Grid #Step 1: Euclidean distance tool with arcpy.EnvManager(mask = mask_features): = arcpy.sa.EucDistance(in_source_data = inSourceData_SS, cell_size = cellSize) SS_EucDistance SS_EucDistance.save(in_raster_SS)= arcpy.Raster(in_raster_SS) in_raster_SS #Step 2: Re-scale the distance from the sandy shorelines so the cells closest to sandy shorelines are 1 and the cells furthest from the sandy shorelines are 0. = (1-(in_raster_SS - in_raster_SS.minimum)/(in_raster_SS.maximum-in_raster_SS.minimum)) SS_Grid SS_Grid.save(SandyShoreline_Grid)
Input 3: Unvegetated land cover (0 = dense vegetation, 0.5 = partial vegetation, 1 = no vegetation)
# Local variables = "Vector_Data.gdb/Landcover_polys" #Polygons of landcover on the 9 Islands insourceData_LC = 1 cellSize = "Vector_Data.gdb/Amy_BOHA9_POLYS" #Boston Harbor 9 Islands Boundary mask_features # Local output locations = "C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Scratch.gdb/Landcover_Raster" Landcover_raster = "C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Outputs.gdb/Landcover_Grid" Landcover_Grid # Step 1: Turn vector data into raster data with arcpy.EnvManager(mask = mask_features): = insourceData_LC, value_field = "COVERCODE", out_rasterdataset = Landcover_raster, cellsize = cellSize) arcpy.conversion.PolygonToRaster(in_features # Step 2: Code the land cover using reclassify (0 = dense vegetatation, 0.5 = partially vegetated, 1 = no vegetation) = arcpy.sa.Reclassify(in_raster = Landcover_raster, reclass_field = "Value", remap = RemapValue([[2,10],[5,10],[6,5],[7,5],[8,5],[9,0],[10,0],[12,0],[13,0], [14,0],[15,5],[18,5],[19,10],[20,10],[23,10]])) LC_ReclassifyGrid # Step 3: Raster calculator so that vegetation is valued at 0 to 1 = LC_ReclassifyGrid/10 LC_Grid LC_Grid.save(Landcover_Grid)
Food Risk
Input 4: Elevation
# Local variables = arcpy.Raster("Raster_Data.gdb/MA_GCS_3m_NAVDm") #Lidar elevation (m) data of Massachusetts inRaster_Elev = "Vector_Data.gdb/Amy_BOHA9_POLYS.shp" #Boston Harbor 9 Islands Boundary mask_features # Local output locations = "C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Outputs.gdb/Elevation_Grid" Elevation_Grid #Step 1: INVERSE: Re-scale the elevation measurements so the lowest elevation is 1 and the highest elevation is 0. with arcpy.EnvManager(mask = mask_features): = (1-(inRaster_Elev - inRaster_Elev.minimum)/(inRaster_Elev.maximum - inRaster_Elev.minimum)) Elev_Grid Elev_Grid.save(Elevation_Grid)
Storm risk
Input 5: Sea Level Rise 10% AEP
#Local variables = "Raster" Name = "C:/BOHA_SpatialDecisionSupportSystem/Data/MassCZM_folder" MassCZM_folder #Local output locations = fr"C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Scratch.gdb/{Name}CellStats" CellStatistic_Ouput = CellStatistic_Ouput CellStats = "C:/BOHA_SpatialDecisionSupportSystem/Data/Raster_Outputs.gdb/{Name}c_10CFEP" c_10CFEP = c_10CFEP Reclassify_c_10CFEP #Setting the environment (MassCZM_folder = SLR Scenarios 2030, 2050, 2070 and related CFEP Rasters) for Raster, Name in MassCZM_folder: # Step 1: Cell Statistics. This process will calculate a cell-by-cell mean statistic from multiple rasters...the Mass_CZM Coastal Flood Excedence RGB raster data = arcpy.sa.CellStatistics(in_rasters_or_constants = [Raster], statistics_type = "MEAN", CellStatistic_Ouput = "DATA", process_as_multiband = "SINGLE_BAND", ignore_nodata = 90, percentile_value = "AUTO_DETECT") percentile_interpolation_type CellStatistic_Ouput.save(CellStats) # Step 2a: Reclassify and assign cell statistic values to reflect 10% CFEP = arcpy.sa.Reclassify(in_raster = CellStatistic_Output, reclass_field = "VALUE", remap = "0 0;28.666666 0;84.333336 0;85.666664 1;86.666664 0;136 1;140.333328 1;148 0;169.666672 0;170 0;172.666672 0;199 0;208.333328 1", missing_values = "DATA") c2030_10CFEP c_10CFEP.save(Reclassify_c_10CFEP)
R3. Sea Level Rise 1% AEP
#Local Variables = "Raster" Name #Local Ouputs = "C:\\Users\\amyca\\Dropbox (Hunter College)\\BOHA_Final_Project_Products\\Raster_Calculator_Grids\\MassCZM_CFEP.gdb\\c2030_1CFEP" c2030_1CFEP = c_1CFEP Reclassify_c_1CFEP #Setting the environment for Raster, Name in MassCZM_folder: # Step 1: Cell Statistics. This process will calculate a cell-by-cell mean statistic from multiple rasters...the Mass_CZM Coastal Flood Excedence RGB raster data = arcpy.sa.CellStatistics(in_rasters_or_constants = [Raster], statistics_type = "MEAN", CellStatistic_Ouput = "DATA", process_as_multiband = "SINGLE_BAND", ignore_nodata = 90, percentile_value = "AUTO_DETECT") percentile_interpolation_type CellStatistic_Ouput.save(CellStats) # Step 2b. Reclassify and assign cell statistic values to reflect 1% CFEP = arcpy.sa.Reclassify(in_raster = CellStatistic_Ouput, reclass_field = "VALUE", c_1CFEP ="0 0;28.666666 0;84.333336 1;85.666664 1;86.666664 1;136 1;140.333328 1;148 1;169.666672 1;170 1;172.666672 1;199 1;208.333328 1", missing_values="DATA") remap c_1CFEP.save(c_1CFEP)
MCE #1 Raster Calulator Equation
The following equation is what is used to calculate the weights of the final coastal exposure. The weights are easily editable and adjustable depending on the user’s preferences. The local variables can also be swapped out, as long as the user’s raster grids have a value scale of 0 to 1.
#Local variables
= arcpy.Raster("Raster_Outputs.gdb/BluffRetreat_Grid")
BR_Grid = arcpy.Raster("Raster_Outputs.gdb/SandyShoreline_Grid")
SS_Grid = arcpy.Raster("Raster_Outputs.gdb/Landcover_Grid")
VegLC_Grid = arcpy.Raster("Raster_Outputs.gdb/Elevation_Grid")
Elev_Grid = arcpy.Raster("Raster_Outputs.gdb/FocalResources_Grid")
FR_Grid
= arcpy.Raster("Raster_Outputs.gdb/c2030_10CFEP")
SLR2030_CFEP10 = arcpy.Raster("Raster_Outputs.gdb/c2030_1CFEP")
SLR2030_CFEP1 = ("C:/BOHA_SpatialDecisionSupportSystem/Data/CoastalExposure_FR_RiskRatings.gdb/MCE1_GRID2030")
output_raster2030
= arcpy.Raster("Raster_Outputs.gdb/c2050_10CFEP")
SLR2050_CFEP10 = arcpy.Raster("Raster_Outputs.gdb/c2050_1CFEP")
SLR2050_CFEP1 = ("C:/BOHA_SpatialDecisionSupportSystem/Data/CoastalExposure_FR_RiskRatings.gdb/MCE1_GRID2050")
output_raster2050
= arcpy.Raster("Raster_Outputs.gdb/c2070_10CFEP")
SLR2070_CFEP10 = arcpy.Raster("Raster_Outputs.gdb/c2070_1CFEP")
SLR2070_CFEP1 = ("C:/BOHA_SpatialDecisionSupportSystem/Data/CoastalExposure_FR_RiskRatings.gdb/MCE1_GRID2070")
output_raster2070
#Raster Calculator
#SLR 2030
= (((BR_Grid*20) + (SS_Grid*10) + (VegLC_Grid*10) + (Elev_Grid*30) + (SLR2030_CFEP10*30)) *
output1 *
(SLR2030_CFEP1)
(FR_Grid))
output1.save(output_raster2030)
#SLR 2050
= (((BR_Grid*20) + (SS_Grid*10) + (VegLC_Grid*10) + (Elev_Grid*30) + (SLR2050_CFEP10*30)) *
output2 *
(SLR2050_CFEP1)
(FR_Grid))
output2.save(output_raster2050)
#SLR 2070
= (((BR_Grid*20) + (SS_Grid*10) + (VegLC_Grid*10) + (Elev_Grid*30) + (SLR2070_CFEP10*30)) *
output3 *
(SLR2070_CFEP1)
(FR_Grid))
output3.save(output_raster2070)
Apppendix
[1] Land Cover Data
ID | Land Cover Type |
2 | Impervious |
5 | Developed Open Space |
6 | Cultivated Land |
7 | Pasture/Hay |
8 | Grassland |
9 | Deciduous Forest |
10 | Evergreen Forest |
12 | Scrub/Shrub |
13 | Palustrine Forested Wetland (C-CAP) |
14 | Palustrine Scrub/Shrub Wetland (C-CAP) |
15 | Palustrine Emergent Wetland (C-CAP) |
16 | Estuarine Forested Wetland (C-CAP) |
17 | Estuarine Scrub/Shrub Wetland (C-CAP) |
18 | Estuarine Emergent Wetland (C-CAP) |
19 | Unconsolidated Shore |
20 | Bare Land |
21 | Open Water |
22 | Palustrine Aquatic Bed (C-CAP) |
23 | Estuarine Aquatic Bed (C-CAP) |
[2] Mass CZM Rasters