Convert Feature To Raster (Raster Analysis)

Titleā€ƒ Convert Feature To Raster (Raster Analysis)

Summary

Converts features to a raster dataset.


Illustration

Convert Feature to Raster tool Convert Feature to Raster tool

Usage


Syntax

Parameter Explanation
inputFeatures

The input feature layer.

valueField

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

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.

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.

Code Samples

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)

                    

Tags

Credits

Use limitations