Watershed Prepare: Filling Sinks

This topic continues from the Watersheds topic.  

 

This topic should be read together with other watershed topics:

 

 

 

 

 

 

 

 

 

Sinks are drainage basins that are closed, that is, which have no outlet downstream.  The Watershed Prepare transform template fills sinks in terrain elevation data based on specified criteria, which is often a sensible first step before launching other Watershed transform operations.

 

In hydrology, a watershed is a region of terrain which shares a common drainage.  Also called a drainage basin, a watershed is any area of land where precipitation, like rainfall, collects and drains off into a common outlet.   For example, all the water falling as rain into a mountain valley may collect in the valley and then drain off from the lowest point of the valley into the next, lower watershed, where it may be joined by rainfall from other mountain valleys.   A watershed that has no outlet, for example, Crater Lake in Oregon, the Dead Sea in the Middle East, or the Caspian Sea between Europe and Asia, is called a sink.   A sink is a closed drainage basin, or, more technically, an endorheic drainage basin.  

 

See the discussion in the Watersheds topic.

 

Watersheds depend on the data used - The results obtained from Watershed Prepare will depend on the data used.   

 

 

With the focus on a window that contains a raster image as a layer, the Watershed prepare template appears in the Transform pane when a Tile field is picked that in at least one channel that represents the height of terrain at each pixel. The Watershed Prepare transform template creates a new image.    

 

Filling sinks in a terrain elevation raster image:

 

  1. Open an image that represents terrain elevation.

  2. In the Transform pane, choose the image and the Tile field in that image.

  3. Double-click the Watershed Prepare template to launch it.

  4. In the Watershed Prepare template options, choose the Channel desired.  Single channel images will automatically have channel 0 loaded.

  5. Specify the Fill height and Fill flow desired.  A very large Fill height with zero for Fill flow will fill all sinks.

  6. The Result will be a new image.  That can be saved into the same tile file, a new tile field in the same table, or into a new image and table.  When choosing a new field or table, specify the names desired.

  7. Press Transform.

 

.

 

With the focus on the target window, in the Transform pane choose the terrain elevation image to be used, and choose the Tile field.   Double-click on the Watershed Prepare template to launch it in the Transform pane

Controls

Up one level.  Return to the main template list to allow choosing the component or field.  Use this button to choose a different template.

<component name>

Gives the name of the raster image layer in the map that the template is using as a source of terrain elevation data.  If the map has other raster image layers, we can change to any other raster image layer in the same map.

Field

The name of the tile field on which the template operates.   If the raster image has other tile fields providing terrain elevation data, we can choose any other such tile field.

Channel

The channel to use for terrain elevation data if the tile field in use has more than one channel.   Raster images typically provide terrain elevation data using tiles that have only one channel, channel 0, where each value is a single number that gives the height of the pixel.  

Fill height

Fill flow

Fill height and Fill flow allow us to specify whether we want to fill sinks on the basis of their vertical depth or on the basis of their areal size or on a combination of both characteristics.

 

Choice of Fill height and Fill flow control how sinks are filled as follows:

  

  • If both Fill height and Fill flow are negative or zero, the image is left unchanged.

  • If Fill height is positive and Fill flow is negative or zero, sinks are filled based solely on height, that is, the depth of the sink.

  • If Fill height is negative or zero and Fill flow is positive, sinks are filled based solely on flow, equivalent to the area of the sink.

  • If both Fill height and Fill flow are positive, sinks are filled based on both height and flow.

 

 

Result

Specify the destination for the result of the transform.  There are four choices for saving the raster image created by the template:

 

  • Same Field - Place the result of the transform into the same Tile field that was used as the source of the transform.  This overwrites prior values in that field with new values that are the result of the transform.

  • Existing Field - Choose an existing, compatible Tile field in the same table. A list of existing Tile fields will appear as choices.  Place the result of the transform into the specified field.  This overwrites prior values in that field with new values that are the result of the transform.  Tile fields are considered to be compatible when they have the same tile size and the same number of channels.

  • New Field - Create a new Tile field of the specified Channel type in the source raster's table, and populate it with the results of the transform, also creating a new image.

  • New Table - Create a new image and a new table using the names specified in the New image and New table boxes, and create a new Tile field in that table into which the result of the transform will be placed.

 

Channel type

Appears when saving the result to a new field or to a new table.  The numeric type of channel to use when creating a new field  or a new table.

New image

Appears when saving the result to a new field or to a new table.  The name to use for the new image the template will create.

New table

Appears when saving the result to a new table.  The name to use for the new drawing's table the template will create.

Resources

A choice of CPU and GPU parallelization resources the system is allowed to use:

 

  • all CPU cores - Allow parallelization up to using all CPU cores (threads) with no use of parallel GPU allowed.
  • all CPU cores, all GPU cores -  Allow parallelization up to using all CPU cores (threads) and parallel use of all GPU cores.
  • one CPU core - Allow use of only one CPU core (thread) with no use of parallel GPU allowed.
  • one CPU core, all GPU cores - Allow use of only one CPU core (thread) and parallel use of all GPU cores.

 

CPU "cores" are used in the Windows meaning of the word core, meaning hyperthread for CPUs that support hyperthreading when hyperthreading is turned on in the BIOS.   Since most modern CPUs and systems support hyperthreading, when Windows reports the number of cores it is really reporting the number of threads.  GPU cores are either used fully parallel for all cores or GPU is not used at all.

 

The Resources setting puts limits on what the system is allowed to use.  It does not force parallelization if that would result in slower operation.

 

Transform

Apply the transform template.

Preview

Show a preview in blue preview color of what the transform operation will do, when possible.   A preview is just a temporary view and does not change anything.

 

Press the Preview button to launch a preview, or to update a preview after changing any parameters or controls in the pane.  A preview will stay in view until we hide it, or until a layer used to compute the preview is removed or refreshed.  We can add layers, pan and zoom, alt-click objects to view attributes, and edit layers without losing the preview.

 

Closing a preview:  In map windows, right-click the blue preview caption bar at the top of the window and choose Hide Preview.  In table windows, right-click the blue preview column head and choose Hide Preview.

Edit Query

Launch a Command Window loaded with the SQL query that performs this transform with given settings.

 

Fill height and Fill flow

Fill height is a measure of the vertical depth of the sink.   Sinks that are deeper than the Fill height specified will not be filled and will be left unchanged.   Sinks that can be filled with the Fill height specified will be filled.  

 

Consider a lake formed by a dam where the lip of the dam is 50  meters above the height of the lake. The lake is a sink until the level of the lake rises up above the lip of the dam and can spill over past the dam downstream.  The lake is a sink with a vertical depth of 50.   The Fill height required to fill it is 50.   At any Fill height values of 50 or greater, the lake as a sink is filled.  At any Fill height less than 50 the lake is unfilled and remains as a sink.  

 

If we use a very large value for Fill height, such as 20000 (a very big height difference whether we are measuring in feet or meters) that will be enough to fill in any sink.

 

Fill flow is a measure of the areal size of the sink.  A sink is a closed drainage basin, the total flow of which is found by assuming one unit of water falls on every pixel within the basin. To fill the entire basin we must have at least that much flow available to fill the basin.  If a sink is 1000 pixels in areal size we must have at least 1000 in Fill flow available to fill it.   

 

If we choose 1000 as the value for Fill flow that will be enough to fill all sinks that are 1000 pixels in size or less.   Sinks that are larger than 1000 pixels in size will be too big to fill with the Fill flow we have specified.    A Fill flow specification of 500 would be enough to fill a sink that is 400 pixels in size, but it would not be enough to fill a sink that is 1000 pixels in size and thus requires a minimum of 1000 in flow to be filled.

 

Since it usually is easier to note the height of a dam or other obstruction that it is to compute the areal surface of a drainage basin, in many cases it will be easier to simply use a Fill height value when filling in sinks created by dams.   Fill flow may be more useful when filling in small sinks in undulating terrain where we are interested in larger effects and do not care about highly local sinks that are, in comparison with larger watershed areas, mere puddles.

Example

We will use the same Montara terrain elevation surface featured in the Watersheds topic, seen below slightly zoomed in.

 

 

With the focus on the target window, in the Transform pane choose the Montara terrain elevation image, and choose the Tile field.   Double-click on the Watershed Prepare template to launch it in the Transform pane

 

.

 

In the Watershed Prepare template, we choose channel 0 as the Channel.   Single channel images (as often are used for terrain elevation data) will automatically have channel 0 loaded into the Channel box.

 

We enter 20000 for Fill height and 0 for Fill Flow.   A zero value for Fill flow tells the system to ignore that parameter and to use only the height value.  Setting a very large Fill height value will ensure all sinks are filled.

 

For the Result destination we choose New Table.   This will create a new image and table, as opposed to saving the result into either the same Tile field used as the source or into another (new or existing) tile field in the same table.  We specify Montara filled sinks for the name of the New image to be created by the template, with an analogous name for the New table.  

 

For a preview of what the template will do, press Preview.

 

 

Pressing the Preview button shows the previewed results of the operation using blue preview colors along with a blue preview caption bar at the top of the window with the name of the template used for the preview.  Previews are shown on top of all map layers.   To close the preview, right-click on the caption bar and choose Hide Preview.

 

To apply the transform operation, press Transform.

 

A new image and table called Montara filled sinks  appears in the Project pane.   We drag and drop the new Montara filled sinks image into the map as a layer:

 

 

In the illustration above we have styled the new Montara filled sinks image the same as the original Montara image (easily done by copying the StylePixel property from the Montara image's Properties dialog and pasting it into a new StylePixel value we create in the Montara filled sinks image's Properties dialog).    At first glance there seems to be no visual difference between the two.

 

In most terrains, when zoomed out to a view that is kilometers or miles in width and height the relatively small differences in heights required to fill in sinks are not visible.    We can see that by taking a closer look at where sinks were filled in.

 

 

To guide us in looking, we add the WS Areas Sinks Non-Edge layer computed in the Watersheds topic, shown above with 70% layer opacity.

 

 

We zoom into the region where we know the dam for Pilarcitos Lake is located.

 

 

Turning off all layers but the original Montara image, we can see a faint edge, barely visible, where the dam extends above the lake.   In the above illustration we have increased Z scale in hill shading, for more emphatic shading.

 

 

If we turn on the Montara filled sinks layer, we can see the faint edge has disappeared, because the height of the lake, the Fill height, has been increased to where the lake is now slightly above the dam.

 

 

Comparing the two views side-by-side we can see how water from the lake is no longer captured within a closed basin.  Water can now flow over the dam to continue downstream, thus eliminating the sink.

Notes

Most sinks are small sinks - In real life, undulating terrain is full of small sinks: anywhere that water puddles after a rain is a sink.   Most terrain elevation data with which we work in GIS is too low resolution to capture such small sinks, but there are still plenty of sinks, usually, in data that has been captured at one or two meter resolution, which now is common in modern times given the LiDAR revolution in capturing high resolution terrain elevation data.    We can run the Watershed Prepare transform template with smaller values for Fill height or Fill flow to eliminate smaller sinks while retaining those which are big enough to play a significant role in our watershed analyses.

 

Sink is slang - The word sink is used casually and imprecisely in the name of the Watershed : sink areas template.  The template creates areas that are closed drainage basins, where all rainfall that falls anywhere within the area drains to a common point somewhere within the interior of the area.   Strictly speaking, that common point is the sink.   As a practical matter, sinks are usually not single points but are themselves areas, such as lakes, within the closed drainage basin into which all water drains.    However, sink is such a short, convenient word that it has become popular as a synonym for closed drainage basin.  ESRI calls sinks basins, and other packages may call sinks pits.

Videos

Manifold vs Arc - Fifty times Faster than Spatial Analyst -  The first video in a series of comparisons. We compare Manifold Release 9 to ESRI's ArcMap with Spatial Analyst. ArcMap instead of ArcGIS Pro is used to ensure maximum possible speed with no slowdowns from AGOL connections. Starting with a terrain 5300 x 5300 elevation raster we compare Manifold workflow and speed creating streams (watershed lines) with ESRI ArcMap and Spatial Analyst doing the same task. ArcMap requires four operations calculating intermediate steps, taking a total of three minutes and 30 seconds to compute streams.  Manifold does the same job in a single operation in under four seconds, over fifty times faster than Arc, and with the convenience of a single click.  ArcMap plus Spatial Analyst cost over $5000 per seat while Manifold costs under $500.  As data sizes scale up, Manifold gets even faster than Arc. Works in the free Viewer, too!

 

Manifold vs Arc - Watersheds Sixty Five times Faster than Arc -  Another video comparing Manifold speed to ESRI ArcMap with Spatial Analyst, this time computing upstream watersheds on a 5300 x 5300 terrain elevation raster for a few dozen locations.  ArcMap requires three geoprocessing tool operations calculating intermediate steps, taking a minute and a half.  Manifold does the same job in a single click in less than 1.4 seconds, over 65 times faster than ESRI. The larger and more complex the geoprocessing, the greater Manifold's speed advantage.   ArcMap plus Spatial Analyst cost over $5000 per seat while Manifold costs under $500. Works in the free Viewer, too!

 

Manifold vs Arc - Seven Seconds vs Four Minutes - Finding basins in a 5300 x 5300 terrain elevation raster, we compare Manifold workflow speed and ease of workflow to ESRI's ArcMap with Spatial Analyst.  ArcMap Standard plus Spatial Analyst costs a total of $5250 so it should work better than a Manifold package that sells for under $500, right?  No way! Manifold absolutely crushes the comparison, taking only a single click and seven seconds to do what takes the $5000+ package three geoprocessing operations and four minutes, not counting the time to setup and launch three operations. Works in the free Viewer, too!

 

Manifold vs Arc - 100x Faster on an Affordable Desktop - Watch Manifold do in 0.9 seconds what takes ArcMap plus Spatial Analyst over a minute and a half.  That's over 100 times faster!   Some  comments on previous comparisons have stated that Manifold was so super fast compared to ESRI because tests were run on a high-end, Threadripper machine that could run 48 threads. This video shows Manifold is faster even with fewer cores on an affordable desktop system.  We re-run Manifold trials on a  Ryzen 9 3900x computer, with three different tasks taking only 0.9 seconds, 5.4 seconds and 3 seconds.  AMD's 3900x CPU now retails for as low as $450, setting a new baseline for affordable GIS desktop computing.  Everything shown in the video works in the free Viewer, too!

 

See Also

Tables

 

Maps

 

Drawings

 

Images

 

Labels

 

Style

 

Style: Thematic Formatting

 

Transform Pane

 

Transform Topics

 

Transform Reference

 

Transform - Tiles

 

Watersheds

 

Example:  Create Watershed Areas

 

Example: Create Watershed Lines

 

Shreve Order and Strahler Order

 

Watershed Areas, Sinks

 

Upstream Areas and Lines

 

Downstream Lines


Flow Direction and Accumulation