CreateService

The CreateService ISCommand is used to create a new image service definition.

The default command line is:

ISCommand CreateService --ISDef=<PathAndNameOfISDefFolder> --BitDepth=<value> –-NBands=<value> --ColorSpace=<value> --SrsPrj=<PrjString>        

The table below defines the variables that are required to use this script. Most variables are defined within the script. You can either make an edit to the script or enter the variable at the command line as shown below.

Variable

Description/Options

Default

Required

ISDef

Path and file name of the image service definition.

Untitled

Yes

BitDepth

The number of bits of the image.

1, 2, 4, 8, 12, 16, 32, etc.

8

Yes

NBands

The number of bands that will be mosaicked together to form the output of the image service.

Any number, 1 or greater.

3

Yes

PixelType

The pixel type of images that will be mosaicked to form the output of the image service.

Byte: Unsigned 8-bit Integer, UInt16: Unsigned 16-bit Integer, Int16: Signed 16-bit Integer, UInt32: Unsigned 32-bit Integer, Int32: Signed 32-bit Integer, Float32:32-bit Floating-point, Float64: 64-bit Floating-point, CInt16: Complex 16-bit Integer, CInt32: Complex 32-bit Integer, CFloat32: Complex 32-bit Floating-point, CFloat64: Complex 64-bit Floating-point, Elevation: Elevation

User specified

Yes

ColorSpace

Defines the relationship between the bands for each pixel. For example, 0, 1, or 2, where

0: Grayscale, 1: RGB, 2: CMYK, 3: YCbCr, 4: YUV, 5: LHS, 6: YCCK, 7: Palette, 255: Unknown

1

Yes

SrsPrj

The spatial reference system used for the image service, for all internal searches and derived tiles. To define a spatial reference system, you need to specify the text as an argument or embed it in a script (see the example below).

World Mercator

Yes

Example:

ISCommand CreateService --ISDef=c:\Test1.ISDef -BitDepth=8 -NBands=3 -Colorspace=1 -SrsPrj= PROJCS["World_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",0],PARAMETER["Standard_Parallel_1",0],UNIT["Meter",1]]

The default spatial reference system for this image service is World Mercator. It is defined as a value for the <SrsPrj> node. You can override this in the command line; however, there might be cases where overriding the spatial reference system won’t work if it is a long string. In that case, you can directly edit the XML by replacing the <SrsPrj> node with the desired spatial reference system string.

In the example below, you can override the spatial reference system where you can see that a double quote (“) is prefixed with backward slash (\). Make sure that you put a backward slash (\) before every double quote (“) so that DOS considers the spatial reference system string as one string.

ISCommand CreateService --ISDef=c:\Test2.ISDef --NBands=3 --BitDepth=8 --PixelType=Byte --SrsPrj=GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]