What I am trying to achieve is to either filter an existing Arcgis imageserver service, or get the results of a query and display them. The reason I want to do this is that I have a huge mosaic dataset and I want to display individual Map-Sheets (cause sometimes they even overlap).
by using this code I manage to connect to the service, query the desired image and get its attributes.
IImageServer3 imageServer3 = (IImageServer3)GetImageServer("http://xxx.xxx.x.xxx:6080/arcgis/services", "ServiceFolder/Sample Service", false); IQueryFilter attFilter = new ImageQueryFilterClass(); attFilter.WhereClause = "Name = '0212043980'"; int count = imageServer3.GetCatalogItemCount(attFilter); MessageBox.Show(count.ToString());With this I download the desired Image and then I add it as a layer. var fff = imageServer3.GetCatalogItemIDs(attFilter); System.Net.WebClient webClient = new System.Net.WebClient();
IImageServerDownloadResults isDownloadResults = imageServer3.Download(fff, null, null); IImageServerDownloadResult isDownloadResult; string url, fileName; for (int i = 0; i < isDownloadResults.Count; i++) { isDownloadResult = isDownloadResults.get_Element(i); url = imageServer3.GetFile(isDownloadResult); fileName = "c:\\temp\\" + url.Substring(url.LastIndexOf("/") + 1); webClient.DownloadFile(url, fileName); }But the thing is that I do not want to download the image (cause most of the times the images and huge) I want just to display it as a service.
I've done this in the past using the javascript web api, but i cant really understand if there is a way to do it on a desktop addin using or not.
أكثر...
by using this code I manage to connect to the service, query the desired image and get its attributes.
IImageServer3 imageServer3 = (IImageServer3)GetImageServer("http://xxx.xxx.x.xxx:6080/arcgis/services", "ServiceFolder/Sample Service", false); IQueryFilter attFilter = new ImageQueryFilterClass(); attFilter.WhereClause = "Name = '0212043980'"; int count = imageServer3.GetCatalogItemCount(attFilter); MessageBox.Show(count.ToString());With this I download the desired Image and then I add it as a layer. var fff = imageServer3.GetCatalogItemIDs(attFilter); System.Net.WebClient webClient = new System.Net.WebClient();
IImageServerDownloadResults isDownloadResults = imageServer3.Download(fff, null, null); IImageServerDownloadResult isDownloadResult; string url, fileName; for (int i = 0; i < isDownloadResults.Count; i++) { isDownloadResult = isDownloadResults.get_Element(i); url = imageServer3.GetFile(isDownloadResult); fileName = "c:\\temp\\" + url.Substring(url.LastIndexOf("/") + 1); webClient.DownloadFile(url, fileName); }But the thing is that I do not want to download the image (cause most of the times the images and huge) I want just to display it as a service.
I've done this in the past using the javascript web api, but i cant really understand if there is a way to do it on a desktop addin using or not.
أكثر...