Open Mobile Mosaic Dataset in ArcGIS Runtime .NET

609
2
06-27-2018 11:43 AM
deleted-user-Qwv0Lt2wZ0Zu
New Contributor II

Hello,

I would like to open a mobile mosaic dataset to display the content as layers within a map. I have created a mobile mosaic dataset by using the instructions here: Mosaic Dataset To Mobile Mosaic Dataset—Data Management toolbox | ArcGIS Desktop, and it has been enabled for use with the Runtime.

The resulting files that are generated by this tool include a Sqlite database with the extension .geodatabase, and a folder that includes raster content. For example, the file is named dem.geodatabase, and the folder dem_source_rasters. 

How do I open the .geodatabase file in order to pull the raster data into the ArcGIS Runtime Map? I have tried to use the following code but I'm getting an error that the geodatabase could not be opened. Is this the correct code to be using to open this type of file? Or is there some documentation that could lead me in the right direction?

string geodbstr = _mosaicDatasetFile;
Geodatabase gdb = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(geodbstr);

FeatureTable ft = gdb.GeodatabaseFeatureTables.FirstOrDefault();

FeatureLayer flyr = new FeatureLayer
{
     Id = ft.TableName,
     FeatureTable = ft,
     Name = ft.TableName
};

Map.OperationalLayers.Add(flyr);

Regards!

Jen

0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor

Kindly see `Create a raster from a mosaic dataset` from this guide doc

deleted-user-Qwv0Lt2wZ0Zu
New Contributor II

Hi Jennifer,

Thanks for the documentation! I am looking at this now, but as of yet, I have not been able to read the raster data successfully yet. The code:

var names = MosaicDatasetRaster.GetNames(sqliteDbPath);

var rasterName = names[0];

MosaicDatasetRaster raster = new MosaicDatasetRaster(sqliteDbPath, rasterName);

RasterLayer rasterLayer = new RasterLayer(raster);

does not seem to be able to access the DEM rasters that were created as a part of the mosaic dataset. It may be in how the dataset was generated, so I am looking into that now.

Regards!

Jen

0 Kudos