Monday, January 21, 2019

Shifting web imagery with world files for HEC-RAS

Written by Krey Price  |  Surface Water Solutions
Copyright © The RAS Solution 2019.  All rights reserved. 

Using RAS Mapper as a GIS tool Part 2:
Shifting Web Imagery with World Files

Have you ever tried pulling web imagery into RAS Mapper only to find that it doesn't line up with your existing shape files, terrain surfaces, or other geospatial data?  In this second of a three-part series on using RAS Mapper as a GIS tool we'll cover the modification of world files for georeferencing.

Photo by Franck V. on Unsplash

In some cases, the misalignment of web imagery may result from an incorrectly applied projection file. If needed, projection files can be downloaded for free from and other online data sources. You can check the projection of your terrain file by double-clicking on it in RAS Mapper, then select the "Source Files" tab and view the metadata using the Info column. 

If you have confirmed that the correct projection file is being used and you are still having issues, there are a few additional workarounds you may wish to try. One option is to select the "Alternate HEC-RAS Raster Warping Method" under "Tools | Options" in RAS Mapper. This method applies the gDAL OGR vector reprojection. I have found this method useful for resolving discrepancies in European data sets in particular.

In some cases, the alternate method doesn't do the trick either. RAS Mapper uses the ESRI projection file format, which as I understand it does not recognize TOWGS84 parameters and in some cases improperly applies the proj.4 projection parameters. In any case, you may find yourself stuck with misaligned web imagery.

One workaround is to save static images of your web imagery and then shift the image to the correct location by making adjustments to the world file (Wikipedia has a good summary of the six lines of code comprising a world file here).

Here's a video walk-through of the process:

The "World File Calculator" spreadsheet referenced in the video can be downloaded here:

Here are the steps covered in the video:

1. Adjust transparency as needed so that you can see a known point in both the web imagery and in the survey or LiDAR data.
2. Using the measure tool in RAS Mapper, click on a known point from the web imagery (with incorrect location), then double-click on the the same known point based on the correct location.
3. Select "Copy coordinates to clipboard".
4. Zoom to preferred extents for results and save view (click here for further details on saved views and static imagery).
5. Right-click on web imagery and select "export layer". Note: RAS Mapper currently has two export options: tif and jpg. The tif format will embed the metadata and georeferencing information into the encoded text of a geotif file without generating a separate world file. A tfw file can still be created to override the embedded georeferencing, but I suggest using the jpg format so that the world file is automatically generated. Save the image (I suggest creating an "aerial imagery" subfolder within the current project's directory structure to store static images).
6. Open the world file calculator spreadsheet.
7. Paste the coordinates from RAS Mapper into the blue cell.
8. Open the newly created jgw file (jpg format world file) in a text editor and copy the values.
9. Paste the values into the "Original World File" column of the spreadsheet.
10. Copy the "New World File" values over the original values in the jgw file, save, and close.  
11. Under Map Layers in RAS Mapper, right-click and select "Add Existing Layer". Be sure to drag down file types to show all image files and browse to the newly created file.
12. Adjust transparency as needed to confirm common points are now co-located.

The process can be repeated to fine-tune the positioning. Because a static image won't be pyramided like web imagery, you will unfortunately need to complete these steps at every desired zoom level and view extent, the but the process of saving static images allows you to control the appearance of your figures without having to worry about losing your internet connection while presenting or viewing results.

Note that these steps assume the units and north alignment are the same (or close enough) between the data sets and that the static image can be simply shifted without scaling or rotation factors, which we'll cover in more detail in our next post.
Please let us know any feedback or suggestions for improvements or additional efficiencies in adjusting web imagery.

Wednesday, January 16, 2019

Bug Report for HEC-RAS 5.0.6

RAS Users:  Please give this "Known Issues" report a read if you're using Version 5.0.6.  If you've been doing a lot of 2D modeling, it's likely you have been affected by some of these.

This link includes a document of "Known Issues" found in version 5.0.6 of HEC-RAS to date.  The
document outlines all of the Issues (bugs) we have found so far.

Please look closely at this document, as there as a few issues that are potential computational problems.  Specifically issues 1, 2, 5, and 7.  Please review these issues closely.  If you have any of these situations use the suggested work around, or solution to get past the issue.  Everyone should look at issue 1 and 2, as they are possible in many models.

Sorry for any inconvenience this may cause you.  Keep letting us know if you find other problems with the software.

Gary W. Brunner, P.E., D. WRE, M. ASCE
Senior Technical Hydraulic Engineer
Hydrologic Engineering Center, USACE

Friday, January 11, 2019

Preview of the new Finite-Volume Approach for 1D Reaches

One of the most anticipated new features soon to come in the next major version of HEC-RAS (Version 5.1) is the option of running unsteady 1D reaches with a finite volume solution scheme.  This will be a fantastic addition to HEC-RAS.  Gary Brunner recently gave me a brief overview of the new finite volume feature we can expect.  But before you ask, there is no set release date for Version 5.1 yet.  But I'm hoping we'll see it within the next year or two.

1D Finite Volume Solution Algorithm

By Gary W. Brunner, P.E., D.WRE
Senior Technical Hydraulic Engineer
Hydrologic Engineering Center

A brand new solution algorithm has been developed for 1D modeling.  A Finite-Volume solution approach, similar to what was added for 2D modeling will be available for 1D modeling in HEC-RAS version 5.1.

The current 1D Finite Difference solution scheme has the following deficiencies:
  1. Cannot handle starting or going dry in a cross section
  2. Low flow model stability issues with irregular cross section data
  3. Extremely rapidly rising hydrographs can be difficult to get stable
  4. Mixed flow regime (i.e. flow transitions) approach is approximate
  5. Stream junctions do not transfer momentum

The new 1D Finite Volume approach has the following positive attributes:
  1. Can start with cross sections completely dry, or they can go dry during a simulation (wetting/drying)
  2. Very stable for low flow modeling
  3. Can handle extremely rapidly rising hydrographs without going unstable
  4. Handles subcritical to supercritical flow, and hydraulic jumps better.
  5. Junction analysis is performed as a single 2D cell when connecting 1D reaches (continuity and momentum is conserved through the junction).

Additionally, the new 1D Finite Volume approached is solved in the same matrix as the 2D equations.  Solving in the same matrix allows for faster 1D/2D model solutions and more accurate flow transfers between 1D and 2D elements.  The equations are solved together and all hydraulic connections are updated together on an iteration by iteration approach, rather than separately, as in previous versions of HEC-RAS.

Monday, January 7, 2019

Removing bridge decks from terrain surfaces

Written by Krey Price  |  Surface Water Solutions
Copyright © The RAS Solution 2019.  All rights reserved. 

Using RAS Mapper as a GIS Tool Part 1:
Removing Bridge Decks from Terrain Surfaces

This is the first in a three-part series on using RAS Mapper as a GIS tool. In this post we'll cover the removal of bridge decks from terrain data.

This topic comes up fairly frequently, since LiDAR data may be inconsistent in terms of the inclusion or exclusion of bridge decks. Depending on how you would like to model a bridge, you may prefer to have the bridge deck represented as terrain or as a deck/roadway defined with station/elevation points (in which case the deck geometry might be best excluded from the terrain data). In either case, you may find yourself needing to modify terrain data to suit your modeling needs.

In a previous post on terrain modification, we covered how to burn channels, levees, buildings, basins, and other features into your terrain surface using RAS Mapper. One application we left off (because it is the example covered in the HEC-RAS manual) is the removal of bridge decks; given some of the feedback we received on the previous post, we thought it might be worth including bridge decks in the process as well.

The process of removing a bridge is actually quite simple, as is the process of inserting some basic deck geometry into your terrain data. We walk through the complete steps for both removing and adding a bridge in less than 5 minutes in this video walk-through:

Here's a screen shot of Page 2-11 in the HEC-RAS 2D User Manual showing a bridge deck included in the terrain data and then removed from the terrain data. Now you see it, now you don't:

The following images are courtesy of Cameron Paintin from Riley Consultants, who applied these steps for a project in New Zealand.

Here is the terrain surface with the bridge deck in it:

Here is a satellite image with the bridge:

In this screen shot, Cameron has drawn a river reach with cross sections on either side of the bridge:

This process can be repeated with additional reaches for any other bridges in your terrain. The following screen shot shows the interpolation surface created by the bounding cross sections:

And the final image shows interpolation surface on top of the terrain to blend out the bridge:

Let us know what you think or if you have other suggestions for improving these processes.

And a happy 2019 to all of the fellow HEC-RASlers around the world!