GridConvert2

GridConvert2 converts between various grid formats. Returns a Boolean. Returns 'True', if the conversion operation is successful, otherwise, it returns 'False'.

The GridConvert2 command should be used instead of GridConvert when an options string needs to be used to load the grid file.

Syntax

object.GridConvert2( InGrid, InGridOptions, OutGrid, OutFmt, OutGridOptions )

Parameter

Type

Required/Optional

Default

Description

InGrid

String

Required

""

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

InGridOptions

String

Optional

""

This provides the input option string for the grid format.

OutGrid

String

Optional

""

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

OutFmt

SrfGridFormat

Optional

srfGridFmtS7

This provides the output grid file format.

OutGridOptions

String

Optional

""

This provides the output option string for the grid format.

Remarks

GridConvert converts any supported grid file format to any other supported grid file format or an ASCII XYZ .DAT data file.

See Grid Import Options String and Grid Export Options String for links to file types specific for GridConvert2 import and export options.

Example 1

This example demonstrates how to convert demogrid.grd into an ASCII data file called dgrid1.dat that stores the X, Y, and Z coordinates of each grid node on a separate line.

SurferApp.GridConvert2(InGrid:=SurferApp.Path+"\Samples\demogrid.grd", _

OutGrid:=SurferApp.Path+"\Samples\dgrid1.grd", OutFmt:=srfGridFmtXYZ, _

OutGridOptions:="ValuesPerLine=5, BlankLinePerGridRow=1, NumericFormatType=1, _

NumericFormatDigits=5")

Example 2

This example demonstrates how to save Telluride.grd to an ASCII data file and save the spatial references as an Esri AUX.XML file and an Esri .prj file.

Surfer.GridConvert2(InGrid:=InGridPath+"Telluride.grd", OutGrid:=OutGridPath + "Convert.grd", OutFmt:=srfGridFmtAscii, _

OutGridOptions:="ValuesPerLine=5, BlankLinePerGridRow=1, NumericFormatType=1, NumericFormatDigits=5, ForgetOptions=1, SaveRefInfoAsESRIprj=1, SaveRefInfoAsAUXXML=1")

Example 3

This script displays all the methods in the Application object.

Used by: Application object