Label | Explanation | Data Type |
Input raster | The path and name of the input raster dataset. You can use a raster layer from a GeoPackage as the input. To reference a raster within a GeoPackage, type the name of the path, followed by the name of the GeoPackage and the name of the raster. For example, c:\data\sample.gpkg\raster_tile would be your input raster, where sample.gpkg is the name of the GeoPackage and raster_tile is the raster dataset within the package. | Composite Geodataset |
Output raster layer name | The name of the layer to create. | Raster Layer |
Where clause (Optional) | Define a query using SQL or use the Query Builder to build a query. | SQL Expression |
Envelope (Optional) |
The output extent can be specified by defining the four coordinates or by using the extent of an existing layer.
| Extent |
Bands (Optional) | The bands that will be exported for the layer. If no bands are specified, all the bands will be used in the output. | Value Table |
Summary
Creates a raster layer from an input raster dataset or layer file. The layer created by the tool is temporary and will not persist after the session ends unless the layer is saved to disk or the map document is saved.
This tool can be used to make a temporary layer, so you can work with a specified subset of bands within a raster dataset.
Usage
To persist your layer, right-click the layer in the Contents Pane and click Save As Layer File, or use the Save To Layer File tool.
The output can be created with only a subset of the bands. This will help save time and disk space.
You can use a raster layer from a GeoPackage as the input. To reference a raster within a GeoPackage, type the name of the path, followed by the name of the GeoPackage and the name of the raster. For example, c:\data\sample.gpkg\raster_tile would be your input raster, where sample.gpkg is the name of the GeoPackage and raster_tile is the raster dataset within the package.
Parameters
arcpy.management.MakeRasterLayer(in_raster, out_rasterlayer, {where_clause}, {envelope}, {band_index})
Name | Explanation | Data Type |
in_raster | The path and name of the input raster dataset. You can use a raster layer from a GeoPackage as the input. To reference a raster within a GeoPackage, type the name of the path, followed by the name of the GeoPackage and the name of the raster. For example, c:\data\sample.gpkg\raster_tile would be your input raster, where sample.gpkg is the name of the GeoPackage and raster_tile is the raster dataset within the package. | Composite Geodataset |
out_rasterlayer | The name of the layer to create. | Raster Layer |
where_clause (Optional) | Define a query using SQL. | SQL Expression |
envelope (Optional) |
The output extent can be specified by defining the four coordinates or by using the extent of an existing layer.
| Extent |
band_index [band_index,...] (Optional) | The bands that will be exported for the layer. If no bands are specified, all the bands will be used in the output. | Value Table |
Code sample
This is a Python sample for the MakeRasterLayer tool.
import arcpy
arcpy.MakeRasterLayer_management("c:/workspace/image.tif", "rdlayer", "#", "feature.shp", "1")
This is a Python script sample for MakeRasterLayer tool.
##====================================
##Make Raster Layer
##Usage: MakeRasterLayer_management in_raster out_rasterlayer {where_clause} {envelope}
## {Index;Index...}
import arcpy
arcpy.env.workspace = r"C:/Workspace"
##Create raster layer from single raster dataset with clipping feature
arcpy.MakeRasterLayer_management("image.tif", "rdlayer", "#", "feature.shp", "1")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes