WatershedLayer Object
The WatershedLayer object contains the properties and methods of a watershed map created in Surfer with the Shapes method AddWatershedLayer or AddWatershedMap.
Derived from: Layer object, which is derived from Shape object(All methods and properties of Layer and Shape apply to this object.)
The following table provides the properties of the WatershedLayer object:
Property |
Description |
returns the ColorMap object for the basin colors |
|
returns a LineFormat object for the basin line |
|
true/false to fill depressions |
|
returns the grid object |
|
Returns the 3D grid being used for slices. It is a read-only propoerty. |
|
returns or sets the grid file |
|
Returns/sets the name of the 3D grid files used to create the map. |
|
returns or sets the layer opacity |
|
specifies the pour source for the watershed map |
|
true/false to show streams |
|
Returns/sets the Z-value of the XYZC slice being used as the contour surface |
|
true/false to snap to pour points |
|
returns a LineFormat object for the stream line |
|
returns or sets the threshold value |
The following table provides the methods of the WatershedLayer object:
Method |
Description |
loads a pour point file (BLN format) |
|
saves the filled grid |
Example
The following script demonstrates how the WatershedLayer object is used in reference to the MapFrame object.
Sub Main
'Declares SurferApp as an object
Dim SurferApp As Object
'Creates an instance of the Surfer Application object and assigns it
'to the variable named "SurferApp"
Set SurferApp = CreateObject("Surfer.Application")
'Makes Surfer visible
SurferApp.Visible = True
'Declares Plot as an object
Dim Plot As Object
'Creates a plot document in Surfer and assigns it to the variable
'named "Plot"
Set Plot = SurferApp.Documents.Add(srfDocPlot)
'Declares Shapes as an object
Dim Shapes As Object
'Assigns the Shapes collection to the variable named "Shapes"
Set Shapes = Plot.Shapes
'Declares MapFrame as an object
Dim MapFrame As Object
'Creates a vector map and assigns the map coordinate system to the
'variable named "MapFrame"
Set MapFrame = Shapes.AddWatershedMap(GridFileName:=SurferApp.Path+"\Samples\demogrid.grd")
'Declares WatershedLayer as an object
Dim WatershedLayer As Object
'Assigns the watershed map properties to the variable named "WatershedLayer"
Set WatershedLayer = MapFrame.Overlays(1)
End Sub