ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Make Raster Layer

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates a raster layer from an input raster dataset or layer file. The layer that is 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 make your layer permanent, right-click the layer in the table of contents and click Save As Layer File, or use the Save To Layer File tool.

  • 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.

Syntax

MakeRasterLayer_management (in_raster, out_rasterlayer, {where_clause}, {envelope}, {band_index})
ParameterExplanationData 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)

A query statement using the fields and values of the raster dataset.

SQL Expression
envelope
(Optional)

Specify the extent of the raster layer, using the minimum x, minimum y, maximum x, and maximum y.

Extent
band_index
ID
(Optional)

Choose which bands to export for the layer. If no bands are specified, then all the bands will be used in the output.

Value Table

Code sample

MakeRasterLayer example 1 (Python window)

This is a Python sample for MakeRasterLayer.

import arcpy
arcpy.MakeRasterLayer_management("c:/workspace/image.tif", "rdlayer", "#", "feature.shp", "1")
MakeRasterLayer example 2 (stand-alone script)

This is a Python script sample for MakeRasterLayer.

##====================================
##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

  • Current Workspace
  • Scratch Workspace

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Layers and Table Views toolset
  • Using layers and table views
  • Working with layers and table views

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal