Summary
Calculates the area and volume of the region between a surface and a reference plane.
Illustration
Usage
Apply a Z Factor to ensure the accuracy of volume calculations when the surface Z values are expressed in a different unit of measure than the XY units. Using a Z Factor will not modify the original data. The tool will automatically determine the appropriate Z-factor when the XY and Z coordinate systems are defined.
The output text file will store the full path to the surface, the parameters used to generate results, and the calculated area and volume measurements. If the same output file is specified in multiple runs of the tool, the pre-existing records are maintained and the results are appended to the table.
Dataset Plane Height Reference Z Factor Area 2D Area 3D Volume C:\data\tin
100.00
Above
1
15984467.82
16354331.40
1886012931.05
C:\data\raster.tif
250.5
Below
3.28084
0
0
0
C:\data.gdb\fd\terrain
1250
Above
0.3048
1854238.36
1970550.88
1099221466.89
If the region for which surface area and volumetric calculations are desired is defined by a non-rectangular extent, consider creating a polygon to delineate the boundary of the area of interest, then use the Polygon Volume tool to determine the calculations for the region between the plane defined by the polygon and a given surface.
A raster surface is evaluated using the extent of the center point of each cell, as opposed to the extent of the entire cell area. The resulting analysis will decrease the data area of the raster by half a cell relative to the data area displayed for the raster.
Syntax
SurfaceVolume_3d (in_surface, {out_text_file}, {reference_plane}, {base_z}, {z_factor}, {pyramid_level_resolution})
Parameter | Explanation | Data Type |
in_surface | The raster, TIN, or terrain surface to process. | Mosaic Layer; Raster Layer; Terrain Layer; TIN Layer |
out_text_file (Optional) | A comma-delimited ASCII text file containing the area and volume calculations. If the file already exists, the new results will be appended to the file. | File |
reference_plane (Optional) | The direction from the reference plane for which to calculate the results.
| String |
base_z (Optional) | The Z value of the plane that will be used to calculate area and volume. | Double |
z_factor (Optional) | The factor by which Z values will be multiplied. This is typically used to convert Z linear units to match XY linear units. The default is 1, which leaves elevation values unchanged. | Double |
pyramid_level_resolution (Optional) | The z-tolerance or window-size resolution of the terrain pyramid level that will be used by this tool. 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.getMessages()
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
Licensing information
- ArcGIS for Desktop Basic: Requires 3D Analyst
- ArcGIS for Desktop Standard: Requires 3D Analyst
- ArcGIS for Desktop Advanced: Requires 3D Analyst