SurferGrid (.grd)

Background & Context

    • Golden Software Surfer geospatial file format.
    • Terrain data format used by Golden Software products.
    • Used for archiving and exchanging terrain data.
    • Binary or ASCII format.
    • Contains digital elevation models (DEM).
    • Digital elevation models are stored as a raster of elevation values.

Import

  • Import["file.grd"] imports a Surfer grid file and returns a rendering of the contained data.
  • Export["file.grd",expr] exports an array representing elevation data to the Surfer grid format.
  • Import["file"] returns a Graphics object.
  • Import["file","elem"] imports the specified element from a Surfer grid file.
  • Import["file",{"elem","suba","subb",}] imports a subelement.
  • Import["file",{{"elem1","elem2",}}] imports multiple elements.
  • Export["file.grd",expr,elem] creates a Surfer grid file by treating expr as specifying element elem.
  • Export["file.grd",{expr1,expr2,},{{elem1,elem2,}}] treats each expri as specifying the corresponding elemi.
  • Export["file.grd",expr,opt1->val1,] exports expr with the specified option elements taken to have the specified values.
  • Export["file.grd",{elem1->expr1,elem2->expr2,},"Rules"] uses rules to specify the elements to be exported.
  • See the following reference pages for full general information:
  • Import, Exportimport from or export to a file
    CloudImport, CloudExportimport from or export to a cloud object
    ImportString, ExportStringimport from or export to a string
    ImportByteArray, ExportByteArrayimport from or export to a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Data representation elements:
  • "Data"array of terrain elevation values
    "Graphics"DEM file rendered as ReliefPlot
    "Image"raw DEM data as an image object
    "ReliefImage"DEM file rendered as ReliefImage
  • Import by default uses the "Graphics" element for the Surfer grid format.
  • Metadata elements:
  • "ElevationRange"range of elevation values in meters
    "RasterSize"size of the terrain grid
    "SpatialRange"range of geographic coordinates, given in coordinate system units
    "SpatialResolution"grid spacing in coordinate system units
  • Import["file.grd","ElevationRange"] gives the range {zmin,zmax} of elevation values in units of meters.
  • Import["file.grd","SpatialRange"] gives the bounding coordinates of the geographic region covered by the file as an expression of the form {{ymin,ymax},{xmin,xmax}}.

Options

  • General rendering options:
  • BackgroundNonebackground color
    DataRangeAutomaticthe range of latitude and longitude values to assume for the data
    ImageSizeAutomaticoverall size of the image
  • DEM rendering options:
  • ColorFunction"Topographic"how to determine the color of surfaces
    DataReversedFalsewhether to reverse the order of rows
    LightingAngleAutomaticthe effective angle from which simulated illumination is taken to come
  • Import options:
  • "DefaultElevation"Automaticelevation setting for areas not covered by the file
    "DownsamplingFactor"1integer factor by which the amount of DEM data in each horizontal dimension is reduced on import
  • Export options:
  • "BinaryFormat"Truewhether the file is in ASCII or binary format
    "DefaultElevation"Automaticelevation setting for areas not covered by the file
    "LegacyFormat"Falsewhether to export Surfer 6 compatible files

Examples

Basic Examples  (5)

Import a Surfer grid digital elevation model:

Get the names of the Import elements available in this file:

Get the coordinate range of the data:

Import the data and display as a 3D model:

Export a matrix as a Surfer grid digital elevation model: