mbm_grd2arcSection: MB-System 5.0 (1)
Updated: 3 June 2013
NAMEmbm_grd2arc - Macro to convert a GMT grid file in the GMT NetCDF grid format to an ArcView ASCII grid.
SYNOPSISmbm_grd2arc -Igrdfile -Oarcfile [-H -Nnodata -V]
DESCRIPTIONmbm_grd2arc is a macro to convert a GMT grid file in the GMT NetCDF grid format to an ArcView ASCII grid. This allows users to import the grid into Arc/Info and ArcView. The grids must have the same grid interval in both longitude and latitude. If the grid was created using mbgrid or mbmosaic, the -E option must have been used in that program to set the grid cell sizes equal (see the mbgrid and mbmosaic manual pages).
The macro first obtains the bounds, dimensions, and grid cell size of the grid using the GMT program grdinfo. The grid dimensions, the lower left position, and the grid cell size are written to the header of the output ArcView ASCII grid file. The macro then uses the GMT program grd2xyz to dump each of the grid values to a temporary ASCII file. This temporary file is read and parsed one value at a time. Any NaN values are replaced by the nodata value specified with the -N option. Each final value is printed to the output file.
AUTHORSHIPDavid W. Caress (email@example.com)
Monterey Bay Aquarium Research Institute
Dale N. Chayes (firstname.lastname@example.org)
Lamont-Doherty Earth Observatory
In order to convert KohalaA_bath.grd to an ArcView ASCII grid
so that the data can be imported into the Arc/Info or ArcView
GIS packages, we use the mbm_grd2arc macro:
mbm_grd2arc -IKohalaA_bath.grd \
Running the example above produced the following output:
Program mbm_grd2arc status:
Input GRD file: KohalaA_bath.grd
Output ArcView ASCII file: KohalaA_bath.asc
Grid dimensions: 1426 1329
Grid cell sizes: 0.0002871995719 0.0002871995719
Grid bounds: -155.72855 -155.3192906 20.09488 20.47628103
Generating temporary file...
Parsing temporary file...
Last Updated: 3 June 2013
Return to list of MB-System manual pages...
Back to MB-System Home Page...