diff --git a/Code/IO/otbGDALImageIO.cxx b/Code/IO/otbGDALImageIO.cxx index deb682f6b0f882ff38e52665ac28e06ab8fcee37..e46f260269b2afb1a6716942b2e0b30c76c38c56 100644 --- a/Code/IO/otbGDALImageIO.cxx +++ b/Code/IO/otbGDALImageIO.cxx @@ -603,12 +603,18 @@ void GDALImageIO::InternalReadImageInformation() m_Spacing[0] = VadfGeoTransform[1]; m_Spacing[1] = VadfGeoTransform[5]; - //In this case, we are in a geographic projection + //In this case, we are in a geographic projection if no other cartographic information was already + // available // FIXME is there any way to know if we are in WGS 84 ??? - std::string projRef = + std::string projRef; + itk::ExposeMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, projRef); + if (projRef.empty()) + { + projRef = "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]"; - itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, projRef); + itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, projRef); + } } /* -------------------------------------------------------------------- */