File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,7 @@ def test_dimap_2_vhr2020_ms_fs():
311
311
312
312
def test_dimap2_pneo_primary_rpc_center_h ():
313
313
ds = gdal .Open ("data/dimap2/primary_rpc_center_h/DIM_PNEO3_STD_x_1_1_F_1.XML" )
314
+ assert ds .GetSpatialRef () is None
314
315
assert ds .GetMetadata_Dict ("RPC" ) == {
315
316
"HEIGHT_DEFAULT" : "123.45" ,
316
317
"HEIGHT_OFF" : "HEIGHT_OFF" ,
Original file line number Diff line number Diff line change @@ -1479,17 +1479,22 @@ int DIMAPDataset::ReadImageInformation2()
1479
1479
1480
1480
if (pszSRS != nullptr )
1481
1481
{
1482
- OGRSpatialReference &oSRS = nGCPCount > 0 ? m_oGCPSRS : m_oSRS;
1483
- oSRS.SetFromUserInput (
1484
- pszSRS, OGRSpatialReference::SET_FROM_USER_INPUT_LIMITATIONS_get ());
1482
+ if (bHaveGeoTransform)
1483
+ {
1484
+ OGRSpatialReference &oSRS = m_oSRS;
1485
+ oSRS.SetFromUserInput (
1486
+ pszSRS,
1487
+ OGRSpatialReference::SET_FROM_USER_INPUT_LIMITATIONS_get ());
1488
+ }
1485
1489
}
1486
1490
else
1487
1491
{
1488
1492
// Check underlying raster for SRS. We have cases where
1489
1493
// HORIZONTAL_CS_CODE is empty and the underlying raster
1490
1494
// is georeferenced (rprinceley).
1491
1495
const auto poSRS = poImageDS->GetSpatialRef ();
1492
- if (poSRS)
1496
+ double adfGTTmp[6 ];
1497
+ if (poSRS && poImageDS->GetGeoTransform (adfGTTmp) == CE_None)
1493
1498
{
1494
1499
m_oSRS = *poSRS;
1495
1500
}
You can’t perform that action at this time.
0 commit comments