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

BasinColorMap

returns the ColorMap object for the basin colors

BasinLine

returns a LineFormat object for the basin line

FillDepressions

true/false to fill depressions

Grid

returns the grid object

GridXYZC

Returns the 3D grid being used for slices. It is a read-only propoerty.

GridFile

returns or sets the grid file

GridXYZCFile

Returns/sets the name of the 3D grid files used to create the map.

Opacity

returns or sets the layer opacity

PourSource

specifies the pour source for the watershed map

ShowStreams

true/false to show streams

SliceZValue

Returns/sets the Z-value of the XYZC slice being used as the contour surface

SnapPourPoints

true/false to snap to pour points

StreamLine

returns a LineFormat object for the stream line

Threshold

returns or sets the threshold value

The following table provides the methods of the WatershedLayer object:

Method

Description

LoadPourFile

loads a pour point file (BLN format)

SavedFilledGrid2

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