This document is archived and information here might be outdated.  Recommended version.


How to access OGC WCS coverage (ArcObjects .NET 10.6 SDK)
ArcObjects Help for .NET developers > Developing with ArcGIS > Learning ArcObjects > Managing data > Working with image and raster data > Working with image services and WCS services > How to access OGC WCS coverage (ArcObjects .NET 10.6 SDK)

How to access OGC WCS coverage


Accessing OGC WCS coverage

To access a coverage served through an Open Geospatial Consortium (OGC) Web Coverage Service (WCS) server, see the following code example:
[C#]
//WCS service uniform resource locator (URL).
string URL="http://liaoning1/arcgis/services/dem/mapserver/wcsserver?";

//Create WCSLayer from the first coverage.
IWCSLayer wcslayer=new WCSLayerClass();
wcslayer.Create(URL, "1", "1.0.0");

//Access raster.
IRasterLayer rasterlayer=(IRasterLayer)wcslayer;
IRaster2 raster=(IRaster2)rasterlayer.Raster;

//Access raster dataset.
IRasterDataset rasterdataset=raster.RasterDataset;
[VB.NET]
'WCS service uniform resource locator (URL).
Dim URL As String="http://liaoning1/arcgis/services/dem/mapserver/wcsserver?"

'Create WCSLayer from the first coverage.
Dim wcslayer As IWCSLayer=New WCSLayerClass()
wcslayer.Create(URL, "1", "1.0.0")

'Access raster.
Dim rasterlayer As IRasterLayer=CType(wcslayer, IRasterLayer)
Dim raster As IRaster2=CType(rasterlayer.Raster, IRaster2)

'Access raster dataset.
Dim rasterdataset As IRasterDataset=raster.RasterDataset






To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
Development licensing Deployment licensing
ArcGIS Desktop Basic ArcGIS Desktop Basic
ArcGIS Desktop Standard ArcGIS Desktop Standard
ArcGIS Desktop Advanced ArcGIS Desktop Advanced
Engine Developer Kit Engine