How to check existance of GRID raster without adding to map

396
2
04-13-2017 03:18 AM
Highlighted
Regular Contributor

I would like to do some raster calculations. My parameters dialog lets to specify results raster path. I want to check if result raster exists and ask for overwriting. I have tried to create RasterLayer using LayerFactory without  specifying ILayerContainerEdit, but I get exception. Is it possible to browse workspace for datasets like in ArcObjects with IEnumDataset?

Reply
0 Kudos
2 Replies
Highlighted
Regular Contributor

I have found that I can use ItemFactory, to create Item from raster path. If there is no raster at specified path then ItemFactory.Create(sResultRaster) returns null.

I have noticed too that ArcGIS Pro remembers many different info about your used data. So if you deleted some data using ArcMap or ArcCatalog, but your opened ArcGIS Pro thinks that data still exist and successfully creates Item object and etc. After restarting ArcGIS Pro all goes fine. I think it is not so good thing.

Reply
0 Kudos
Highlighted
New Contributor

For performance reasons, Pro caches items it encounters. Since Pro does not listen to events from other applications (like ArcMap/ArcCatalog) or the OS, locations where data has been altered outside of Pro need to be refreshed within Pro to account for any changes.

We intended to have Pro listen to OS events in a future release.

Reply
0 Kudos