Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGIS API for Python

Using Imagery Layers

The arcgis.raster module contains classes and raster analysis functions for working with raster data and imagery layers.

Raster data is made up of a grid of cells, where each cell or pixel can have a value. Raster data is useful for storing data that varies continuously, as in a satellite image, a surface of chemical concentrations, or an elevation surface.

The Imagerylayer class represents an image service resource as a layer. An ImageryLayer object retrieves and displays data from image services. ImageryLayer allows you to and apply server defined or client-defined rendering rules (e.g. remap, colormap), and mosaic rules.

Accesssing Imagery Layers

Imagery layer items are available as content in the GIS. You can search the GIS for imagery layer items, or get them using their item id:

Searching the GIS for imagery layer items

You can search the GIS for imagery layers by specifying the item type as Imagery Layer:

In [1]:
import arcgis
from arcgis.gis import GIS
from IPython.display import display

gis = GIS()
In [2]:
items = gis.content.search("Landsat 8 Views", item_type="Imagery Layer", max_items=2)
In [3]:
for item in items:
    display(item)
Pansharpened Landsat
Landsat 8 OLI, 15m multitemporal PanSharpened Natural Color images. This imagery layer is sourced from the Landsat on AWS collections and is updated daily with new imagery.Imagery Layer by esri
Last Modified: May 03, 2018
0 comments, 44,825 views
Panchromatic Landsat
Landsat 8 OLI, 15m multitemporal Panchromatic images. This imagery layer is sourced from the Landsat on AWS collections and is updated daily with new imagery.Imagery Layer by esri
Last Modified: May 03, 2018
0 comments, 28,283 views

Retrieving Imagery Layer item using item id

Imagery Layers items can be obtained using their item id as well:

In [4]:
l8_views = gis.content.get('4ca13f0e4e29403fa68c46d188c4be73')
l8_views
Out[4]:
Landsat 8 Views
Landsat 8 OLI, 30m multispectral and multitemporal 8-band imagery, with on-the-fly renderings and indices. This imagery layer is sourced from the Landsat on AWS collections and is updated daily with new imagery.Imagery Layer by esri
Last Modified: May 03, 2018
0 comments, 157,377 views

Accessing ImageryLayer from Imagery Layer items

Like other layer based items in the GIS, imagery layer items allow access to the imagery layer through the layers property of the item. Each imagery layer item has one imagery layer instance in it's layers property:

In [5]:
l8_views.layers
Out[5]:
[<ImageryLayer url:"https://landsat2.arcgis.com/arcgis/rest/services/Landsat8_Views/ImageServer">]
In [6]:
l8_lyr = l8_views.layers[0]
l8_lyr
Out[6]:

Creating ImageryLayer from an image service url

ImageryLayer objects can also be constructed from an image service URL:

In [7]:
img_svc_url = 'https://landsat2.arcgis.com/arcgis/rest/services/Landsat8_Views/ImageServer'
In [8]:
from arcgis.raster import ImageryLayer
In [9]:
landsat_lyr = ImageryLayer(img_svc_url)
In [10]:
landsat_lyr
Out[10]: