From 85a67227a91626f052df04353b4c7aa1e62d7251 Mon Sep 17 00:00:00 2001 From: Glenn Waldron Date: Fri, 13 Dec 2024 12:03:45 -0500 Subject: [PATCH] Fall back on a global-geodetic profile in the TiledFeatureModelLayer is one is not found in the feature source --- src/osgEarth/OGRFeatureSource.cpp | 2 +- src/osgEarth/TiledFeatureModelLayer.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osgEarth/OGRFeatureSource.cpp b/src/osgEarth/OGRFeatureSource.cpp index 38b35a2bc2..c0ad20f7cf 100644 --- a/src/osgEarth/OGRFeatureSource.cpp +++ b/src/osgEarth/OGRFeatureSource.cpp @@ -687,7 +687,7 @@ OGRFeatureSource::openImplementation() return Status(Status::ResourceUnavailable, "Failed to establish a valid feature profile"); } - OE_INFO << LC << getName() << " : opened OK" << std::endl; + OE_INFO << getName() << " (" << _source << ") opened OK" << std::endl; return Status::NoError; } diff --git a/src/osgEarth/TiledFeatureModelLayer.cpp b/src/osgEarth/TiledFeatureModelLayer.cpp index 652d782ea2..5c7437db41 100644 --- a/src/osgEarth/TiledFeatureModelLayer.cpp +++ b/src/osgEarth/TiledFeatureModelLayer.cpp @@ -391,7 +391,9 @@ TiledFeatureModelLayer::getProfile() const OE_SOFT_ASSERT_AND_RETURN(getFeatureSource() != nullptr, nullptr); OE_SOFT_ASSERT_AND_RETURN(getFeatureSource()->getFeatureProfile() != nullptr, nullptr); - return getFeatureSource()->getFeatureProfile()->getTilingProfile(); + static const Profile* s_fallback = Profile::create(Profile::GLOBAL_GEODETIC); + auto profile = getFeatureSource()->getFeatureProfile()->getTilingProfile(); + return profile ? profile : s_fallback; } unsigned