Polygon To Raster (Conversion) (ArcInfo only) |
|
Release 9.2
Last modified April 2, 2008 |
![]() ![]() ![]() Print all topics in : "Tools" |
NOTE: This tool is available with an ArcView or ArcEditor license, if the Spatial Analyst extension or the 3D Analyst extension is installed.
Converts polygon features to a raster dataset.
Learn more about how the Polygon To Raster tool works
Usage tips
Any shapefile, coverage, or geodatabase feature class containing polygon features can be converted to a raster dataset.
If the input field contains floating-point values, the output raster will be floating point; if the input field contains integer values, the output raster will be integer; and if the input field contains string values, the output raster will contain an integer value field and a string field.
Polygon To Raster is a complement to the Raster To Polygon tool, which converts a raster to a feature dataset.
Polygon To Raster is a new implementation of the Feature To Raster tool. It provides greater user control over the assignment of cell values when more than one feature is present in the output cell.
If "bleeding" occurs in the output raster then use the Check Geometry and Repair Geometry tools to correct the input feature data.
When converting overlapping polygons, to ensure that the polygons with the smallest area are assigned to a cell, one suggestion is to add an additional field to the input feature class and calculate the inverse area of the polygons. Use this field as the priority field when running the Polygon To Raster tool.
The output cell size is the size of each pixel in the output raster dataset.
The following environments affect this tool: current workspace, scratch workspace, output coordinate system, output extent, output has Z values, Z resolution, output CONFIG keyword, output spatial grid 1,2,3, output XY domain, output Z domain, pyramid, raster statistics, compression, and tile size.
Command line syntax
An overview of the Command Line window
PolygonToRaster_conversion <in_features> <value_field> <out_raster_dataset> {CELL_CENTER | MAXIMUM_AREA | MAXIMUM_COMBINED_AREA} {priority_field} {cellsize}
Parameter | Explanation | Data Type |
<in_features> |
The polygon 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. |
Field |
<out_raster_dataset> |
The output raster dataset to be created. When you're not saving to a geodatabase, specify .tif for a TIFF file format, .img for an ERDAS IMAGINE file format, or no extension for a GRID file format. |
Raster Dataset |
{CELL_CENTER | MAXIMUM_AREA | MAXIMUM_COMBINED_AREA} |
The method to determine how the cell will be assigned a value when more than one feature falls within a cell.
|
String |
{priority_field} |
This field is used when a feature should take preference over another feature with the same attribute. |
Field |
{cellsize} |
The cell size from which the output raster dataset will be created. |
Analysis cell size |
PolygonToRaster c:\data\myPolys.shp myField myRaster MAXIMUM_AREA NONE 5.2
Scripting syntax
About getting started with writing geoprocessing scripts
PolygonToRaster_conversion (in_features, value_field, out_raster_dataset, cell_assignment, priority_field, cellsize)
Parameter | Explanation | Data Type |
in_features (Required) |
The polygon input feature dataset to be converted to a raster. |
Feature Layer |
value_field (Required) |
The field used to assign values to the output raster. It can be any field of the input feature dataset's attribute table. |
Field |
out_raster_dataset (Required) |
The output raster dataset to be created. When you're not saving to a geodatabase, specify .tif for a TIFF file format, .img for an ERDAS IMAGINE file format, or no extension for a GRID file 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. |
Field |
cellsize (Optional) |
The cell size from which the output raster dataset will be created. |
Analysis cell size |
# PolygonToRaster_conversion_sample.py # Description: # Converts polygon features to a raster. # Requirements: None # Author: ESRI # Date: Oct 20, 2005 # Import system modules import arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create() try: # Set local variables InFeatures = "C:/data/myPolys.shp" OutRaster = "C:/data/out_raster" # Process: PolygonToRaster gp.PolygonToRaster_conversion(InFeatures, "myField", OutRaster, "MAXIMUM_AREA", "priorFld", "1") except: # Print error message if an error occurs gp.GetMessages()