Skip to content

Commit

Permalink
JP2LURA: do not export GMLJP2 if the SRS isn't compatible (fixes OSGe…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Feb 26, 2024
1 parent 61d7268 commit 60538c2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions frmts/jp2lura/jp2luradataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,19 @@ GDALDataset *JP2LuraDataset::CreateCopy(const char *pszFilename,
{
bGeoreferencingCompatOfGeoJP2 = true;
oJP2MD.SetGeoTransform(adfGeoTransform);

if (poSRS && !poSRS->IsEmpty())
{
bGeoreferencingCompatOfGMLJP2 =
GDALJP2Metadata::IsSRSCompatible(poSRS);
if (!bGeoreferencingCompatOfGMLJP2)
{
CPLDebug(
"JP2LURA",
"Cannot write GMLJP2 box due to unsupported SRS");
}
}
}
bGeoreferencingCompatOfGMLJP2 =
poSRS != nullptr && !poSRS->IsEmpty() &&
poSrcDS->GetGeoTransform(adfGeoTransform) == CE_None;
}
if (poSrcDS->GetMetadata("RPC") != nullptr)
{
Expand Down

0 comments on commit 60538c2

Please sign in to comment.