Adding raster using dynamic workspace

857
4
01-08-2020 06:35 AM
YaronAvraham
New Contributor III

I'm trying to to add a raster file using a dynamic workspace based on this example (Local server dynamic workspace raster | ArcGIS for Developers )

and i'm getting this exception

"ArcGISWebException: Unable to find the specified 'dataSourceName' in 'dataSource' for dynamic dataLayer with 'id': 0."

any ideas on what #i'm doing wrong?

0 Kudos
4 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

To add raster data to the map/scene we recommend using the direct API capability rather than via the Local Server component. For more information see the doc/sample: Raster Class.

Regards

Mike

0 Kudos
YaronAvraham
New Contributor III

What is the difference between using the local server and dynamic workspace and adding the raster directly?

the reason i tried using the local server is that when i'm adding the raster file in that is in your sample using the direct API the raster image is not reloaded correctly when changing zoom levels.

I've tried your shape file dynamic workspace example and i'm getting the same error.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Use of the local server to load raster data is in most cases a legacy approach and is now superseded by the direct API approach. 

Does the raster data display correctly in ArcGIS Pro?

0 Kudos
YaronAvraham
New Contributor III

Checked in ArcGIS Pro and it seems that the raster works the same way changing zoom does not reload the raster.

0 Kudos