Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: "Correct" or "polish" a flood inundation map with a high-res DEM

"Correct" or "polish" a flood inundation map with a high-res DEM 8 years 4 weeks ago #24120

  • josekdiaz
  • josekdiaz's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 48
Dear forum,

As mentioned this was a priority-1 one issue and for the time being I managed to code a (ugly as hell) solution based on the answers and my initial thoughts, although I cant post the exact code yet (as soon as the project is finished I'm allowed to) the general flow goes like this:
  1. Read the inputs and get the max Free Surface and coords on the nodes that matched a Water depth > tolerance condition
  2. For each pixel on the high res DEM perform a Near neighbor search whithin a radius, using the nodes from step 1.
  3. Perform an Alpha-trimmed Mean with those nodes. Setting the alpha filters the infamous high nodes along with some artifacts.
  4. Perform a bool operation, basically, if Free surface>=DEM+tol, then if flooded value is set to 1, else 0.
  5. Write as a raster output. (bool one, 1-0 values)
  6. using a GIS tool perform a Raster>vector and then carefully clean some artificial ponds using a combination of Dissolve and buffer tools, could make the final trick (untested yet)

This procedure was done using a parallel implementation (multiprocess) in python to compensate the ugliness of the algorithm (optimization is the root of evil indeed...)

For the most critical case at my disposal (not the one shown in the attached),using 4 cores of my machine, and toping at 1.9 gb ram per process because RAM was a bottleneck, I was able to get my boolean flood raster from a 800k-nodes-Telemac result and a 12.8 gb 2x2 m DEM raster in ~20min.

Zoom_04.png


The attached files shows the difference between Raw results from telemac (displayed in the postTelemac plugin and just one zoom as a blue line), HEC-RAS output in red (I believe was smoothed in some degree by a coworker) and the Vectorized output of the script in black (hence the "saw" shape in the line) for a smaller case at my disposal.

Other similar process tested:

Instead of the Kneighbor+Alpha_Trimmed_mean filter, I tried Interpolation (thin plate splines, linear and some RBF) which took almost 5-10x more time to execute with decent results and triangulation which was almost as fast as the final code but with poor results (much more "false-positives" flood zones).

regards,

José C. Díaz.
Attachments:
The administrator has disabled public write access.

"Correct" or "polish" a flood inundation map with a high-res DEM 8 years 4 weeks ago #24121

  • josekdiaz
  • josekdiaz's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 48
Update on this:

Tested in a better (machine a workstation Intel E5-1650 v2) than my personal one (a AMD Fx-8350 based one), got the results in roughly 10min, compensation works!

regards,

José Díaz
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.