I'm using following geotiff raster layer sample dataset: swissALTI3D sample data - swisstopo
Direct download link: https://cms.geo.admin.ch/Topo/swissalti3d/swissalti3dgeotifflv95.zip
I would like to show this raster layer on top of a basemap. I initialize both like this, with 2056 being the spatial reference system the raster layer is based upon.
m_map = new Map(SpatialReference(2056), this);
QUrl imageLayerUrl("https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
auto baseLayer = new ArcGISMapImageLayer(imageLayerUrl, this);
auto basemap = new Basemap(baseLayer, this);
m_map->setBasemap(basemap);
const QString filepath =
defaultDataPath() + "/ArcGIS/Runtime/Data/raster/SWISSALTI3D_TIFF_CHLV95_LN02/0.5m/SWISSALTI3D_0.5_TIFF_CHLV95_LN02_2600_1196.tif";
Raster* raster = new Raster(filepath, this);
m_rasterLayer = new RasterLayer(raster, this);
m_map->operationalLayers()->append(m_rasterLayer);
The resulting map only shows the basemap and not the added raster layer. The raster layer does not report any errors.
When I do not load the basemap then the raster layer is visible.
When I log the raster layer's fullExtent its json representation looks like this:
// auto envelope = m_rasterLayer->fullExtent();
// qDebug() << envelope.toJson();
{
"xmin": -0.5,
"ymin": -6999.5,
"xmax": 6999.5,
"ymax": 0.5,
"spatialReference": {
"wkid": null
}
}
implying that there's an issue with the raster layer's spatial reference.
I can load this raster layer perfectly into ArcGIS Pro where it automatically gets the correct spatial reference.
Does anyone have a clue on what I might be doing wrong here?
Many thanks!