I been having issues loading a TPK file into my application for QT. To start from a know quantity i used the MontereyElevation.tpk file that is in the examples. https://developers.arcgis.com/qt/cpp/sample-code/create-terrain-surface-from-a-local-tile-package/
from the Example executables i could not run the file with a 3d topology. Instead it displays a flat map.
in my own code samples i use the following lines:
-----------------------
const QString tile_elevation_package_path = QString{"d://temp/export/MontereyElevation.tpk"};
// Before attempting to add any layers, check that the file for the elevation source exists at all.
const bool src_elevation_file_exists = QFileInfo::exists(tile_elevation_package_path);
if(src_elevation_file_exists) {
qInfo() << "elevation source package found";
ArcGISTiledElevationSource* elevationsrc=new ArcGISTiledElevationSource{QUrl("file:"+tile_elevation_package_path), this};
// When the elevation source is finished loading, call the elevationSrcFinishedLoading callback, so we can tell if it loaded succesfully.
connect(elevationSrc, &ArcGISTiledElevationSource::doneLoading, this, &Add_layers_to_a_3d_scene::packageLoaded);
// add the elevation source to the scene to display elevation
m_scene->baseSurface()->elevationSources()->append(elevationSrc);
} else {
qInfo() << "elevation source file not found";
}
----------------------------------
void Add_layers_to_a_3d_scene::packageLoaded(const Error& e)
{
if (!e.isEmpty())
{
qDebug() << QString("Package load error: %1 %2").arg(e.message(), e.additionalMessage());
return;
}
}
the error code i receive:
"Package load error: JSON parser invalid start of JSON. Error processing service metadata response.\nP : 0"
I have experienced this same error with my own LERC TPK generated from ARCGIS Pro.
Thanks in advance!