GridMosaic3

GridMosaic3 creates a new grid by mosaicing one or more input grids. It combines two or more input grids of the same coordinate system into a single output grid. Returns a Boolean. Returns 'True', if the operation is successful, else, returns 'False'.

Syntax

object.GridMosaic( InGrids, ResampleMethod, OverlapMethod, xMin, xMax, xSpacing, xNumNodes, yMin, yMax, ySpacing, yNumNodes, OutGrid, OutFmt, OutGridOptions )

Parameter

Type

Required/

Optional

Default

Description

InGrids

Variant

Required

 

This provides the string for a single grid file path or string array where each element is a grid file path.

ResampleMethod

SrfResampleMethod

Optional

srfBilinear

This specifies the resampling method.

OverlapMethod

SrfOverlapMethod

Optional

srfAverage

This specifies the overlap method. The overlap method determines the value of the grid node in the new grid: Average, First, Last, Minimum, Maximum, or Sum.

xMin

Double

Optional

 

This provides the output grid geometry Minimum X value, i.e. the minimum limit of X coordinates.

xMax

Double

Optional

 

This provides the output grid geometry Maximum X value, i.e. the maximum limit of X coordinates.

xSpacing

Double

Optional

 

This specifies the horizontal grid spacing.

xNumNodes

Double

Optional

 

This specifies the number of grid node columns.

yMin

Double

Optional

 

This provides the output grid geometry Minimum Y value, i.e. the minimum limit of Y coordinates.

yMax

Double

Optional

 

This provides the output grid geometry Maximum Y value, i.e. the maximum limit of Y coordinates.

ySpacing

Double

Optional

 

This provides the vertical grid spacing.

yNumNodes

Double

Optional

 

This provides the number of grid node rows.

OutGrid

String

Optional

""

This provides the path and file name of the output grid file.

OutFmt

SrfGridFormat

Optional

srfGridFmtS7

This provides the output grid format.

OutGridOptions

String

Optional

""

This provides the output option string for the grid format.

Remarks

  • When two or more grids are used, the InGrids parameter value must be an array with each element indicating a grid file path and name. Every element of the array must include a grid file path. Do not dimension the array longer than necessary to include all the grids you wish to mosaic. When only one grid is used, the InGrids parameter value may be a string indicating the grid file path and name. See Example 1 for an example of how to declare an array and assign string values to the array elements. See Example 2 for an example of a single grid mosaic.

  • xMin, xMax, yMin, and yMax default to zero if not set. So, if setting x dimensions, both xMin and xMax should also be set. If setting y dimensions, yMin and yMax should also be set.

  • If xMin is greater than or equal to xMax, then the X limits of the input grids is used.

  • If yMin is greater than or equal to yMax, then the Y limits of the input grids is used.

  • If xNumNodes is specified, it has precedence over xSpacing. If neither is specified, the spacing is set to the spacing of the densest input grid.

  • If yNumNodes is specified, it has precedence over ySpacing . If neither is specified, the spacing is set to the spacing of the densest input grid.

Example 1

This example shows how to create an array of grids and then use the GridMosaic3 method.

'Array of Grids

Dim gridarray(1 To 6) As String

gridarray(1)="c:\temp\telluride.grd"

gridarray(2)="c:\temp\grayhead.grd"

gridarray(3)="c:\temp\horseflypeak.grd"

gridarray(4)="c:\temp\ironton.grd"

gridarray(5)="c:\temp\mountwilson.grd"

gridarray(6)="c:\temp\ophir.grd"

 

'Mosaic grids

SurferApp.GridMosaic3(InGrids:=gridarray, ResampleMethod:=srfNearest, _

OverlapMethod:=srfAverage, OutGrid:="c:\temp\mosaic.grd")

Example 2

This example shows how to use a string to specify the InGrids parameter.

SurferApp.GridMosaic3(InGrids:=SurferApp.Path+"\samples\diablo.grd", _

xNumNodes:=252, yNumNodes:=360, _

OutGrid:=OutPath+"Diablo_Mosaic_Resample.grd")

Example 3

This example demonstrates how to resample grids using the nearest neighbor calculation, save the file as Mosaic.grd and save the spatial reference as a Golden Software Reference (GSIREF) version 1 file.

Dim Grids2(1 To 1) As String

Grids2(1) = InGridPath+"Diablo.grd"

Surfer.GridMosaic3(InGrids:=Grids2, ResampleMethod:=srfNearest, OutGrid:=OutGridPath + "Mosaic.grd", OutFmt:=srfGridFmtS7, OutGridOptions:="UseDefaults=1, ForgetOptions=1, SaveRefInfoAsGSIREF=1")

Example 4

This script displays all the methods in the Application object.

Used by: Application object