Solved! Go to Solution.
I have delineated a river centreline and interpolated the Z values from a DEM (SRTM 90m) to generate a 3D polyline that represents the river centreline. I have then adjusted the Z values within the 3D river centreline and increased it by 20m and 40m respectively. I've tried to use Visibility Analysis tool to try to generate the floodplain, but the results aren't great even after adjusting the vertical, horizontal and radius parameters. Any alternative would appreciated.
So as explained, I'm trying to delineate the expected inundated surface areas coarsely from the river centreline, based on an adjusted Z value, then trying to determine the horizontal impact area of the DEM that is covered by water.
Regards
#------------------------------------------------------------------------------- # Name: SimulateFlood.py # Purpose: Simulate a Flood # # Source: William A. Huber (Quantitive Decisions) # http://www.quantdec.com/SYSEN597/studies/flood/index.htm # # Created: 14-11-2013 #------------------------------------------------------------------------------- def main(): import arcpy,os arcpy.CheckOutExtension("Spatial") arcpy.env.workspace = r'C:\Project\_Forums\Flooding\fgdb\testflooding.gdb' source = r'C:\Project\_Forums\Flooding\fgdb\testflooding.gdb\source' # The source water body (raster) dem = r'C:\Project\_Forums\cost\fgdb\test.gdb\elevutm16n' # The elevation DEM (raster) floodname = r'C:\Project\_Forums\Flooding\fgdb\testflooding.gdb\Flood_' # outputs # settings nSourceElevation = 100 # The elevation corresponding to the source body nFloodMax = 400 # The maximum flood elevation; must not be less then nSourceElevation nIncrement = 20 # The flooding elevation increment nExtent = 750 # Do not flood outwards more than this many cells. nTiny = 0.9/nExtent # Used for limiting flood extents sourceRas = arcpy.Raster(source) demRas = arcpy.Raster(dem) steps = int((nFloodMax - nSourceElevation) / nIncrement) + 1 for i in range(0,steps): xElevation = (i * nIncrement) + nSourceElevation outname = "{0}{1}".format(floodname,i) cost = (demRas > xElevation)+nTiny costdist = arcpy.sa.CostDistance(sourceRas, cost, "#", "#") flood = costdist <= (nExtent*nTiny) if arcpy.Exists(outname): arcpy.Delete_management(outname) flood.save(outname) sourceRas = arcpy.sa.Log10(outname) # Converts 1 to 0, 0 to NoData del cost, costdist, flood print "ready..." if __name__ == '__main__': main()
I have delineated a river centreline and interpolated the Z values from a DEM (SRTM 90m) to generate a 3D polyline that represents the river centreline. I have then adjusted the Z values within the 3D river centreline and increased it by 20m and 40m respectively. I've tried to use Visibility Analysis tool to try to generate the floodplain, but the results aren't great even after adjusting the vertical, horizontal and radius parameters. Any alternative would appreciated.
So as explained, I'm trying to delineate the expected inundated surface areas coarsely from the river centreline, based on an adjusted Z value, then trying to determine the horizontal impact area of the DEM that is covered by water.
Regards
#------------------------------------------------------------------------------- # Name: SimulateFlood.py # Purpose: Simulate a Flood # # Source: William A. Huber (Quantitive Decisions) # http://www.quantdec.com/SYSEN597/studies/flood/index.htm # # Created: 14-11-2013 #------------------------------------------------------------------------------- def main(): import arcpy,os arcpy.CheckOutExtension("Spatial") arcpy.env.workspace = r'C:\Project\_Forums\Flooding\fgdb\testflooding.gdb' source = r'C:\Project\_Forums\Flooding\fgdb\testflooding.gdb\source' # The source water body (raster) dem = r'C:\Project\_Forums\cost\fgdb\test.gdb\elevutm16n' # The elevation DEM (raster) floodname = r'C:\Project\_Forums\Flooding\fgdb\testflooding.gdb\Flood_' # outputs # settings nSourceElevation = 100 # The elevation corresponding to the source body nFloodMax = 400 # The maximum flood elevation; must not be less then nSourceElevation nIncrement = 20 # The flooding elevation increment nExtent = 750 # Do not flood outwards more than this many cells. nTiny = 0.9/nExtent # Used for limiting flood extents sourceRas = arcpy.Raster(source) demRas = arcpy.Raster(dem) steps = int((nFloodMax - nSourceElevation) / nIncrement) + 1 for i in range(0,steps): xElevation = (i * nIncrement) + nSourceElevation outname = "{0}{1}".format(floodname,i) cost = (demRas > xElevation)+nTiny costdist = arcpy.sa.CostDistance(sourceRas, cost, "#", "#") flood = costdist <= (nExtent*nTiny) if arcpy.Exists(outname): arcpy.Delete_management(outname) flood.save(outname) sourceRas = arcpy.sa.Log10(outname) # Converts 1 to 0, 0 to NoData del cost, costdist, flood print "ready..." if __name__ == '__main__': main()
Thanks for posting this code...Bill's original references on the forum are now gone and all that remains is this thread and his quantdec reference.