How to work with image services

Before you create an image service, you first need to prepare your input data then select the capabilities you want the image service to support. Once you have determined the functionality, you use data management tools to publish a hosted imagery layer (item) and image service. This process is known as publishing a imagery layer. After an image service is created, you can use the hosted imagery layer to manage the layer and the service settings.

The general steps to work with image services.

1. Prepare source data

Before hosting raster data as an image service, it is essential to optimize the raster data. This will ensure optimal performance and user experience for analysis and visualization tasks.

To prepare your source data:

  1. Get the raster data
  2. Optimize raster data
  3. Decide image service capabilities

2. Select image service output data

Select the output data you would like the image service to provide based on your specific requirements. This can include specifying the type and format of the image, as well as any additional metadata or analytical results.

  • Tiled imagery layer (static tiles)

    An image service supports accessing data as static tiles which are pre-generated and cached tiles that include additional data such as the source pixel values. These tiles are stored in formats like LERC2D, JPEGPLUS, or JPGPNG.

  • Imagery layer (export images)

    An image service enables access to data as dynamically generated images. These images are produced for each request to the service, returning a new image along with metadata such as the image's URL, extent, width, and height. The functions and parameters can be adjusted for each request, allowing the creation of multiple image products on demand from a single source.

3. Create image service

To create an imagery layer in an image service, you begin by uploading your raster files to the portal using data management tools or Client APIs.

To create an image service:

  • Select the capabilities you want your image service to support.
  • Configure the raster properties as needed.
  • Upload a single raster dataset or multiple raster dataset types.
  • Manage the image service settings through a hosted imagery layer (item) in your portal.

Code examples

Here are code examples to create an image service.

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JSArcGIS REST API
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import arcgis
from arcgis.gis import GIS
from arcgis.raster.analytics import copy_raster

# Connect to your portal
gis = GIS(username="USERNAME", password="PASSWORD")

# Define the path to your raster data
raster_path = r"C:\path\to\your\raster.tif"

# Define the name for your new image service
image_service_name = "MyImageService"

# Create the image service
image_service = copy_raster(
    input_raster=raster_path,
    output_name=image_service_name,
    gis=gis,
    raster_type_name="Raster Dataset",
    context={"image_collection_properties": {"imageCollectionType": "Satellite"}}
)

# Print the URL of the newly created image service
print(f"Image service created: {image_service.url}")

4. Access the image service

The steps to display imagery layer are:

  1. Get the URL for the imagery layer service you want to display.
  2. Set the service URL for the imagery layer service.
  3. Add the layer to a map.
Image service showing global land cover raster data at 10 m resolution.
ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for QtEsri LeafletMapLibre GL JSOpenLayersCesiumJS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
        const imageryLayer = new ImageryLayer({
          portalItem: {
            id: "63fe6ad86c3d4536a3c44a0fbad0045e",
          },
        })
        map.add(imageryLayer)
Expand

Services

API support

Use data management tools or Client APIs to create, manage, and access data services. The table below outlines the level of support for each API.

CreateManageAccess
ArcGIS Maps SDK for JavaScript1
ArcGIS Maps SDK for Kotlin1
ArcGIS Maps SDK for Swift1
ArcGIS Maps SDK for Flutter1
ArcGIS Maps SDK for Java1
ArcGIS Maps SDK for .NET1
ArcGIS Maps SDK for Qt1
ArcGIS API for Python
ArcGIS REST JS
Esri Leaflet2
MapLibre GL JS23
OpenLayers23
Full supportPartial supportNo support
  • 1. Use portal class and direct REST API requests
  • 2. Access via ArcGIS REST JS
  • 3. Requires manually setting styles for renderers

Tools

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.