+

B.1 | Creating Flat-Processed DEM Data for the VELMA Simulator

Overview (Tutorial B.1 – Create Flat-Processed DEM Data for VELMA)

The VELMA Simulator requires elevation data in the form of a georeferenced Digital Elevation Model (DEM) for any simulation it runs.

This DEM contains elevation data in the form of a grid for the area simulated.

The area specified must contain no "sinks" or "flat spots", so that when VELMA simulates runoff, it must be able to flow "off" the map area in some way. Water is not allowed to pool anywhere within the simulation area.

In order to ensure this "no flat spots rule", DEM data used by the VELMA Simulator first needs to be "flat-processed" to remove any sinks or flat spots.

This document explains how to use JPDEM - an enhanced Java version of the "PDEM" program (Pan et al. 2012) - to (1) flat-process raw DEM data files, and (2) determine the location of a watershed outlet and delineate the boundary the watershed area contributing to that outlet.

How to Acquire Digital Elevation Model Data

Elevation and other common GIS data can be retrieved from many local, state, and federal GIS repository libraries. The USDA's "Geospatial Data Gateway" provides easy access to multi resolution USGS National elevation data along with many other types of natural resource data. Higher resolution data, like LiDAR can many times be found from alternative public and private stakeholders such as the "Puget Sound Lidar Consortium". Other popular data, such as STATSGO and newer 10m gridded

SSURGO soils GIS layers can also be acquired from the "Geospatial Data Gateway"

References

Geospatial Data Gateway - https://datagateway.nrcs.usda.gov/

Puget Sound Lidar Consortium - http://pugetsoundlidar.ess.washington.edu/

How to Use the JPDEM Tool to Process DEM data for Use with VELMA

To ensure the "no flat spots rule", DEM data used by the VELMA Simulator is first "flat-processed" to remove any sinks or flat spots.

Use JPDEM to prepare DEM data for use by the VELMA Simulator.

Note

You must have a current version of Java (version 1.8 at this writing) installed on your computer to run JPDEM.

How to Create a Flat-Processed DEM

Start JPDEM

Open a Windows Command Line and enter the command:

C:\> java -Xmx1024m -jar C:\full\path\to\JPDEM.jar

The "-Xmx1024m" tells the Java Runtime Environment (JRE) to let JPDEM have 1024 megabytes (1 gigabyte) of working memory.

If your machine doesn't have that much memory, substitute a smaller value (e.g. "512" instead of "1024"). Alternately, if the .asc file of DEM data you intend to load is very large (and your machine has the memory) you may substitute a larger value (e.g. "2048" instead of "1024").

If the full path to the JPDEM.jar file contains whitespace characters, place double-quotes around the path.

Example:

C:\full\path\with white space\to\JPDEM.jar

Load the DEM Data into the JPDEM Tool

Load a "raw" DEM file into JPDEM (the file must be in standard ESRI Grid .asc format).

The easiest way to do this is to drag and drop a raw (unprocessed) DEM file into the open JPDEM window.

Alternatively, you can click the "File" menu, then select and click "Load DEM File". The "Select DEM File to Load" dialog window opens.

Browse to the location of your DEM file, and click the name of the DEM file. The DEM file's name appears in the "File Name:" text box.

Click "Load File" to load that file's data into JPDEM.

The file is loaded, and an image of the file appears in JPDEM's map display.

If the file is too small (has few rows and columns), click the Image Scale up-arrow button to "zoom in".

Flat Process the DEM Data Using JPDEM

Click the "Tools" menu, then select and click "Flat-Process DEM Data (Standard)". The drop-down menu currently provides a selection of methods to flat-process a DEM grid. There are currently four different JPDEM delineation algorithm implementations to choose from. We believe they all produce the same results (except possibly for cells on the edge of the DEM area -- which is an acceptable difference).

However, they vary greatly in how long they take to run. We recommend using the "Experimental" algorithm for delineation because our experience is that it provides accurate results in a comparatively short amount of time.

The following is a quick summary of the alternate flat processing methods, including the strengths and weaknesses of each.

Standard

Feifei Pan's original PDEM algorithm and code, translated to Java. Raises and lowers cell elevations.

May NOT completely process map -- has a "time-out" to keep it from running indefinitely.

UNSAFE for use with maps that have had border-mask and/or channel dredge applied beforehand.

Alternate

Feifei Pan's original algorithm, implemented to with some simple Java optimizations. Raises and lowers cell elevations.

May NOT completely process map -- has a "time-out" to keep it from running indefinitely. Is usually a bit faster than the Standard engine, but in a few cases has proven to run slower.

UNSAFE for use with maps that have had border-mask and/or channel dredge applied beforehand.

Experimental (recommended)

Allen Brookes' complete re-implementation of Feifei Pan's original algorithm.

Only raises cell elevations.

Will always completely process map (not proven formally).

Is almost always much faster than either the Standard or Alternate engines.

Can be disproportionately slowed down by large, contiguous flat areas adjacent to edges of the map. Can be safely used with maps that have had border-mask and/or channel dredge applied beforehand.

Enhanced Experimental

Allen Brookes' refinement of the Experimental algorithm. Primarily raises cell elevations (but may lower them as well).

May NOT completely process map, but has a high likelihood of doing so. Is almost always faster than the Experimental engine.

Can be disproportionately slowed down by large, contiguous flat areas adjacent to edges of the map. Can be safely used with maps that have had border-mask and/or channel dredge applied beforehand.

Enhanced + Divide-and-Conquer Experimental

Allen Brookes' additional refinement of the Experimental algorithm Primarily raises cell elevations (but may lower them as well).

May NOT completely process map, but has a high likelihood of doing so. Is almost always faster than the Experimental Enhanced engine.

Can be disproportionately slowed down by large, contiguous flat areas adjacent to edges of the map. Can be safely used with maps that have had border-mask and/or channel dredge applied beforehand.

After selecting (clicking) one of the preceding options, JPDEM will process the DEM, adjusting elevation data to remove flat spots or sinks within the DEM data's area.

If the processing takes more than a second or two, the display will periodically update, showing remaining flat spots in blue.

When the flat-processing algorithm finishes, the display shifts to a grey-scale representation, with darker-colored pixels representing cells with higher flow-accumulation values.

Save the Flat-Processed DEM Data from JPDEM To a File

After JPDEM finishes flat-processes DEM data, click the "File" menu, then click the "Save DEM As ..." submenu, and finally select and click the "Ascii Grid" menu item.

The "Save DEM Grid to File" dialog window opens.

Browse to the location you wish to save the data in, then type a name for the file in the "File Name:" text box.

Finally, click the "Save File" button to save the DEM data to the specified file name and location.

Notes:

Flat-processed DEM data may be loaded into JDPEM just like "raw" DEM data.

Flat-processed DEM date does not need to be flat-processed again after it is loaded into JPDEM.

However, to view the flow-accumulation grey-scale visualization of that flat-processed data, you must determine the flow data information for the flat-processed DEM values.

Watershed Delineation

Determining Flow Data for a Flat-Processed DEM

Load a flat-processed DEM .asc file into JPDEM, in the same way you would load a "raw" DEM file.

After loading the DEM data, click the "Tools" menu, then select and click the "Determine DEM Flow Data (Standard)" menu item.

JPDEM will then compute flow data (flow direction and accumulation values) for each cell in the DEM area.

Once the flow data is computed, JPDEM will shift the display to the flow-accumulation grey-scale visualization.

Note

Loading a "raw" DEM file and then immediately trying to determine DEM flow data should not crash JPDEM, but it won't result in any meaningful information either.

Note

The difference in results between the "(Standard)" and "(Alternate)" flow data algorithms should be zero or very small.

You may use either algorithm. The Alternate algorithm is somewhat faster, but often not much faster than the Standard algorithm.

Determining Watershed Delineation

Flat-processed, flow-accumulated DEM data in JDEM may be used to determine the delineation relative to a specified outlet cell (i.e. the set of cells that flow "to" a specified "outlet" cell).

In order to compute the delineation for an outlet cell, you must first specify the coordinates of the outlet cell.

You can do this either by entering the zero-based x (column) and y (row) coordinates of the outlet cell in the "Outlet X=" and "Y =" number boxes, above JPDEM's map display, or by using the mouse.

To select an outlet cell using the mouse, do the following:

Move the mouse pointer over the cell you wish to select. Press down on either the right or left mouse button.

A context menu should pop-up, containing information about the cell you are pointing at.

Holding the mouse button down, drag the mouse pointer onto the menu item containing cell info (the info should highlight), then release the mouse button.

The menu goes away, and the x and y coordinates for the cell you selected appear in the "Outlet X = " and "Y = " number boxes above the map display.

Note

"Zoom in" on the map display by clicking the up-arrow button of the "Image Scale" to make selecting a specific cell easier. For example, at "Image Scale 3", for example, every cell is displayed by 3x3 pixels. However, on very large maps zooming too far in can crash the display, because it may run out of memory.

Once the coordinates of an outlet cell are specified, click the "Tools" menu, then select and click the "Delineate DEM Data (Experimental)" menu item.

JPDEM will then compute the delineation (i.e. the area of cells) for the currently specified "Outlet X =" and "Y =" values.

The resulting area is displayed in a logarithmic-coloring blue-red scale, superimposed over the grey-scale of the flow-accumulation display.

If the delineation looks incorrect, change the outlet cell coordinates and re-run the delineation.

When the delineation looks correct, record the "Outlet X =" and "Y =" values for future reference and use with JVELMA. (JPDEM does not "record" outlet values anywhere.)

References

Pan, F., Stieglitz, M., & McKane, R. B. (2012). An algorithm for treating flat areas and depressions in digital elevation models using linear interpolation. Water Resources Research, 48(6).