Select to view content in your preferred language

Upgrading from ArcObjects - CreateRasterDataset

508
10
05-22-2024 09:03 AM
Labels (2)
DharmeshPatel1
New Contributor II

Hello,

 

I am trying to upgrade a C# project that has been using ArcObjects 10.7.0.0 to now use ArcGIS Maps SDK for .NET . We use the CreateRasterDataset method from https://developers.arcgis.com/enterprise-sdk/api-reference/net/IRasterWorkspace2/

 

Please could anyone assist me in how I would get the same method in the latest ArcGIS Maps SDK .NET or what methods there are to do this CreateRasterDataset.

 

Thank you.

0 Kudos
10 Replies
GKmieliauskas
Esri Regular Contributor

Hi, 

You can do it by using geoprocessing. Local server supported geoprocessing tools are here. You need to create geoprocessing package with Create Raster Dataset tool. Sample how to execute tool is here.

Creating geoprocessing package is here.

DharmeshPatel1
New Contributor II

Does this require me to have ArcGis Pro?

0 Kudos
GKmieliauskas
Esri Regular Contributor

You need ArcGIS Pro to create geoprocessing package. Another one thing you need to have Standard license for ArcGIS Maps Local server.

DharmeshPatel1
New Contributor II

Thank you.

Is there any way to get developer lincences for these similar to the developer API key?

0 Kudos
GKmieliauskas
Esri Regular Contributor

Local Server | ArcGIS Maps SDK for .NET | ArcGIS Developers

It is important:

"Local Server is supported with ArcGIS Maps SDK for .NET on Windows when using either Windows Presentation Foundation (WPF) or Windows UI Library (WinUI) 3. Local Server is not supported for apps developed using .NET MAUI (Multi-platform App UI) or Universal Windows Platform (UWP)."

 

DharmeshPatel1
New Contributor II

Also how can I use this Create Raster Dataset tool, I am struggling and am not able to find an example anywhere

0 Kudos
GKmieliauskas
Esri Regular Contributor

No matter which geoprocessing tool you want execute. Differences are geoprocessing package path and set of parameters. Parameters for Create Raster Dataset you can find here

DharmeshPatel1
New Contributor II

Is there any way to execute that from a C# .NET Framework 4.8 project? I can see details for python but not .NET.

 

Thank you.

0 Kudos
GKmieliauskas
Esri Regular Contributor

There is no documentation for each tool of geoprocessing in .NET. From python tool description you need to take only order of parameters and their types. Only  ArcMap has direct access to raster manipulation. All other new products (ArcGIS Pro, ArcGIS Maps) use geoprocessing for that purpose.

 

            // Create the geoprocessing parameters
            GeoprocessingParameters gpParams = new GeoprocessingParameters(GeoprocessingExecutionType.AsynchronousSubmit);

            // Add the interval parameter to the geoprocessing parameters
            gpParams.Inputs["ContourInterval"] = new GeoprocessingDouble(MyContourSlider.Value);

In code above you need to delete setting "ContourInterval" parameter and fill your tool parameters: