Skip To Content

Convert Feature To Raster

Summary

Converts features to a raster dataset.

Illustration

Convert Feature to Raster tool

Usage

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

Syntax

ConvertFeatureToRaster_ra (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 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 in 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