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 [11]:
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)
Landsat 8 Views
Landsat 8 OLI, 30m Multispectral 8 band scenes with visual renderings and indices. Updated daily.Imagery Layer by esri
Last Modified: December 07, 2016
0 comments, 123,706 views
MDA NaturalVue Satellite Imagery
This image service presents NaturalVue 15m satellite imagery of the world created by MDA Information Systems Inc.Imagery Layer by esri
Last Modified: December 22, 2016
0 comments, 41,049 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 8 band scenes with visual renderings and indices. Updated daily.Imagery Layer by esri
Last Modified: December 07, 2016
0 comments, 124,335 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]: