Mobile Mosaic Dataset not loading properly and very slow performance!

150
0
12-04-2021 06:45 AM
TasawarAhmad
New Contributor III

issue.PNG

Hi, 

I have registered 2 tiles ('world.JP2' & 'mycity.jp2') using mobile mosaic dataset raster. 

However as soon after loading the mosaic datasets, I try to zoom on mycity.jp2 raster, this artifact appears.

Also speed of map rendering is very slow as compared to devexpress mapview control using .png tiles. How can I solve these issues? 

Here is my code sample for your kind review:

 

 

 

    private async void RegisterRasters()
        {
            // Create a new mobile mosaic dataset.
            MosaicDatasetRaster rasterMosaic = MosaicDatasetRaster.Create(@"E:\Maps\mosaic.sqlite", "Shasta", SpatialReferences.Wgs84);

            // When the new mosaic dataset is ready, add some raster files.
            
            rasterMosaic.LoadStatusChanged += (s, e) =>
            {
                // If loaded successfully, start adding rasters
                if (e.Status == Esri.ArcGISRuntime.LoadStatus.Loaded)
                {
                    AddRastersParameters parameters = new AddRastersParameters();
                         parameters.InputDirectory = @"E:\Maps\rasters";
                        rasterMosaic.AddRastersAsync(parameters);
                    }
                }
            };
            
            await rasterMosaic.LoadAsync();
            MessageBox.Show("Rasters registered!");
          
        }

        private void LoadRastersOnMap(object sender, RoutedEventArgs e)
        {
            
            string sqliteDbPath = @"E:\Maps\mosaic.sqlite";
            // Get mosaic dataset names in the SQLite database.
            var names = MosaicDatasetRaster.GetNames(sqliteDbPath);
            var rasterName = names[0];
            
            // Create a raster from a mosaic dataset
            MosaicDatasetRaster raster = new MosaicDatasetRaster(sqliteDbPath, rasterName);
            
            
           
            RasterLayer rasterLayer = new RasterLayer(raster);
            
           // await rasterLayer.LoadAsync();
            MainMapView.Map.OperationalLayers.Add(rasterLayer);
           
        }

 

 

 

 

Interestingly while registering rasters, If I set these 2 parameters then this artifact disappears but map loading is still slow. 

 

 

parameters.MinPixelSizeFactor = 0.01;   
parameters.MaxPixelSizeFactor = 1; 

 

 

(I m unable to find documentation regarding these 2 parameters, Can you explain them as well please).

 

Update: I have now converted mycity.jp2 in tiles (approx 100 tiles) but .prj file (which has extent information) is not loading.

0 Kudos
0 Replies