Is it possible to create cross sections along a river in QGIS and then export the data to HEC-RAS?
Well, here it is:
(How to) Create and transfer cross-Section Data from QGIS to Hec-RAS
A. In QGIS RUN the following SAGA GIS modules:
- Cross Profiles (Using a DEM and the stream reach as the axis "Cross_prof.shp" will be created and imported into the layers (data frame) Note: clear the "Cross_prof.shp" file from profiles that intersect each other
- Profiles from Lines (Using the SAME DEM and the "Cross_prof.shp" as the "lines" file "Each New LINE as a NEW file" Select NO It saves a new shapefile as a POINT shapefile WITH coordinates (i.e. rofile_points.shp)
- Import the "Profile_points.shp" into Excel (or copy from the attribute table within QGIS and paste into excel)
- COPY from Profile_points.shp and PASTE all columns.
- ERASE the columns "ID", "DIST" and "DIST_SURF"; leave only the columns "Line_ID", "X", "Y" and "Z"
Insert TWO columns on the left: Column A will be named as RIVER_NAME and Column B as RIVER_REACH
ADD the name of the river (column A) in ALL lines;
- ADD the RIVER_REACH name (=i.e. "2" or anything else);
RENAME column "Line_ID" as "RIVER_STATION" (column "Line_ID" of the "Profile_points.shp" shapefile). Now the file has six columns: River_name (A), River_Reach (B), River_Station (C), X (D), Y (E) and Z (F) Save the file in excel format so that you can re-use it.
SAVE the file in .CSV format. Please note than in some cases, EXCEL uses the semi-colon (;) character instead of the comma (,). In such a case, open the CSV file with Notepad, press ctrl-H (replace function) and REPLACE ";" with "," (do not use the quotes)
SAVE the CSV file and it is ready for importing into HEC-RAS
B. Import .csv to HEC-RAS Open HEC-RAS New Project New Geometry Data Import Geometry Data / CSV
Set/Pick the correct Columns Pick the UNIT system (SI or Metric) and ...finish / import data.
I found 2 usefull plugins:
- Station Lines: creates cross sections (perpendicular lines) at a specific distance and length along the "river".
- VoGIS Profil tool: creates cross sections based on a raster map and the vector layer of the cross sections created by the Station Lines.
- The output of the VoGIS Profil tool is (amongst other option) a csv file which can be imported to HEC RAS.
I have used the Q-Ras plug-in https://plugins.qgis.org/plugins/Qgis2Ras/ and it has done the expected work.
Here the help text, which is all I needed:
Q-RAS Plugin is a preprocessing for geometry preparation in HEC-RAS.
The steps to using Q-RAS Plugin are fairly simple:
Load in QGIS a Digital Elevation Model in grid format in a projected crs
Digitize a stream network vector line from upstream do downstream
Digitize a Cross sections vector line from left overbank to righ toverbank (it’s not necessary to follow a particular order in XS digitizing as the plugin order the XS basing on the river feature)
Designate where to store your new geometry file
Open HEC-RAS and enjoy
There is another plugin, RiverGIS, but I did not want to go through the cumbersome process of configuring PostGIS.
UPDATE: I went to the process of creating a PostGIS database and RiverGIS is much better than Q-RAS. Here some tips to install PostGIS: How to install PostGIS on Windows?
There are two plugins under QGIS 2.18 that are very suited for this task:
- Profile tool: it gets the profile along a line from raster.
- ProfileFromPoints: it interpolates a point layer along a line(s).
The plugin RiverGIS is able to do the same and a lot more, but for tailoring a model section to section, the ones above are probably better.
there will be a few steps to achieve this.
A) create evenly spaced points along your river
B) build the line perpendicular to your river for each point
C) create evenly spaced point along those lines
D) extract the values of your DEM for each point
E) copy paste your attributes to excel (ctrl-C/ctrl-V)
A,C and D cand be done with the "profile from line" plugin
B could be done based on this post (slope (m) of perpendicular is -1/m slope of segment where the point is located).