Convert Feature To Raster (Raster Analysis)

Summary

Converts features to a raster dataset.

Illustration

Convert Feature to Raster tool

Usage

  • This raster analysis portal tool is available when you are signed in to an ArcGIS Enterprise Link to Understanding analysis in ArcGIS Enterprise portal that has an ArcGIS Image Server Link to What is ArcGIS Image Server configured for Raster Analysis Link to Configure and deploy raster analytics. When the tool is invoked, ArcGIS Pro serves as a client and the processing occurs in the servers federated with ArcGIS Enterprise. The portal tool accepts layers from your portal as input and creates output in your portal.

    The input feature layer can be a layer from the portal. It can also be a URI or URL to a feature service. This tool does not support local feature data and layers as input.

  • Point, line, or polygon features can be converted to a raster dataset.

Syntax

arcpy.ra.ConvertFeatureToRaster(inputFeatures, valueField, outputName, outputCellSize)
ParameterExplanationData Type
inputFeatures

The input feature layer.

Feature Set
valueField

Choose the field that will be used to assign values to the output raster.

Field
outputName

The name of the output raster service.

The default name is based on the tool name and the input layer name. If the layer name already exists, you will be prompted to provide another name.

String
outputCellSize

Enter the cell size and unit for the output raster.

The units can be Kilometers, Meters, Miles, or Feet.

The default units are Meters.

Linear Unit

Derived Output

NameExplanationData Type
outputRaster

The output raster.

Raster Layer

Code sample

ConvertFeatureToRaster example 1 (Python window)

This example converts point features to a raster.

import arcpy
arcpy.ConvertFeatureToRaster_ra('https://MyPortal.esri.com/server/rest/services/Hosted/Rainfall/FeatureServer/1', 
                                'elevation', 'outRaster', '250 Meters')
ConvertFeatureToRaster example 2 (stand-alone script)

This example converts point features to a raster..

#-------------------------------------------------------------------------------
# Name: ConvertFeatureToRaster_Ex_02.py
# Description: Convert point features to a raster.
#
# Requirements: ArcGIS Image Server

# Import system modules
import arcpy

# Set local variables
inFeatures = 'https://MyPortal.esri.com/server/rest/services/Hosted/Rainfall/FeatureServer/0'
inField = 'elevation'
outCellSize = '250 Meters'
outRaster = 'outRaster'

# Execute ConvertFeatureToRaster
arcpy.ConvertFeatureToRaster_ra(inFeatures, inField, outRaster, outCellSize)

Licensing information

  • Basic: Requires ArcGIS Image Server
  • Standard: Requires ArcGIS Image Server
  • Advanced: Requires ArcGIS Image Server

Related topics