SurferGrid (.grd)

  • Import and Export are fully compatible with Versions 6 and 7 of the Surfer grid format.
  • Background

      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 and Export

    • 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 reference pages for full general information on Import and Export.
    • ImportString and ExportString support the Surfer grid format.


    • General Import elements:
    • "Elements"list of elements and options available in this file
      "Rules"full list of rules for each element and option
      "Options"list of rules for options, properties, and settings
    • 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}}.


    • 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


    Basic Examples  (5)

    Import a Surfer grid digital elevation model:

    Click for copyable input

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

    Click for copyable input

    Get the coordinate range of the data:

    Click for copyable input

    Import the data and display as a 3D model:

    Click for copyable input
    Click for copyable input

    See Also


    Introduced in 2010