Skip to content

Commit

Permalink
Fall back on a global-geodetic profile in the TiledFeatureModelLayer …
Browse files Browse the repository at this point in the history
…is one is not found in the feature source
  • Loading branch information
gwaldron committed Dec 13, 2024
1 parent e6eb108 commit 85a6722
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/osgEarth/OGRFeatureSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion src/osgEarth/TiledFeatureModelLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85a6722

Please sign in to comment.