myRasterLayer.LoadAsync() failed to open a rasterfile on 100.5 and 100.6 .Net SDK

302
2
09-18-2019 10:46 AM
CleristonAraujo_Chiuchi
New Contributor

Hi, 

I have an application that uses code similar to:

https://developers.arcgis.com/net/latest/uwp/sample-code/raster-layer-file/

The only difference ís that I open a .tif file from the local storage. 

In the 100.4 version of Esri SDK the raster layer loads perfectly, but id I upgrade my SDK to 100.5 or 100.6 the application crash in the .LoadAsync();. 

There is another way to create a layer with a offline .tif?

Thanks. 

0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Can you attach a repro? Or share your code and the raster dataset?

Cheers

Mike 

CleristonAraujo_Chiuchi
New Contributor

Hi, 

Sorry, but I can't share the raster dataset.

The code that I am using is:

// Add an imagery base map 
Map myMap =
new Map(Basemap.CreateImagery());

// Get the file name

string filepath =  caminho.DiretorioExportacaoLog + "/FILES/ortofoto2015.tif";

// Load the raster file

Raster myRasterFile = new Raster(filepath);

// Create the layer

RasterLayer myRasterLayer = new RasterLayer(myRasterFile);

// Add the layer to the map

myMap.OperationalLayers.Add(myRasterLayer);

// Add map to the mapview

MyMapView.Map = myMap;

try {

         // Wait for the layer to load

         await myRasterLayer.LoadAsync();

         // Set the viewpoint

         await MyMapView.SetViewpointGeometryAsync(myRasterLayer.FullExtent);

} catch (Exception e)

{

    await new MessageDialog(e.ToString(), "Error").ShowAsync();

}

The application just closes with no exception message.

If I use the 100.4 version of the sdk the application works fine.

 

Thanks for your help.

0 Kudos