Conversion Tools#
We have so far dealt with vector and raster data separately, but several tools are available to convert from vector to raster and vice versa. These conversion tools can be necessary at times to bring in additional categorical data into models based on raster analysis.
The conversion tools are available in the Geoprocessing toolbox under Conversion Tools:
Feature Class to Raster#
Under the “To Raster” section, several tools are available, including Feature to Raster, Point to Raster, Polyline to Raster, and Polygon to Raster. In reality, the Feature to Raster has all the functionality needed to convert from a feature class (whether point, polyline, or polygon) to a raster.
In the following example, we input several points representing archaeological sites into the Feature to Raster tool. The Field parameter will determine the values of the output raster. The output cell size will, of course, determine the cell size of the output raster. To snap the raster to an existing dataset, load the appropriate raster layer into Snap Raster under the Environments tab of the Feature to Raster tool. We then get a raster of single pixels in the point locations, aligned to the snapped raster:
If we input the following line feature into the Feature to Raster tool:
with output cell size set to 10 m, we generate the following raster:
If we input polygons:
we achieve an output like the following:
With higher resolution (smaller cell size), we get an output almost indistinguishable from the vector layer:
Raster to Feature Class#
Under Conversion tools, several additional tools can convert raster layers to feature classes. The Raster to Point tool will generate points located at the center of each cell, with the value of that cell included as a field in the new layer’s attribute table.
The Raster to Polyline tool converts a raster grid to a polyline feature class. A background value must be set (either 0 or NoData). The Simplify Polygons option can be checked to reduce the number of vertices in the resulting feature class; alternatively, if unchecked, the output feature class will match exactly the shape of the cells in the input raster. The input raster must be of integer type.
The Raster to Polygon tool converts a raster layer to a polygon feature class. With the following input raster layer representing a classified digital elevation model:
We generate the following polygon feature class:
The Simplify Polygons option will reduce the number of vertices, and the Create multipart features option will create a single record for each output polygon. The input raster must be of integer type.