| Numéro d’ID de bogue |
BUG-000120017 |
| Envoi | February 12, 2019 |
| Dernière modification | June 5, 2024 |
| S’applique à | ArcGIS Runtime SDK |
| Version trouvée | 100.4 |
| Système d’exploitation | N/A |
| Version du système d’exploitation | N/A |
| Statut | Will Not Be Addressed
L’équipe de développement a examiné le problème ou la demande et a décidé qu’ils ne seraient pas traités. Pour d’autres explications, reportez-vous à la section Informations supplémentaires correspondant au problème.
|
Informations supplémentaires
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);
});
Étapes pour reproduire
ID de bogue: BUG-000120017
Logiciel: