Select to view content in your preferred language

How to add a WCS service to ArcGIS Pro using the SDK

517
0
06-21-2023 05:26 AM
NausicaaMontanari
Occasional Contributor
How to add a WCS service to ArcGIS Pro using the SDK?
 
 

Adding a WMS service to ArcGIS Pro is very simple and straightforward:

using ArcGIS.Core.CIM;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;

// Create a connection to the WMS server
var serverConnection = new CIMInternetServerConnection {URL = "Fill in the URL of the WMS service"};
var connection = new CIMWMSServiceConnection {ServerConnection = serverConnection};

// Add a new layer to the map
await QueuedTask.Run(() => 
{
    var layer = LayerFactory.CreateLayer(connection, MapView.Active.Map);
});‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

But with CIMWCSServiceConnection I can't add a WCS service in ArcGIS Pro, what is wrong in my code:

// Create a connection to the WCS server
var serverConnection = new CIMInternetServerConnection {URL = "Fill in the URL of the WCS service"};
var connection = new CIMWCSServiceConnection {ServerConnection = serverConnection};

// Add a new layer to the map
await QueuedTask.Run(() =>
{
var layer = LayerFactory.CreateLayer(connection, MapView.Active.Map);
});

Thank you in advance.

 

 

 

Tags (2)
0 Kudos
0 Replies