laptop and a wrench

Bug

Fail to get the fullExtent property for a rasterLayer with MosaicDatasetRaster.

Last Published: March 15, 2019 ArcGIS Runtime SDK
Bug ID Number BUG-000120017
SubmittedFebruary 12, 2019
Last ModifiedJune 5, 2024
Applies toArcGIS Runtime SDK
Version found100.4
Operating SystemN/A
Operating System VersionN/A
StatusWill Not Be Addressed

Additional Information

The code is be written slightly differently. There is an issue in the API if a MosaicDatasetRaster is created from scratch and the same instance cannot be used to create a RasterLayer. A new object must be created. Refer to the following code: 1. Create the MDR: // The Important Part m_inputDirectoryUrl = QDir::toNativeSeparators(QDir::homePath() + "/ArcGIS/Runtime/Data/raster/PPI"); m_mosaicDatasetRaster = MosaicDatasetRaster::create( m_inputDirectoryUrl + "/rasterCollection.sqlite", "rasterCollection", SpatialReference::wgs84()); // create addraster params AddRastersParameters addRastersParameters; addRastersParameters.setInputDirectory(m_inputDirectoryUrl); addRastersParameters.setFilter("tif$"); // Regex filter // add the raster, which is an async call m_mosaicDatasetRaster->addRasters(addRastersParameters); // once the raster is created, create a new mosaic dataset raster (this is a workaround for now until we fix an issue) // create a new rasterlayer and add the newly created mosaic dataset raster and add it to the Scene's o/l // once the raster layer is loaded, zoom to the extent connect(m_mosaicDatasetRaster, &MosaicDatasetRaster::addRastersCompleted, this, [this](QUuid taskId, Error error) { Q_UNUSED(taskId) qDebug() << "addRastersCompleted"; // create a new mosaic dataset raster using the database create earlier MosaicDatasetRaster* newMdr = new MosaicDatasetRaster(m_inputDirectoryUrl + "/rasterCollection.sqlite", "rasterCollection", this); // instantiate the raster layer m_rasterLayer = new RasterLayer(newMdr, this); // once the raster layer is loaded, zoom to the extent connect(m_rasterLayer, &RasterLayer::doneLoading, this, [this]() { m_rasterLayer->setMaxScale(40070.8); m_rasterLayer->setMinScale(2.74574e+07); qDebug() << m_rasterLayer->spatialReference().wkid(); Envelope extent = m_rasterLayer->fullExtent(); qDebug() << "Done loading. Raster layer full extent: " << extent.toJson(); Viewpoint viewPoint(m_rasterLayer->fullExtent()); m_SceneView->setViewpoint(viewPoint); }); connect(m_rasterLayer, &RasterLayer::errorOccurred, this, [this](Error error) { qDebug() << error.message() << error.additionalMessage(); }); // add the raster layer to the Scene m_Scene->operationalLayers()->append(m_rasterLayer); });

Steps to Reproduce

Bug ID: BUG-000120017

Software:

  • ArcGIS Runtime SDK

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options