Multipatch to Raster (Conversion)

Summary

Converts multipatch features to a raster dataset.

Illustration

Multipatch to Raster illustration

Usage

  • The output raster stores the Z values of the input multipatch features at each cell center location. To determine the Z value for each cell, a vertical line is extended from the cell center location to intersect the input multipatch features. The maximum Z value from the points of intersection is assigned to the output raster. An output cell will receive a value if the cell center falls within the footprint of one or more input multipatch features; otherwise, it will be assigned NoData.

  • Vertical triangles—essentially vertical walls without a roof—are excluded from the rasterization so will not be represented in the output raster.

  • The Output cell size 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 neither the parameter cell size nor the environment cell size has been specified, but the environment Snap Raster has been set, the cell size of the snap raster is used. If nothing has been specified, 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 has been specified using a numeric value, the tool will use it directly for the output raster.

    If the cell size has been 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 allows you to burn 3D building features (as multipatches) in an urban space into a Digital Elevation Model (DEM). To accomplish this, first use this tool to convert the multipatch features into a raster. Then use the Mosaic tool to mosaic the buildings raster with the DEM raster. With the resulting elevation raster, you can run other tools that operate on raster data to solve analysis problems in an urban space. For example, you can run the Viewshed tool to calculate the visibility or the solar radiation tools to calculate the rooftop solar energy potential for the buildings in an urban environment.

  • By default, this tool will take advantage of multicore processors. The maximum number of cores that can be used is four.

    To use fewer cores, use the Parallel Processing Factor environment setting.

Syntax

arcpy.conversion.MultipatchToRaster(in_multipatch_features, out_raster, {cell_size})
ParameterExplanationData Type
in_multipatch_features

The input multipatch features to be converted to a raster.

Feature Layer
out_raster

The output raster dataset to be created.

It will be of floating point type.

If the output raster will not be saved to a geodatabase, specify .tif for TIFF file format, .CRF for CRF file format, .img for ERDAS IMAGINE file format, or no extension for Esri Grid raster format.

Raster Dataset
cell_size
(Optional)

The cell size of 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, the environment cell size value is used, if specified; otherwise, additional rules are used to calculate it from the other inputs. See Usages for more detail.

Analysis Cell Size

Code sample

MultipatchToRaster example 1 (Python window)

This example converts a multipatch shapefile into a raster and saves the output raster in IMG format.

import arcpy
from arcpy import env
env.workspace = "c:/data"
arcpy.MultipatchToRaster_conversion("buildings.shp",
                                    "c:/output/outbuildings.img", 0.25)
MultipatchToRaster example 2 (stand-alone script)

This example converts a multipatch shapefile into a raster and saves the output raster in TIFF format.

# Name: MultipatchToRaster_Ex_02.py
# Description: Converts multipatch 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 = "buildings.shp"
outRaster = "c:/output/outbuildings.tif"
cellSize = 0.5

# Execute MultipatchToRaster
arcpy.MultipatchToRaster_conversion(inFeatures, outRaster, cellSize)

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics