Post-Processing with RAS Mapper: Exporting a Large Number of Results Maps
Written by Shaina Sabatine | March 8, 2016
The new and improved RAS Mapper interface in HEC-RAS 5.0 makes managing and exporting model results like an inundation extents shapefile or a depth grid for use outside of HEC-RAS/RAS Mapper easy. The process (which is described in detail in Chapter 5 of the HEC-RAS 5.0 2D Modeling User’s Manual) requires the user to add desired results maps one by one using the ‘Add New Map’ button in the ‘Manage Results Maps’ window shown in Figure 1 below.
Figure 1: Manage Results Maps window for the results of a completed simulation. Two results layers have been exported: an inundation boundary shapefile and a depth grid.
Imagine you have a large number of outputs from a simulation that need to be exported. Because only one new results map can be added to the list in the ‘Manage Results Maps’ window at a time using the ‘Add New Map’ button, the process can become tedious. One way to make the process
faster is to directly edit the file that is created in your project directory with the extension “.rasmap”. This is a text file in XML format that RAS Mapper uses to identify the Geometries, Results, Map Layers, and Terrains that it will load into the interface along with some other settings (see Figure 2).
Figure 2: XML document tree showing the elements in a “.rasmap” file.
Each executed plan in a RAS project is listed as a <Layer> sub-element under the <Results> element, and each results layer that RAS Mapper will display is described in another <Layer> sub-element underneath that (see Figure 3). Note: the saved results of a HEC-RAS 5.0 simulation are stored in the file with the extension “.p##.hdf” where ## denotes the plan number. The “.rasmap” file stores information about outputs from the “.p##.hdf” file that will be displayed in the RAS Mapper interface.
Figure 3: XML document tree for the “.rasmap” file associated with the results in the window shown in Figure 1. The tree has been expanded to show plan <Layer> sub-elements and result <Layer> sub-elements which are under the <Results> element.
Figure 3 shows that 6 results layers will be loaded into RAS Mapper for the plan named “RampFlows2DArea” including an inundation polygon for January 02 at 00:00:00 and a depth grid for January 02 at 00:00:00. Say you would like to export inundation polygons and depth grids for multiple more profiles in this plan. Because the “.rasmap” file is simply a text file, it can be opened in a text editor and manipulated. In this example, one inundation polygon and one depth grid have already been created for the “RampFlows2DArea” plan. Rather than adding each additional desired results map layer using the ‘Add New Map’ button in the RAS Mapper interface (Figure 1), the “.rasmap” file can be directly edited. Additional desired results maps can be added by copying the associated block(s) of text, pasting a block in the correct location for each desired results map, and editing as needed. At a minimum, both the name of the layer and the date/time of the profile being exported will need to be edited (see Figures 3 and 4). **IMPORTANT- do not have HEC-RAS open while editing the “.rasmap” file.**
Figure 4: Example of the edited “.rasmap” file. Blocks of text were inserted for profiles for January 03 through January 07 at time 00:00:00. The red boxes highlight where edits were made.
Figure 4 shows a portion of what was edited in the “.rasmap” file. The red boxes in Figure 4 highlight where edits were made. In this example, it was desired to have an inundation boundary and a depth grid exported for every simulated day at time 00:00:00. After editing the “.rasmap” file, save it and open your HEC-RAS project and then RAS Mapper. The results maps will be listed under their plan name under Results in RAS Mapper as shown in Figure 5.
Figure 5: Inundation boundary and depth grid results maps loaded into RAS Mapper after editing the “.rasmap” file.
Inundation boundaries and depth grid results maps have been loaded into RAS Mapper for every day from January 02 through January 20 at time 00:00:00. Note that a red asterisk means a map has not been created or exported yet. To create/export maps, select all of the maps and click ‘Compute/Update Stored Maps’ in the ‘Manage Results Maps’ window as shown in Figure 6.
Figure 6: Selecting and creating/exporting the results maps.
Now, all you have to do is wait. Exporting this many layers could take a while. Note: This model run was set up so that all the profiles that needed to be exported were at time 00:00:00. This is why the time stamp was not edited in the “.rasmap” file.
Comments
Cameron Jenkins
on March 8, 2016You can also do the same for Profile Lines as there is not a way to import in a shapefile for them.
Martin Maretta
on March 8, 2016thanks, great post !
Shaina Sabatine
on March 9, 2016Good to know!
Paul Currier, P.E.
on July 18, 2016Thanks, Chris. The issue I'm having is the Shapefile for the maximum water surface elevation for a dam break looks like a series of disconnected sausage links. We've tried interpolating cross-sections down to 100' spacings, decreasing the time step from 10 seconds to 5 seconds, even adding a deeper secondary pilot channel, and still no success. In cross-section view, it shows the high water line. The only thing I haven't tried is re-importing the GRID file on a much tighter grid spacing.
Any thoughts on how to cure this scenario?
Many thanks in advance.
Paul Currier, P.E.
Water Resource Consultants, LLC
KOFFI BERENGER
on February 24, 2017please family can i help me to build a lateral structure in hec-ras
Chris Goodell
on February 24, 2017Best thing to do to get started is to open up one of the lateral structure example data sets that comes with HEC-RAS. If you don't have the example data sets, go to the Help menu item in RAS and select "Install Example Projects…" There are a lot of data sets that have lateral structures that you can use as guides for building your own. "Beaver Cr. -Lateral Structure" located in the Unsteady Examples folder would be a good start. You can also work through the example in the Applications Guide in Chapter 15. Good luck.
KOFFI BERENGER
on February 27, 2017Hello I realize a 1D / 2D model and I notice problems of instability during the simulations. Can you help me solve this model instability problem? thank you to help me.
Finished Processing Geometry
Writing Event Conditions
Event Conditions Complete
Performing Unsteady Flow Simulation HEC-RAS 5.0.3 September 2016
**** ERROR: Solution Solver Failed ****
Unstable for Initial Iteration at 31DEC1987 2400
**** The Model Has One Or More Error(s) ****
Unsteady Flow Simulation Terminated
Writing Results to DSS
No output to write to DSS
Jesse Gourevitch
on July 27, 2017Hello,
I'm wrapping an optimization algorithm around a HEC-RAS model and need to extract the pixel values from the depth map and read them into python several thousand times. Using the "Compute/Update Stored Maps" feature to export the Depth map as a static map, then opening the raster in python using GDAL, is simply too slow. I'm curious to know whether there is a way to access these values in the dynamic map without exporting them to the disk as a GeoTIFF. Is it possible to do this via the *.p*.hdf file or through the HEC-RAS API?
Thanks for your help,
Jesse
Chris Goodell
on July 27, 2017Jesse- You should be able to get what you need from the p.hdf file using the HDFViewer. HDF has some libraries you can install that allows you to programatically read and extract data from hdf files.
Jesse Gourevitch
on July 28, 2017Hi Chris, thanks for your response. I've been looking at the p.hdf file in the HDFViewer, but I can't seem to find the 2D array of depth values. Do you have any suggestions for where I should look?
Chris Goodell
on July 31, 2017Try drilling down through this path in the HDF file:
Results/Unsteady/Output/Output Blocks/Unsteady Time Series/2D Flow Areas/[your 2D area]/Depth
Jesse Gourevitch
on August 1, 2017Is it possible to do this with a steady flow analysis, or just unsteady flow?
Chris Goodell
on August 3, 20172D can only be done in unsteady.
Lyle
on August 28, 2017Hi Chris, I ran a 2D only model with a years worth of flow hydrograph data. I have been asked to get the inundation area numbers for every half hour for year. Any ideas?
Chris Goodell
on August 28, 2017That's 17,520 inundation maps! Who asked you for that and do they realize what they're asking for? First, by "inundation area numbers" what do you mean? The area of inundation? If that is the case, you'll have to set the mapping interval to 30 minutes. Then your only hope is to write a script that can retrieve the data you need from the plan hdf file (which will be HUGE for a years worth of 1/2-hour mapping data). If you are to actually produce 17,000+ maps, you'll need at least 20 Tb of dedicated hard drive storage(probably more), a very fast and robust computer, a lot of patience, and a lot of luck. I think it might be a good time to sit down with whoever is directing you to do this and find out exactly what they really need. I bet they don't really need data every 1/2 hour. But if I'm wrong, you are in for a challenge. Good luck. This could quickly spiral out of control (budget wise), so if you aren't experienced with writing code, let me know-I and some of my staff have experience doing this kind of thing.
Lyle
on August 28, 2017That's what I said. We are looking at wetted acre duration for wetland carbon sequestration so my colleague wants to know the area of inundation and how long the areas remain inundated. I will most likely try and scale back the time interval and how many days we are looking at. Luckily there is no need to produce the associated maps as they are only interested in the acreage of inundation. How much would generating a script cost? I have some experience but this seems above my capabilities.
Chris Goodell
on August 29, 2017Lyle-
It really depends on what ultimately you need, how accurate you need it, and if you want to be able to use the script for other models (or is it a one-off). Shoot me an email and we can discuss in more detail if you wish. cgoodell@westconsultants.com
sam
on September 13, 2017Hello Chris,
Thank you for a wonderful blog.
I followed the same steps as you did, in order to export maps. But I still got the same error "Map not created" for 1d model. Because of that I could not map the velocity and depth profile in Ras Mapper.
Also, in case of 2D model, I could create the .tif file for velocity and depth profile but as soon as I uploaded those .tif file in ArcGIS, ArcGIS got crashed. What do you think might be reason behind these issues?
Thank you for your help.
Sam
Unknown
on September 14, 2017Hello Chris,
Thank you for wonderful post. I am trying to export velocity and shear stress mapping from 2d modeling. I could make the .tif file. While loading them in ArcGIS, ArcGIS got crashed as soon as I uploaded them.I tried several times creating new .tif and uploaded them but still got the same problem. What might be the reason behind this?
Thank you
Chris Goodell
on September 15, 2017Not quite sure. I've never had that problem. You might try and see if you can load them up in another GIS application like QGIS (it's free).
Anonymous
on September 15, 2017Thank you Chris. One another question. Can we map the result of 1d in Ras Mapper? After running the model, I could see the result on RAS Mapper listed in layers but I could not see the mapping of result. How should I proceed to map that result?
Thank you.
Chris Goodell
on September 15, 2017Yes, if there is water in the 1D reach(es), and you have a terrain associated with your geometry, you should see water in the 1D reaches. If you are not seeing any mapping, first make sure you actually computed water in those areas. Second, did you try animating the layer? Are all the check boxes checked in the tree view? Third, if it's really a mystery, try removing the output layer from the tree view, close RAS Mapper, then reopen it. Fourth, try deleting your plan hdf file, rerunning RAS, then reopening RAS Mapper and see if that helps.
Edsel Matt Morales
on February 25, 2018Hi Chris, is there a way to script Ras Mapper to run without using the GUI?
Chris Goodell
on February 25, 2018Hi Edsel. I don’t think so that’s possible. At least I can’t think of a way to do it. Just curious, what are you trying to do?
Edsel Matt Morales
on February 25, 2018I am doing an automation in generating depth map.
Chris Goodell
on February 25, 2018Please share your experience when you can.
Angana Borah
on March 27, 2018Is possible to get an animated view of inundation of the generated output after doing 2D Unsteady analysis?
ian james palulay
on March 27, 2018Why is it that when I export my "Depth Max", i get a different result from the original..? The depth is higher…
Chris Goodell
on May 6, 2018Yes. You can animate any output layer in RAS Mapper. If you want to create an animation file, you'll need to use a screen capture video recording application. I use SnagIt.
Nic
on May 11, 2018Hi Chris,
I have a few of questions related to this topic:
1) Is there a way to export all of your results to the same folder?
2) Is there a way to change the file name of your results layers using the .rasmap file?
For my purposes, it would be convenient to have all of my results maps in one folder and to have a consistent and descriptive naming structure like "Depth Results XXX cfs" for example. I've tried to do this by editing the path and filename in the "StoredFilename" Map Parameter, but when I recompute the stored map in RasMapper it saves over my edits, reverting to the default file naming convention and path. Would be great if I could just make RasMapper organize things for me.
3) Have you ever automated the .rasmapper file setup with a script? Say you wanted depth results maps at the final timestep of a large quantity of runs. The method described in this blog post is certainly faster than using the RasMapper interface, but does still require some laborious repetition. I admittedly have done little research on this, but can you point me in the right direction of how I might automate this process to more efficiently produce large batches of results maps?
Thank you for maintaining this blog, it is such a useful resource!
Nic
Chris Goodell
on May 15, 2018You might consider checking the box "Floodplain Modeling" in the unsteady flow analysis window. That should automatically create a static map for the MAX WS.
Unknown
on July 6, 2018Hello,
I'm using RASMapper profile lines, and I'm wondering what the difference is between the "Compute Engine" and the "Post Processed" hydrographs they produce. The two are usually very similar, but are sometimes drastically different.
Thanks!
Max MacLean
on January 8, 2019Hello All,
Does anyone know of a resource that describes (in detail) the contents of the hdf files created by HEC-RAS? I'm interested in extracting the terrain maps. The HDF viewers show a number of related tables (Cells Center Coordinate, Cells Face and Orientation Info, Cells Face and Orientation values, etc…) but it is unclear what data to use to plot the terrain.
Nicky
on June 10, 2020Hi Chris,
Is there a way to “To create/export maps, select all of the maps and click ‘Compute/Update Stored Maps’ in the ‘Manage Results Maps’ window as shown in Figure 6.” programatically?
Best,
Nicky
Chris Goodell
on June 11, 2020Hi Nicky. Not that I’m aware of. There might be a way, but I haven’t tried it. Probably would require some coding around the HDF file using python, if possible.
Puja kumari
on December 1, 2020Why is it that when I export my “Depth Max”, i get a different result from the original..? The depth is higher…
GOLAM MOHIUDDIN
on December 3, 2020Hello Chris, I have a question on ras mapper. I developed a 2D model for culverts and was checking the roadway overtopping in ras mapper. For one of the culvert location the ras mapper was not showing any overtopping (visually). But when I plot the upstream stage in GIS, it was clearly showing the overtopping on the road. Does it seem like a bug in HECRAS? FYI, I was using HECRAS version 5.0.7 for my model. Let me know what you think. Thank you.
Chris Goodell
on December 4, 2020Hi Golam. Could be many things. Does your 2D connection sit inside a single 2D area or between 2D areas? If in between, RAS Mapper won’t show water over the structure, even if it is overtopping. Also, where did you measure the upstream stage. If it’s far enough away, there could be a drawdown that prevents overtopping, even though the upstream stage suggests it would overtop.
GOLAM MOHIUDDIN
on December 9, 2020Hi Chris, Sorry for little delay. It was all one 2D area. The roadway was defined by multiple weirs located inside the 2D grid. The weir was divided based on the culvert location so that each weir will have one culvert. Individual weir length varies between 1000-2500 ft. The upstream stage was measured using “Plot Stage and Flow Hydrograph” (for weir) in the geometry window. Not sure what you meant by drawdown here though.
Chris Goodell
on December 10, 2020Can you show a screen shot of the culvert in RAS Mapper where it shows that it does not overtop? Make sure that the structure (with culvert) is visible in the screenshot.
GOLAM MOHIUDDIN
on December 11, 2020This is from RAS Mapper
data science training in hyderabad
on January 25, 2021nice information on data science has given thank you very much.
Ian (Imperial College London)
on April 18, 2021Thank you very much, huge time saver!
Kevin
on April 5, 2022Just want to express my gratitude for your efforts on this blog. An excellent resource – it has been the silver bullet many times during troubleshooting. I’m also enjoying your book, hope you put out another.
Chris Goodell
on April 7, 2022Thanks Kevin!
nate
on December 29, 2022Hi – Is there a way to export cross sections from RAS Mapper to a shape file and have the water surface profile elevations included in the exported data for each cross-section ? This is a request we received from a FEMA reviewer. Thanks!
Chris Goodell
on January 12, 2023Hi Nate. There may be. I’m not sure. But it wouldn’t be hard to export the cross sections and then manually add in the WS Elevation data into the attribute table.
Add Your Comment