Hi,
I have an app that generates TIFF file on the fly based on sensor data. I am using a raster layer and colormap renderer to visualize the data.
// create a raster from a path to a supported raster format
Raster myRaster = new Raster(vm.RadarLoc.rasterPath);
// create a RasterLayer using the Raster
newRasterLayer = new RasterLayer(myRaster);
newRasterLayer.Opacity=0.7;
ApplyColour();
// newRasterLayer.Renderer =
MyMapView.Map.OperationalLayers.Add(newRasterLayer);
When a new set of data is available I remove the Raster from the layers - using MyMapView.Map.OperationalLayers.Remove(newRasterLayer);. I then deference the newRasterLayer. I would hope that the backing file would now have any file handle closed within the ERSI runtime, however if I try to delete it or modify it I cannot because the file is still open.
// Remove the raster
MyMapView.Map.OperationalLayers.Remove(newRasterLayer);
newRasterLayer= null;
I have not been able to find a way to get the file closed. GCCollect does not help, waiting for a time does not help. Closing the app totally does release it 🙂
Added a small demo of the problem.
Am I missing a step to get the file released?
c#, SDK WPF Runtime 100.10.0.