Generate Table From Raster Function (Data Management)

Summary

Converts a raster function dataset to a table or feature class. The input raster function should be a raster function designed to output a table or feature class.

Usage

  • The input to the tool is a raster function.

  • The input raster function should produce a table or feature class output. The settings in the raster function determine whether the output is a table or a feature class. The tool will validate the raster function and determine the output type.

  • The raster function can be an .xml file, a JSON file template, or a JSON function definition string.

  • The tool can run in parallel mode and uses the parallel processing settings from the Environment setting.

Parameters

LabelExplanationData Type
Input Raster Function

The function template or function JSON object that outputs a table or feature class.

String; File
Output Table

The path, file name, and type (extension) of the output table or feature class.

Table
Raster Function Arguments
(Optional)

The function arguments and their values to be set. Each raster function has its own arguments and values, which are listed in the dialog of the tool.

Value Table

arcpy.management.GenerateTableFromRasterFunction(raster_function, out_table, {raster_function_arguments})
NameExplanationData Type
raster_function

The function template or function JSON object that outputs a table or feature class.

String; File
out_table

The path, file name, and type (extension) of the output table or feature class.

Table
raster_function_arguments
[raster_function_arguments,...]
(Optional)

The function arguments and their values to be set. Each raster function has its own arguments and values, which are listed in the dialog of the tool.

Value Table

Code sample

GenerateTableFromRasterFunction example 1 (Python window)

This is a Python sample for GenerateTableFromRasterFunction.

#====================================
# GenerateTableFromRasterFunction
# Usage:
# arcpy.management.GenerateTableFromRasterFunction(
#     raster_function, out_table, { {Name} {Value}; {Name} {Value}...}))
# arcpy.management.GenerateTableFromRasterFunction(
#     raster_function, out_table, {raster_function_arguments})

import arcpy

# Convert Raster to point feature class using build in Pixel to Vector function
arcpy.management.GenerateTableFromRasterFunction(
"P2V", "C:/Workspace/outputdb.sde/pixelpoints", 
"Raster C:/Workspace/data/testimage.tif")
GenerateTableFromRasterFunction example 2 (stand-alone script)

This is a Python script sample for GenerateTableFromRasterFunction.

#====================================
# GenerateTableFromRasterFunction
# Usage:
# arcpy.management.GenerateTableFromRasterFunction(
#     raster_function, out_table, { {Name} {Value}; {Name} {Value}...}))
# arcpy.management.GenerateTableFromRasterFunction(
#     raster_function, out_table, {raster_function_arguments})

import arcpy

rasterfunc = "C:/Workspace/funcs/TestGeometry.rft.xml"
outfc = "C:/Workspace/polygonfeat.shp"
funcargs = "Raster C:/Workspace/data/testgeo.tif"

# Generate polygon feature class using custom python raster function
arcpy.management.GenerateTableFromRasterFunction(
rasterfunc, outfc, funcargs)

Related topics