Make Image Server Layer (Data Management)

Summary

Creates a temporary raster layer from an image service. The layer that is created will not persist after the session ends unless the document is saved.

The input can also be a URL to an image server.

Usage

Syntax

MakeImageServerLayer_management (in_image_service, out_imageserver_layer, {template}, {band_index}, {mosaic_method}, {order_field}, {order_base_value}, {lock_rasterid})
ParameterExplanationData Type
in_image_service

The name of the input image service, or the URL that references the image service.

An example of a URL is: http://AGSServer:8399/arcgis/services/ISName/ImageServer

Image Service; String
out_imageserver_layer

The name of the output image layer.

Raster Layer
template
(Optional)

The output extent of the image layer.

The output extent can either be specified by defining the area to be clipped (X-Minimum, Y-Minimum, X-Maximum, Y-Maximum) or by using the extent of an existing layer.

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
mosaic_method
(Optional)

The mosaic method defines how the mosaic is created from different rasters.

An image returned to the client can be created from a number of input rasters. The mosaic process has two default options available.

  • Closest_To_Center—Sorts rasters based on a default order where rasters that have their center closest to the view center are placed on top.
  • North_West—Sorts rasters based on an order where rasters that have their center closest to the northwest is placed on top.
  • Lock_Raster—Lock the display of single or multiple rasters based on an ID or name.
  • By_Attribute—Sorts rasters based on an attribute field and its difference from the base value.
  • Closest_To_Nadir—Sorts rasters based on an order where rasters that have their nadir position closest to the view center are placed on top. The nadir point can be different from the center point, especially in oblique imagery.
  • Closest_To_Viewpoint—Sorts rasters based on an order where the nadir position closest to the user-defined view point location is on top.
  • Seamline—Cuts the raster using a predefined seamline shape for each raster using optional feathering along the seams. The ordering is predefined during the seamline generation.
String
order_field
(Optional)

The default field to use to order the rasters when the mosaic method is By_Attribute. The list of fields is defined as those in the service table that are of type metadata and are integer (for example, the values can represent dates or cloud cover percentage).

String
order_base_value
(Optional)

The images are sorted based on the difference between this input value and the attribute value in the specified field.

String
lock_rasterid
(Optional)

Raster ID or raster name to which the service should be locked, such that only the specified rasters are displayed. If left blank (undefined), it will be similar to the system default. Multiple IDs can be defined as a semicolon-delimited list.

String

Code Sample

MakeImageServerLayer example 1 (Python window)

This is a Python sample for the MakeImageServerLayer tool.

import arcpy
from arcpy import env
env.workspace = "C:/Workspace"
input1 = "GIS Servers/server3 (admin)/File_TIFF_Amberg.ImageServer"
arcpy.MakeImageServerLayer_management(input1, "islayer", "4488961 5478909 4489227 5479255",\
                                          "4;6", "#", "#", "#", "#")
MakeImageServerLayer example 2 (stand-alone script)

This is a Python script sample for the MakeImageServerLayer tool.

##====================================
##Make Image Server Layer
##Usage: MakeImageServerLayer_management in_image_service out_imageserver_layer 
##                                       {template} {ID;ID...} {mosaic_method} 
##                                       {order_field} {order_base_value} {lock_rasterid}
    
try:
    import arcpy
    
    arcpy.env.workspace = r"C:/Workspace"
    input1 = r"GIS Servers\server3 (admin)\File_TIFF_Amberg.ImageServer"
    input2 = "http://server3/arcgis/services/MD_MosaicRule/ImageServer"
    
    ##Create image services layer from a single image file service
    ##Use connection file as input
    arcpy.MakeImageServerLayer_management(input1, "islayer", "4488961 5478909 4489227 5479255",\
                                          "4;6", "#", "#", "#", "#")
    
    ##Create image services layer from mosaic dataset image service
    ##Use URL as input
    arcpy.MakeImageServerLayer_management(input2, "mdlayer", "feature.shp", "1;2;3",\
                                          "LockRaster", "#", "#", "4")

    print arcpy.GetMessages()
    
except:
    print "Make Image Server Layer example failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

10/27/2014