Select to view content in your preferred language

Hello, I would like to use ArcGIS Pro SDK for .NET to convert an int array into a Raster object and display it on the Map. How can I achieve this?

917
4
Jump to solution
12-26-2023 08:01 PM
yingjiehuang
New Contributor

Hello, I would like to use ArcGIS Pro SDK for .NET to convert an int array into a Raster object and display it on the Map. How can I achieve this?

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

There is no direct way to do that. Workflow is following:

1. Create raster in database or file using geoprocessing

2. Using snippet for "Read and Write pixels from and to a raster dataset using pixel blocks" update pixels from your array.

3. Save raster

4. Create layer and add to map 

View solution in original post

4 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

There are many examples of working with raster here.

You can create raster using geoprocessing called from ArcGIS Pro SDK for .Net. More info about raster creating geoprocessing tool here. How to call geoprocessing tool from ArcGIS Pro SDK for .Net is here

0 Kudos
yingjiehuang
New Contributor

I want to directly convert an int array to a Raster object in the SDK. Is this not achievable?

yingjiehuang_1-1703669172717.png

 

0 Kudos
GKmieliauskas
Esri Regular Contributor

Another way is to use GraphicsLayer or overlay graphics. Make a square symbol with dimensions of raster cell size and put different color symbols from your array depending on array item value. It would be fast solution if you have few hundred of points

0 Kudos
GKmieliauskas
Esri Regular Contributor

There is no direct way to do that. Workflow is following:

1. Create raster in database or file using geoprocessing

2. Using snippet for "Read and Write pixels from and to a raster dataset using pixel blocks" update pixels from your array.

3. Save raster

4. Create layer and add to map