Fail to get the fullExtent property for a rasterLayer with MosaicDatasetRaster.
上次发布: March 15, 2019ArcGIS Runtime SDK
漏洞 ID 编号
BUG-000120017
已提交
February 12, 2019
上次修改时间
June 5, 2024
适用范围
ArcGIS Runtime SDK
找到的版本
100.4
操作系统
N/A
操作系统版本
N/A
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
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);
});