diff --git a/Code/IO/otbImageFileReader.h b/Code/IO/otbImageFileReader.h index 656db4d7cf71adcff8fa8391f0f2c3fd5da823db..5c829edbf4b887aa5d2bb4696c54653ea45ec929 100644 --- a/Code/IO/otbImageFileReader.h +++ b/Code/IO/otbImageFileReader.h @@ -28,6 +28,12 @@ namespace otb /** \class ImageFileReader * \brief Resource to read an image from a file. * + * Available options for extended file name are: + * - &geom : to specify an external geom file + * - &sdataidx : sub-dataset index for composite files + * - &resol : resolution factor for jpeg200 files + * - &skippr : switch to skip the projection referentiel in ortho-ready files + * * \sa ImageSeriesReader * \sa ImageIOBase * @@ -68,6 +74,7 @@ public: std::string extGEOMFileName; unsigned int subDatasetIndex; unsigned int resolutionFactor; + bool skipProjRef; }; /** Prepare image allocation at the first call of the pipeline processing */ diff --git a/Code/IO/otbImageFileReader.txx b/Code/IO/otbImageFileReader.txx index f778211a5e771fef80ad7172136a5cfafe87d654..b695278cb6d9e4766bb6cd3963afdf7549fc6088 100644 --- a/Code/IO/otbImageFileReader.txx +++ b/Code/IO/otbImageFileReader.txx @@ -62,6 +62,7 @@ ImageFileReader<TOutputImage> m_Options.extGEOMFileName = ""; m_Options.subDatasetIndex = 0; m_Options.resolutionFactor = 0; + m_Options.skipProjRef = false; } template <class TOutputImage> @@ -437,6 +438,12 @@ ImageFileReader<TOutputImage> } } + // If Skip ProjectionRef is activated, remove ProjRef from dict + if (m_Options.skipProjRef) + { + itk::EncapsulateMetaData<std::string>(dict, MetaDataKey::ProjectionRefKey, ""); + } + //Copy MetaDataDictionary from instantiated reader to output image. output->SetMetaDataDictionary(this->m_ImageIO->GetMetaDataDictionary()); this->SetMetaDataDictionary(this->m_ImageIO->GetMetaDataDictionary()); @@ -625,6 +632,10 @@ ImageFileReader<TOutputImage> m_Options.extGEOMFileName = map["geom"]; m_Options.subDatasetIndex = atoi(map["sdataidx"].c_str()); m_Options.resolutionFactor = atoi(map["resol"].c_str()); + if (map["skippr"] == "true") + { + m_Options.skipProjRef = true; + } this->m_FileName = m_Options.fileName; }