This document is archived and information here might be outdated. Recommended version. |
Provides access to members that control an image server layer.
This interface is new at ArcGIS 9.3.
Name | Description | |
---|---|---|
AreaOfInterest | The default area of interest for the layer. | |
Cached | Indicates if the layer needs its own display cache. | |
Compression | The transmission compression. | |
CompressionQuality | The transmission compression quality. | |
DataFrameExtent | The extent of the dataframe that contains the layer. | |
DataSource | Layer�s data source object. | |
Draw | Draws the layer to the specified display for the given draw phase. | |
Initialize | Initializes the layer with an image service URL. | |
MaximumScale | Maximum scale (representative fraction) at which the layer will display. | |
MinimumScale | Minimum scale (representative fraction) at which the layer will display. | |
Name | Layer name. | |
Raster | The assoicated raster. | |
Renderer | The assoicated raster renderer. | |
ServiceInfo | The image service info. | |
ServiceURL | The layer�s service URL. | |
ShowResolution | Indicates if the image resolution should be displayed in TOC. | |
ShowTips | Indicates if the layer shows map tips. | |
SpatialReference | Spatial reference for the layer. | |
SupportedDrawPhases | Supported draw phases. | |
TipText | Map tip text at the specified location. | |
Valid | Indicates if the layer is currently valid. | |
Visible | Indicates if the layer is currently visible. | |
VisibleExtent | The Visible extent of the layer in the data frame. |
Interfaces | Description |
---|---|
ILayer | Provides access to members that work with all layers. |
CoClasses and Classes | Description |
---|---|
ImageServerLayer | Image server layer source and display options. |
IImageServerLayer interface allows you to access properties of an ImageServerLayer created from an ImageServer. The properties include compression type and quality, serviceinfo, service URL, and so on. An ImageServerLayer is similar to a RasterLayer; you can change how the pixels render on the display by changing the renderer applied to the layer.
ImageServerLayer needs to be initialized using the Initialize method before use.
This example shows how to create an image server layer from a URL, clip a portion of image and save it to a file.
public static void AccessImageServerLayer()
{
//create an image server layer by passing an URL
IImageServerLayer2 imageserverlayer=new ImageServerLayerClass();
string URL="http://myserver/arcgis/services/amazon/imageserver";
imageserverlayer.Initialize(URL);
//get raster from the image server layer
IRaster raster=imageserverlayer.Raster;
//raster from image server is normally large, you need to
//define the size of the raster
IRasterProps rasterProps=(IRasterProps)raster;
IEnvelope clipEnvelope=new EnvelopeClass();
clipEnvelope.PutCoords(779000, 9628000, 786000, 9634000);
rasterProps.Extent=clipEnvelope;
rasterProps.Width=256;
rasterProps.Height=256;
//save the clipped raster to File Geodatabase
ISaveAs saveas=(ISaveAs)raster;
IWorkspaceFactory workspaceFact=new FileGDBWorkspaceFactoryClass();
IWorkspace workspace=workspaceFact.OpenFromFile("c:\temp\fgdb.gdb",0);
saveas.SaveAs("clipfromimageserverlayer", workspace, "gdb");
}
This example shows how to create an image server layer from a URL, clip a portion of image and save it to a file.
Public Shared Sub AccessImageServerLayer()
'create an image server layer by passing an URL
Dim imageserverlayer As IImageServerLayer2=New ImageServerLayerClass()
Dim URL As String="http://myserver/arcgis/services/amazon/imageserver"
imageserverlayer.Initialize(URL)
'get raster from the image server layer
Dim raster As IRaster=imageserverlayer.Raster
'raster from image server is normally large, you need to
'define the size of the raster
Dim rasterProps As IRasterProps=CType(raster, IRasterProps)
Dim clipEnvelope As IEnvelope=New EnvelopeClass()
clipEnvelope.PutCoords(779000, 9628000, 786000, 9634000)
rasterProps.Extent=clipEnvelope
rasterProps.Width=256
rasterProps.Height=256
'save the clipped raster to File Geodatabase
Dim saveas As ISaveAs=CType(raster, ISaveAs)
Dim workspaceFact As IWorkspaceFactory=New FileGDBWorkspaceFactoryClass()
Dim workspace As IWorkspace=workspaceFact.OpenFromFile("c:" & Constants.vbTab & "emp" & Constants.vbFormFeed & "gdb.gdb",0)
saveas.SaveAs("clipfromimageserverlayer", workspace, "gdb")
End Sub