Surface Volume (3D Analyst)

Summary

Calculates the area and volume of a raster, triangulated irregular network (TIN), or terrain dataset surface above or below a given reference plane.

Learn more about how Surface Volume works

Illustration

Surface Volume

Usage

Syntax

SurfaceVolume_3d (in_surface, {out_text_file}, {reference_plane}, {base_z}, {z_factor}, {pyramid_level_resolution})
ParameterExplanationData Type
in_surface

The input raster, TIN, or terrain dataset surface used for calculating area and volume.

Raster Layer; Terrain Layer; TIN Layer
out_text_file
(Optional)

The optional output text file containing the results.

File
reference_plane
(Optional)

Choose whether to calculate above or below a given height.

  • ABOVEVolume and area will be calculated above the Plane Height. This is the default.
  • BELOWVolume and area will be calculated below the Plane Height.
String
base_z
(Optional)

The elevation of the plane that will be used to calculate area and volume.

Double
z_factor
(Optional)

The factor by which the heights of the input surface will be multiplied to calculate surface volume; used for converting Z-units to match XY units.

Double
pyramid_level_resolution
(Optional)

The resolution of the terrain dataset pyramid level to use for geoprocessing. The default is 0, or full resolution.

Double

Code Sample

SurfaceVolume example 1 (Python window)

The following sample demonstrates the use of this tool in the Python window:

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.SurfaceVolume_3d("sample.gdb/featuredataset/terrain", "surf_vol.txt", 
                      "ABOVE", 300, 1, 5)
SurfaceVolume example 2 (stand-alone script)

The following sample demonstrates the use of this tool in a stand-alone Python script:

'''****************************************************************************
Name: Surface Volume Example
Description: This script demonstrates how to use the 
             Surface Volume tool.
             
****************************************************************************'''
# Import system modules
import arcpy
from arcpy import env
import exceptions, sys, traceback

try:
    # Obtain a license for the ArcGIS 3D Analyst extension
    arcpy.CheckOutExtension("3D")
    # Set environment settings
    env.workspace = "C:/data"
    # Set Local Variables
    inSurface = "elevation_tin"
    #Execute SurfaceVolume
    result = arcpy.SurfaceVolume_3d(inSurface, "", "ABOVE", "300", "1", "5")
    print result.GetMessage(0)

except arcpy.ExecuteError:
    print arcpy.GetMessages()
except:
    # Get the traceback object
    tb = sys.exc_info()[2]
    tbinfo = traceback.format_tb(tb)[0]
    # Concatenate error information into message string
    pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\
          .format(tbinfo, str(sys.exc_info()[1]))
    msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2))
    # Return python error messages for script tool or Python Window
    arcpy.AddError(pymsg)
    arcpy.AddError(msgs)

Environments

Related Topics

Licensing Information

ArcView: Requires 3D Analyst
ArcEditor: Requires 3D Analyst
ArcInfo: Requires 3D Analyst

6/10/2013