Commit ab74b63f authored by Rémi Cresson's avatar Rémi Cresson
Browse files

Merge branch 'develop' of gitlab.orfeo-toolbox.org:orfeotoolbox/otb into 2290-register_pipelines

parents bc595e7c 4f354dd0
Pipeline #11194 passed with stages
in 118 minutes and 49 seconds
......@@ -152,8 +152,8 @@ set(main_project_name ${_OTBModuleMacros_DEFAULT_LABEL})
#-----------------------------------------------------------------------------
# OTB version number.
set(OTB_VERSION_MAJOR "8")
set(OTB_VERSION_MINOR "0")
set(OTB_VERSION_PATCH "1")
set(OTB_VERSION_MINOR "1")
set(OTB_VERSION_PATCH "0")
set(OTB_VERSION_STRING "${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH}")
get_package_name(${OTB_SOURCE_DIR} ${PROJECT_NAME} OTB_VERSION_STRING2)
......
......@@ -15,7 +15,7 @@
<dd><a href="https://www.orfeo-toolbox.org/CookBook-7.2/">7.2.0</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-7.3/">7.3.0</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-7.4/">7.4.0</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-8.0/">8.0.0</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-8.0/">8.0.1</a></dd>
<dd><a href="https://www.orfeo-toolbox.org/CookBook-develop/">develop</a></dd>
</dl>
</div>
......
......@@ -20,4 +20,4 @@ Several DEM tiles can be provided at the same time, using the ``OpenDEMDirectory
A geoid file can be opened using the ``OpenGeoidFile`` method, and the default height above ellipsoid can be set using ``OpenGeoidFile`` method.
The ``ClearElevationParameters`` method can be used to clear the DEMs, the geoid and the default height above ellipsoid. All associated GDAL datasets will be closed.
\ No newline at end of file
The ``ClearElevationParameters`` method can be used to clear the DEMs, the geoid and the default height above ellipsoid. All associated GDAL datasets will be closed. The ``OpenDEMDirectory`` method won't reopen a directory already loaded, even if the content of the directory changed. To force loading the new tiles, one needs to call ``ClearElevationParameters``.
......@@ -98,6 +98,14 @@ otb_test_application(NAME apTvPrOrthorectification_UTM
${BASELINE}/owTvOrthorectifTest_UTM.tif
${TEMP}/apTvPrOrthorectifTest_UTM.tif)
otb_test_application(NAME apTvPrOrthorectification_OTB_Metadata
APP OrthoRectification
OPTIONS -io.in ${INPUTDATA}/QB_TOULOUSE_11_11.tif
-io.out ${TEMP}/apTvPrOrthorectification_OTB_Metadata.tif
VALID --compare-image ${EPSILON_4}
${BASELINE}/apTvPrOrthorectification_OTB_Metadata.tif
${TEMP}/apTvPrOrthorectification_OTB_Metadata.tif)
#otb_test_application(NAME apTvPrOrthorectification_DEMTIF_UTM_OutXML1
#APP OrthoRectification
#OPTIONS -io.in LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
......
......@@ -107,7 +107,7 @@ struct IsSuitableType<itk::RGBAPixel<T>> : IsSuitableType<T>::type
* T -> PixelType = T
* const ConstNeighborhoodIterator<Image::T>& -> PixelType = T
* const ConstNeighborhoodIterator<VectorImage::T>& -> PixelType = itk::VariableLengthVector<T>
*/
*/
template <class T>
struct PixelTypeDeduction
{
......@@ -158,13 +158,13 @@ template <typename T>
using RemoveCVRef = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
/**
* \struct RetrieveOperator
*
* \brief Struct to retrieve the operator type
*
* \tparam T the type to retrieve operator() from
*
*/
* \struct RetrieveOperator
*
* \brief Struct to retrieve the operator type
*
* \tparam T the type to retrieve operator() from
*
*/
template <typename T>
struct RetrieveOperator
{
......@@ -173,17 +173,17 @@ struct RetrieveOperator
};
/**
* \struct FunctorFilterSuperclassHelper
* \brief Struct allowing to derive the superclass prototype for the
* FunctorImageFilter class
*
* Provides the following:
* - OutputImageType : type of the output image
* - FilterType : correct instantiation of VariadicInputsImageFilter from
* - the operator() prototype
* - InputHasNeighborhood a tuple of N false_type or true_type to denote
* - if Ith arg of operator() expects a neighborhood.
*/
* \struct FunctorFilterSuperclassHelper
* \brief Struct allowing to derive the superclass prototype for the
* FunctorImageFilter class
*
* Provides the following:
* - OutputImageType : type of the output image
* - FilterType : correct instantiation of VariadicInputsImageFilter from
* - the operator() prototype
* - InputHasNeighborhood a tuple of N false_type or true_type to denote
* - if Ith arg of operator() expects a neighborhood.
*/
template <typename T, typename TNameMap>
struct FunctorFilterSuperclassHelper : public FunctorFilterSuperclassHelper<typename RetrieveOperator<T>::Type, TNameMap>
{
......@@ -316,7 +316,7 @@ auto NewFunctorFilter(Functor f, itk::Size<2> radius = {{0, 0}});
* \ingroup IntensityImageFilters Multithreaded Streamed
*
* \ingroup OTBFunctor
*/
*/
template <class TFunction, class TNameMap = void>
class ITK_EXPORT FunctorImageFilter : public FunctorFilterSuperclassHelper<TFunction, TNameMap>::FilterType
{
......@@ -487,7 +487,7 @@ private:
*/
template <typename Functor, typename TNameMap = void>
auto NewFunctorFilter(Functor f, unsigned int numberOfOutputBands, itk::Size<2> radius)
auto NewFunctorFilter(Functor f, unsigned int numberOfOutputBands, itk::Size<2> radius = {{0, 0}})
{
using FunctorType = NumberOfOutputBandsDecorator<Functor>;
FunctorType decoratedF(f, numberOfOutputBands);
......
......@@ -247,6 +247,8 @@ protected:
void KeywordlistToMetadata(ImageMetadataBase::Keywordlist, int band=-1);
/** Parses a GDAL Metadata string list to fill a Keywordlist*/
void GDALMetadataToKeywordlist(const char* const* , ImageMetadataBase::Keywordlist &);
/** Parses the RPC from the GDAL Metadata */
void GDALMetadataReadRPC();
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
/** Read all information on the image*/
......
......@@ -57,14 +57,21 @@ std::vector<std::string> GetFilesInDirectory(const std::string & directoryPath)
// End iterator : default construction yields past-the-end
for ( const auto & item : boost::make_iterator_range(boost::filesystem::directory_iterator(directoryPath), {}) )
{
if ( boost::filesystem::is_directory(item.status()) )
try
{
auto subDirList = GetFilesInDirectory(item.path().string());
fileList.insert(fileList.end(), subDirList.begin(), subDirList.end());
if ( boost::filesystem::is_directory(item.status()) )
{
auto subDirList = GetFilesInDirectory(item.path().string());
fileList.insert(fileList.end(), subDirList.begin(), subDirList.end());
}
else
{
fileList.push_back(item.path().string());
}
}
else
catch (boost::filesystem::filesystem_error& e)
{
fileList.push_back(item.path().string());
otbLogMacro(Warning, << e.what())
}
}
......@@ -204,6 +211,16 @@ void DEMHandler::OpenDEMFile(const std::string& path)
void DEMHandler::OpenDEMDirectory(const std::string& DEMDirectory)
{
auto isSameDirectory = [&DEMDirectory](std::string const& s)
{
return s == DEMDirectory;
};
if(std::any_of(std::begin(m_DEMDirectories), std::end(m_DEMDirectories), isSameDirectory))
{
otbLogMacro(Info, << "Directory '"<< DEMDirectory << "' already opened.")
return;
}
// Free the previous in-memory dataset (if any)
if (!m_DatasetList.empty())
VSIUnlink(DEM_DATASET_PATH.c_str());
......
......@@ -874,7 +874,6 @@ void GDALImageIO::InternalReadImageInformation()
for (int cpt = 0; cpt < 6; ++cpt)
{
VadfGeoTransform.push_back(adfGeoTransform[cpt]);
//~ m_Imd.GeoTransform[cpt] = adfGeoTransform[cpt];
}
itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::GeoTransformKey, VadfGeoTransform);
......@@ -1288,7 +1287,6 @@ void GDALImageIO::WriteImageInformation()
void GDALImageIO::InternalWriteImageInformation(const void* buffer)
{
// char ** papszOptions = NULL;
std::string driverShortName;
m_NbBands = this->GetNumberOfComponents();
......@@ -1916,7 +1914,11 @@ void GDALImageIO::ImportMetadata()
ImageMetadataBase::Keywordlist kwl;
GDALMetadataToKeywordlist(m_Dataset->GetDataSet()->GetMetadata(), kwl);
// Decode SAR metadata
// Decode RPC model
if (m_Dataset->GetDataSet()->GetMetadata("RPC"))
GDALMetadataReadRPC();
// Decode SAR model
if (kwl.find("SAR") != kwl.end())
{
try
......@@ -1935,7 +1937,7 @@ void GDALImageIO::ImportMetadata()
}
}
// Decode SAR metadata
// Decode SAR calibration data
if (kwl.find("SARCalib") != kwl.end())
{
try
......@@ -2006,46 +2008,45 @@ void GDALImageIO::GDALMetadataToKeywordlist(const char* const* metadataList, Ima
if((fieldName.size() > 36) && (fieldName.substr(0, 36) == "MDGeomNames[MDGeom::SensorGeometry]."))
{
// Sensor Geometry is imported directly in the ImageMetadata.
// TODO: Keys Starting with: MDGeomNames[MDGeom::SensorGeometry] + '.' should
// be decoded by the (future) SensorModelFactory.
}
else if (fieldName == MetaData::MDGeomNames.left.at(MDGeom::RPC))
else
{
// RPC Models are imported directly in the ImageMetadata.
Projection::RPCParam rpcStruct;
rpcStruct.LineOffset = this->GetAs<double>("RPC/LINE_OFF");
rpcStruct.SampleOffset = this->GetAs<double>("RPC/SAMP_OFF");
rpcStruct.LatOffset = this->GetAs<double>("RPC/LAT_OFF");
rpcStruct.LonOffset = this->GetAs<double>("RPC/LONG_OFF");
rpcStruct.HeightOffset = this->GetAs<double>("RPC/HEIGHT_OFF");
kwl.emplace(fieldName, fieldValue);
}
}
}
void GDALImageIO::GDALMetadataReadRPC()
{
// RPC Models are imported directly in the ImageMetadata.
Projection::RPCParam rpcStruct;
rpcStruct.LineOffset = this->GetAs<double>("RPC/LINE_OFF");
rpcStruct.SampleOffset = this->GetAs<double>("RPC/SAMP_OFF");
rpcStruct.LatOffset = this->GetAs<double>("RPC/LAT_OFF");
rpcStruct.LonOffset = this->GetAs<double>("RPC/LONG_OFF");
rpcStruct.HeightOffset = this->GetAs<double>("RPC/HEIGHT_OFF");
rpcStruct.LineScale = this->GetAs<double>("RPC/LINE_SCALE");
rpcStruct.SampleScale = this->GetAs<double>("RPC/SAMP_SCALE");
rpcStruct.LatScale = this->GetAs<double>("RPC/LAT_SCALE");
rpcStruct.LonScale = this->GetAs<double>("RPC/LONG_SCALE");
rpcStruct.HeightScale = this->GetAs<double>("RPC/HEIGHT_SCALE");
rpcStruct.LineScale = this->GetAs<double>("RPC/LINE_SCALE");
rpcStruct.SampleScale = this->GetAs<double>("RPC/SAMP_SCALE");
rpcStruct.LatScale = this->GetAs<double>("RPC/LAT_SCALE");
rpcStruct.LonScale = this->GetAs<double>("RPC/LONG_SCALE");
rpcStruct.HeightScale = this->GetAs<double>("RPC/HEIGHT_SCALE");
std::vector<double> coeffs(20);
std::vector<double> coeffs(20);
coeffs = this->GetAsVector<double>("RPC/LINE_NUM_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineNum);
coeffs = this->GetAsVector<double>("RPC/LINE_NUM_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineNum);
coeffs = this->GetAsVector<double>("RPC/LINE_DEN_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineDen);
coeffs = this->GetAsVector<double>("RPC/LINE_DEN_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineDen);
coeffs = this->GetAsVector<double>("RPC/SAMP_NUM_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleNum);
coeffs = this->GetAsVector<double>("RPC/SAMP_NUM_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleNum);
coeffs = this->GetAsVector<double>("RPC/SAMP_DEN_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleDen);
coeffs = this->GetAsVector<double>("RPC/SAMP_DEN_COEFF",' ',20);
std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleDen);
m_Imd.Add(MDGeom::RPC, rpcStruct);
}
else
{
kwl.emplace(fieldName, fieldValue);
}
}
m_Imd.Add(MDGeom::RPC, rpcStruct);
}
......
......@@ -105,6 +105,13 @@ Documentation:
* !780: Updating the documentation in preparation for OTB 8.0.0-alpha1 by Julien Osman
OTB-v 7.4.1 - Changes since version 7.4.0 (April 27th, 2022)
----------------------------------------------------------------
Features added:
* Update DiapOTB to v1.1.0
OTB-v 7.4.0 - Changes since version 7.3.0 (September 3rd, 2021)
----------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment