Available with Advanced license.
Summary
Converts point features to a raster dataset.
Usage
Any feature class (geodatabase, shapefile, or coverage) containing point or multipoint features can be converted to a raster dataset.
The input field type determines the type of output raster. If the field is integer, the output raster will be integer; if it is floating point, the output will be floating point.
If the input field contains string values, the output raster will contain an integer value field and a string field.
The Cellsize can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn’t been explicitly specified as the parameter value, it is derived from the environment Cell Size, if it has been specified. If the parameter cell size or the environment cell size have not been specified, but the environment Snap Raster has been set, then the cell size of the snap raster is used. If nothing is specified, then the cell size is calculated from the shorter of the width or height of the extent divided by 250, where the extent is in the Output Coordinate System specified in the environment.
If the cell size is specified using a numeric value, the tool will use it directly for the output raster.
If the cell size is specified using a raster dataset, the parameter will show the path of the raster dataset instead of the cell size value. The cell size of that raster dataset will be used directly in the analysis, provided the spatial reference of the dataset is the same as the output spatial reference. If the spatial reference of the dataset is different, it will be projected based on the selected Cell Size Projection Method.
This tool is a complement to the Raster to Point tool, which converts a raster to a point feature class.
When more than one feature is present in an output cell, this tool provides greater control over the assignment of cell values than the Feature to Raster tool.
Certain Raster storage environments may apply to this tool.
For the Pyramid environment settings, only the Build pyramids setting is honored. The remaining Pyramid environment settings are ignored. More control over the nature of the pyramids can be obtained in a subsequent step by using the Build Pyramids tool.
For the Compression environment settings, only the type of compression may be honored. This is only for raster formats other than Esri Grid.
Syntax
arcpy.conversion.PointToRaster(in_features, value_field, out_rasterdataset, {cell_assignment}, {priority_field}, {cellsize})
Parameter | Explanation | Data Type |
in_features | The point or multipoint input feature dataset to be converted to a raster. | Feature Layer |
value_field | The field used to assign values to the output raster. It can be any field of the input feature dataset's attribute table. If the Shape field of a point or multipoint dataset contains z or m values, then either of these can be used. | Field |
out_rasterdataset | The output raster dataset to be created. When not saving to a geodatabase, specify .tif for a TIFF file format, .CRF for CRF file format, .img for an ERDAS IMAGINE file format, or no extension for an Esri Grid raster format. | Raster Dataset |
cell_assignment (Optional) | The method to determine how the cell will be assigned a value when more than one feature falls within a cell.
| String |
priority_field (Optional) | This field is used when a feature should take preference over another feature with the same attribute. Priority field is only used with the MOST_FREQUENT cell assignment type option. | Field |
cellsize (Optional) | The cell size for the output raster being created. This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn’t been explicitly specified as the parameter value, then the environment cell size value is used if specified; otherwise some additional rules are used to calculate it from the other inputs. See the usage for more detail. | Analysis Cell Size |
Code sample
PointToRaster example 1 (Python window)
Converts point features to a raster dataset.
import arcpy
from arcpy import env
env.workspace = "c:/data"
arcpy.PointToRaster_conversion("ca_ozone_pts.shp", "ELEVATION",
"c:/output/ca_elev", "MAXIMUM", "", 2000)
PointToRaster example 2 (stand-alone script)
Converts point features to a raster dataset.
# Name: PointToRaster_Ex_02.py
# Description: Converts point features to a raster dataset.
# Import system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data"
# Set local variables
inFeatures = "ca_ozone_pts.shp"
valField = "ELEVATION"
outRaster = "c:/output/ca_elev02"
assignmentType = "MAXIMUM"
priorityField = ""
cellSize = 2000
# Execute PointToRaster
arcpy.PointToRaster_conversion(inFeatures, valField, outRaster,
assignmentType, priorityField, cellSize)
Environments
Licensing information
- Basic: Requires Spatial Analyst or 3D Analyst
- Standard: Requires Spatial Analyst or 3D Analyst
- Advanced: Yes