Adding raster using dynamic workspace

83
4
01-08-2020 06:35 AM
New Contributor II

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?

Reply
0 Kudos
4 Replies
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

Reply
0 Kudos
New Contributor II

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.

Reply
0 Kudos
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?

Reply
0 Kudos
New Contributor II

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

Reply
0 Kudos