Select to view content in your preferred language

Connect to Mosaic Image Server and apply Lock Raster Id

3727
6
11-24-2010 09:55 AM
JamesNyberg
Deactivated User
Programmatically, I can connect to and add a ServiceLayer from an ImageServer, but cannot figure out how to apply a specific Mosaic Method, nor the Lock Raster Id.  Which classes expose these attributes of a ServiceLayer?  From the AGX UI, you would perform the same by going to a service layer's properties and on the "Image Service" tab, editing "Mosaic" group properties.

I've attached an image with the AGX UI properties of which i would like to Programmatically set.
0 Kudos
6 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

Unfortunately there is no access to Image Service properties via the API in the current release. I you would like to see this added in future please submit the idea at http://ideas.arcgis.com

Regards

Mike
0 Kudos
JerryGarcia
Frequent Contributor
Hi,

Unfortunately there is no access to Image Service properties via the API in the current release. I you would like to see this added in future please submit the idea at http://ideas.arcgis.com

Regards

Mike


This is a critical requirement for our customer in the current release.  Is there a viable work around?  For example, could we connect to a GP model which would create the raster layer and load it into AGX?  Thanks for your help!
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

I don't believe you need to use a GP service to do this - you should just be able to use the Image Service itself (but in the same way you were probably expecting to need to write a GP Service). You would pass the raster ID into the Mosaic Rule parameter of the Export Image request which would create a raster dataset from which you then create a local RasterLayer.

- Example Image Service: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/World/Temperature/ImageServer/exportImage...

- REST API Help (for info): http://sampleserver3.arcgisonline.com/ArcGIS/SDK/REST/index.html?exportimage.html

- For an example SOAP WSDL see http://sampleserver3.arcgisonline.com/ArcGIS/services/World/Temperature/ImageServer?wsdl


If you're writing a .NET Add-in for Explorer then the ArcGIS Server SOAP API is probably going to be the easiest to use but you could use the REST API if you are that way inclined.

Here's an example from the SOAP API Help (http://help.arcgis.com/en/arcgisserver/10.0/apis/soap/SOAP_CSharp_Examples.htm#ExportImage):

ExportImage

//define image server

string url_DEMService = "http://ais3/arcgis/services/testDEM/ImageServer";

testDTED_ImageServer imageSrv = new testDTED_ImageServer();

imageSrv.Url = url_DEMService;



//define image description

GeoImageDescription geoImgDesc = new GeoImageDescription();

geoImgDesc.Height = 600;

geoImgDesc.Width = 800;

geoImgDesc.Interpolation = rstResamplingTypes.RSP_BilinearInterpolation;

ImageServiceInfo isInfo = imageSrv.GetServiceInfo();

geoImgDesc.Extent = isInfo.Extent;



//define a hillshade function and attach to a rendering rule

RenderingRule renderRule = new RenderingRule();

HillshadeFunction function = new HillshadeFunction();

HillshadeFunctionArguments argument = new HillshadeFunctionArguments();

argument.Names = new string[] { "Altitude", "Azimuth", "ZFactor" };

argument.Values = new object[] { 45, 315, 1.0 };

renderRule.Arguments = argument;

renderRule.Function = function;

renderRule.VariableName = "DEM";

geoImgDesc.RenderingRule = renderRule;



//define export format

ImageType imageType = new ImageType();

imageType.ImageFormat = esriImageFormat.esriImageJPG;

imageType.ImageReturnType = esriImageReturnType.esriImageReturnURL;

ImageResult result = imageSrv.ExportImage(geoImgDesc, imageType);



//download result

string fileName = @"c:\temp\hillshadeFunction.jpg";

System.Net.WebClient webClient = new System.Net.WebClient();

webClient.DownloadFile(result.ImageURL, fileName);


Regards

Mike
0 Kudos
JerryGarcia
Frequent Contributor
I think this just exports an image.  We need to add a layer to ArcGIS Explorer that just shows one raster in a mosaic image service.

Can you use the GP tool "Make Image Server Layer" to create a raster layer which can be added into ArcGIS Explorer?

Hi,

I don't believe you need to use a GP service to do this - you should just be able to use the Image Service itself (but in the same way you were probably expecting to need to write a GP Service). You would pass the raster ID into the Mosaic Rule parameter of the Export Image request which would create a raster dataset from which you then create a local RasterLayer.

- Example Image Service: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/World/Temperature/ImageServer/exportImage...

- REST API Help (for info): http://sampleserver3.arcgisonline.com/ArcGIS/SDK/REST/index.html?exportimage.html

- For an example SOAP WSDL see http://sampleserver3.arcgisonline.com/ArcGIS/services/World/Temperature/ImageServer?wsdl


If you're writing a .NET Add-in for Explorer then the ArcGIS Server SOAP API is probably going to be the easiest to use but you could use the REST API if you are that way inclined.

Here's an example from the SOAP API Help (http://help.arcgis.com/en/arcgisserver/10.0/apis/soap/SOAP_CSharp_Examples.htm#ExportImage):

ExportImage

//define image server

string url_DEMService = "http://ais3/arcgis/services/testDEM/ImageServer";

testDTED_ImageServer imageSrv = new testDTED_ImageServer();

imageSrv.Url = url_DEMService;



//define image description

GeoImageDescription geoImgDesc = new GeoImageDescription();

geoImgDesc.Height = 600;

geoImgDesc.Width = 800;

geoImgDesc.Interpolation = rstResamplingTypes.RSP_BilinearInterpolation;

ImageServiceInfo isInfo = imageSrv.GetServiceInfo();

geoImgDesc.Extent = isInfo.Extent;



//define a hillshade function and attach to a rendering rule

RenderingRule renderRule = new RenderingRule();

HillshadeFunction function = new HillshadeFunction();

HillshadeFunctionArguments argument = new HillshadeFunctionArguments();

argument.Names = new string[] { "Altitude", "Azimuth", "ZFactor" };

argument.Values = new object[] { 45, 315, 1.0 };

renderRule.Arguments = argument;

renderRule.Function = function;

renderRule.VariableName = "DEM";

geoImgDesc.RenderingRule = renderRule;



//define export format

ImageType imageType = new ImageType();

imageType.ImageFormat = esriImageFormat.esriImageJPG;

imageType.ImageReturnType = esriImageReturnType.esriImageReturnURL;

ImageResult result = imageSrv.ExportImage(geoImgDesc, imageType);



//download result

string fileName = @"c:\temp\hillshadeFunction.jpg";

System.Net.WebClient webClient = new System.Net.WebClient();

webClient.DownloadFile(result.ImageURL, fileName);


Regards

Mike
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Agreed, Make Image Server Layer should do the trick. It returns a Raster Layer which you can add to ArcGIS Explorer. First of all you can create the service then use the OOTB "Analysis Gallery" in ArcGIS Explorer to consume the service. From there you can write a custom Add-in if you like to provide an alternative, tailored UI for your workflow.

Regards

Mike
0 Kudos
JerryGarcia
Frequent Contributor
Excellent.  I tried doing this, but I'm not sure how to get the Raster Layer into ArcGIS Explorer.  See this post:

http://forums.arcgis.com/threads/18499-Make-Image-Server-Layer-output-goes-where-MakeImageServerLaye...


Hi,

Agreed, Make Image Server Layer should do the trick. It returns a Raster Layer which you can add to ArcGIS Explorer. First of all you can create the service then use the OOTB "Analysis Gallery" in ArcGIS Explorer to consume the service. From there you can write a custom Add-in if you like to provide an alternative, tailored UI for your workflow.

Regards

Mike
0 Kudos