Commit 33a58018 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

Merge remote-tracking branch 'origin/develop' into integration_release-7.4

parents 20b8e6d8 5c096f44
......@@ -11,6 +11,12 @@ SatAzimuth 102.95
AcquisitionDate 2012-06-05T06:30:06.4Z
ProductionDate 2012-06-20T08:39:43.745Z
RPC <RPCParam>
Extra.ImageID 559102101-002
Extra.LinePeriod 0.2968
Extra.SwathFirstCol 3010
Extra.SwathLastCol 7298
Extra.TimeRangeEnd 2012-06-05T06:30:08.7180512Z
Extra.TimeRangeStart 2012-06-05T06:30:06.5710000Z
BandName B0
PhysicalGain 9.55
PhysicalBias 0
......@@ -43,4 +49,3 @@ SpectralSensitivity LUT1D.DIM0.SIZE = 209
LUT1D.DIM0.ORIGIN = 0.43
LUT1D.DIM0.SPACING = 0.0025
LUT1D.ARRAY = 0.0024163 0.0017305 0.0020803 0.0020499 0.001266 0.0007361 0.0006198 0.0006344 0.0007721 0.0011837 0.0020819 0.0023991 0.0013377 0.0006328 0.0003544 0.000289 0.0002498 0.0002541 0.0003346 0.0005048 0.0008684 0.0009871 0.0006587 0.0003833 0.0002606 0.0002356 0.0002364 0.0002791 0.0003613 0.0005575 0.0007414 0.0007413 0.0005768 0.000423 0.0003206 0.0003044 0.0003019 0.0003201 0.0003813 0.000463 0.000593 0.000708 0.0008577 0.0009017 0.0008813 0.0007801 0.0006583 0.0005863 0.0005224 0.0005506 0.0006403 0.0008293 0.0013444 0.0023942 0.0027274 0.001433 0.0006388 0.0003596 0.0002416 0.0001718 0.0001566 0.0001642 0.0001892 0.0002351 0.0003227 0.0006734 0.0014311 0.0013325 0.0005796 0.0002424 0.0001263 0.0001022 4.46e-05 6.52e-05 5.44e-05 5.73e-05 5.18e-05 5.04e-05 6.49e-05 7.23e-05 8.33e-05 7.39e-05 6.91e-05 0.0001382 0.0001692 0.000224 0.0002296 0.0001553 0.0001492 0.0001121 0.0001058 0.0001068 0.0001012 8.64e-05 5.33e-05 3.54e-05 4.4e-05 3.71e-05 6.91e-05 7.69e-05 7.91e-05 0.0001333 0.0001244 0.0002048 0.0002455 0.0002721 0.0003812 0.0004568 0.0006255 0.0008185 0.0009733 0.0012281 0.0013528 0.0015758 0.0017458 0.0019104 0.0020863 0.0023053 0.0025241 0.0037234 0.0044186 0.0053574 0.0066118 0.0083509 0.0107509 0.0150393 0.0212756 0.0292566 0.0414246 0.0586633 0.0834879 0.119038 0.167185 0.232637 0.312406 0.407047 0.509193 0.614827 0.714087 0.801755 0.871484 0.924126 0.958721 0.978299 0.988204 0.992294 0.990203 0.985402 0.977756 0.96602 0.953207 0.942125 0.930356 0.924149 0.921222 0.920382 0.921702 0.922742 0.923 0.923767 0.924307 0.920652 0.915484 0.909091 0.900338 0.890562 0.877642 0.86686 0.853729 0.842859 0.830531 0.819574 0.806909 0.792108 0.779167 0.766051 0.752119 0.737527 0.721732 0.704322 0.685317 0.66425 0.641385 0.617303 0.591954 0.567231 0.543013 0.518456 0.495754 0.473434 0.452822 0.433227 0.413192 0.391912 0.365966 0.332542 0.291768 0.245391 0.196254 0.148685 0.106886 0.073826 0.0491777 0.0327991 0.0215831 0.0145386 0.0103219 0.0076144 0.0061346
......@@ -23,6 +23,12 @@ ProjectionWKT GEOGCS["WGS 84",
AXIS["Longitude",EAST],
AUTHORITY["EPSG","4326"]]
RPC <RPCParam>
Extra.ImageID 559102101-002
Extra.LinePeriod 0.2968
Extra.SwathFirstCol 3010
Extra.SwathLastCol 7298
Extra.TimeRangeEnd 2012-06-05T06:30:08.7180512Z
Extra.TimeRangeStart 2012-06-05T06:30:06.5710000Z
BandName B0
PhysicalGain 9.55
PhysicalBias 0
......
......@@ -16,19 +16,19 @@ for the binary packages of OTB 7.1 and above. In this case QGIS 3.14 or more sho
The table below summarizes which version of OTB can be used with which version of QGIS.
+---------------+-----------------+-----------------+-----------------+
| | QGIS 3.8 - 3.12 | QGIS 3.14 | QGIS 3.16 |
+---------------+-----------------+-----------------+-----------------+
| OTB 6.6.1 | Compatible | Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+
| OTB 7.0.0 | Compatible | Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+
| OTB 7.1.0 | Not Compatible | Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+
| OTB 7.2.0 | Not Compatible | Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+
| OTB 8.0.0 | Not Compatible | Not Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+
+---------------+-----------------+-----------------+-----------------+-----------------+
| | QGIS 3.8 - 3.12 | QGIS 3.14 | QGIS 3.16 | QGIS 3.18 |
+---------------+-----------------+-----------------+-----------------+-----------------+
| OTB 6.6.1 | Compatible | Compatible | Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+-----------------+
| OTB 7.0.0 | Compatible | Compatible | Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+-----------------+
| OTB 7.1.0 | Not Compatible | Compatible | Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+-----------------+
| OTB 7.2.0 | Not Compatible | Compatible | Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+-----------------+
| OTB 8.0.0 | Not Compatible | Not Compatible | Not Compatible | Compatible |
+---------------+-----------------+-----------------+-----------------+-----------------+
Troubleshooting
---------------
......
/*
* Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbEllipsoidAdapter_h
#define otbEllipsoidAdapter_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "OTBOSSIMAdaptersExport.h"
class ossimEllipsoid;
namespace otb
{
/** \class EllipsoidAdapter
* \brief class providing the interface to the ossimEllipsoid
*
* This is a class to be used internally instead of introducing a dependence on
* ossimEllipsoid
*
* \todo{Add the support for different ellipsoid models}
*
* \deprecated
* \ingroup OTBOSSIMAdapters
**/
class OTBOSSIMAdapters_EXPORT EllipsoidAdapter : public itk::Object
{
public:
/** Standard class typedefs. */
typedef EllipsoidAdapter Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(EllipsoidAdapter, itk::Object);
/** Convert a XYZ coordinate into a lon, lat, height on the ellipsoid */
void XYZToLonLatHeight(double x, double y, double z, double& lon, double& lat, double& h) const;
/** Convert a lon, lat, height on the ellipsoid into a XYZ geocentric system*/
void LonLatHeightToXYZ(double lon, double lat, double h, double& x, double& y, double& z) const;
protected:
EllipsoidAdapter();
~EllipsoidAdapter() override;
private:
EllipsoidAdapter(const Self&) = delete;
void operator=(const Self&) = delete;
ossimEllipsoid* m_Ellipsoid;
};
} // namespace otb
#endif
......@@ -23,7 +23,6 @@ set(OTBOSSIMAdapters_SRC
otbImageKeywordlist.cxx
otbRPCSolverAdapter.cxx
otbDateTimeAdapter.cxx
otbEllipsoidAdapter.cxx
)
add_library(OTBOSSIMAdapters ${OTBOSSIMAdapters_SRC})
......
/*
* Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbEllipsoidAdapter.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
#pragma GCC diagnostic ignored "-Wshadow"
#include "ossim/base/ossimEllipsoid.h"
#pragma GCC diagnostic pop
#else
#include "ossim/base/ossimEllipsoid.h"
#endif
namespace otb
{
EllipsoidAdapter::EllipsoidAdapter()
{
m_Ellipsoid = new ossimEllipsoid();
}
EllipsoidAdapter::~EllipsoidAdapter()
{
if (m_Ellipsoid != nullptr)
{
delete m_Ellipsoid;
}
}
void EllipsoidAdapter::XYZToLonLatHeight(double x, double y, double z, double& lon, double& lat, double& h) const
{
// Note the lat/lon convension for ossim vs lon/lat for OTB
m_Ellipsoid->XYZToLatLonHeight(x, y, z, lat, lon, h);
}
void EllipsoidAdapter::LonLatHeightToXYZ(double lon, double lat, double h, double& x, double& y, double& z) const
{
// Note the lat/lon convension for ossim vs lon/lat for OTB
m_Ellipsoid->latLonHeightToXYZ(lat, lon, h, x, y, z);
}
} // namespace otb
......@@ -92,15 +92,17 @@ private:
SetParameterDescription("mask", "Validity mask (only pixels corresponding to a mask value greater than 0 will be used for statistics)");
MandatoryOff("mask");
AddParameter(ParameterType_InputFilename, "vec", "Input vectors");
AddParameter(ParameterType_InputVectorData, "vec", "Input vectors");
SetParameterDescription("vec", "Input geometries to analyze");
AddParameter(ParameterType_OutputFilename, "out", "Output XML statistics file");
SetParameterDescription("out", "Output file to store statistics (XML format)");
AddParameter(ParameterType_ListView, "field", "Field Name");
AddParameter(ParameterType_Field, "field", "Field Name");
SetParameterDescription("field", "Name of the field carrying the class name in the input vectors.");
SetListViewSingleSelectionMode("field", true);
SetVectorData("field", "vec");
SetTypeFilter("field", { OFTString, OFTInteger, OFTInteger64 });
AddParameter(ParameterType_Int, "layer", "Layer Index");
SetParameterDescription("layer", "Layer index to read in the input vector file.");
......@@ -131,6 +133,7 @@ private:
ClearChoices("field");
FieldParameter::TypeFilterType typeFilter = GetTypeFilter("field");
for (int iField = 0; iField < feature.ogr().GetFieldCount(); iField++)
{
std::string key, item = feature.ogr().GetFieldDefnRef(iField)->GetNameRef();
......@@ -140,7 +143,7 @@ private:
OGRFieldType fieldType = feature.ogr().GetFieldDefnRef(iField)->GetType();
if (fieldType == OFTString || fieldType == OFTInteger || fieldType == OFTInteger64)
if (typeFilter.empty() || std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
{
std::string tmpKey = "field." + key.substr(0, end - key.begin());
AddChoice(tmpKey, item);
......
......@@ -70,7 +70,7 @@ private:
AddDocTag(Tags::Learning);
AddParameter(ParameterType_InputFilename, "in", "Input samples");
AddParameter(ParameterType_InputVectorData, "in", "Input samples");
SetParameterDescription("in", "Vector data file containing samples (OGR format)");
AddParameter(ParameterType_OutputFilename, "out", "Output samples");
......@@ -78,9 +78,11 @@ private:
"Output vector data file storing new samples"
"(OGR format).");
AddParameter(ParameterType_ListView, "field", "Field Name");
AddParameter(ParameterType_Field, "field", "Field Name");
SetParameterDescription("field", "Name of the field carrying the class name in the input vectors.");
SetListViewSingleSelectionMode("field", true);
SetVectorData("field", "in");
SetTypeFilter("field", { OFTString, OFTInteger, OFTInteger64 });
AddParameter(ParameterType_Int, "layer", "Layer Index");
SetParameterDescription("layer", "Layer index to read in the input vector file.");
......@@ -99,8 +101,9 @@ private:
"be generated.");
SetDefaultParameterInt("samples", 100);
AddParameter(ParameterType_ListView, "exclude", "Field names for excluded features");
AddParameter(ParameterType_Field, "exclude", "Field names for excluded features");
SetParameterDescription("exclude", "List of field names in the input vector data that will not be generated in the output file.");
SetVectorData("exclude", "in");
AddParameter(ParameterType_Choice, "strategy", "Augmentation strategy");
......@@ -162,6 +165,7 @@ private:
ClearChoices("exclude");
ClearChoices("field");
FieldParameter::TypeFilterType typeFilter = GetTypeFilter("field");
for (int iField = 0; iField < feature.ogr().GetFieldCount(); iField++)
{
std::string key, item = feature.ogr().GetFieldDefnRef(iField)->GetNameRef();
......@@ -171,7 +175,7 @@ private:
OGRFieldType fieldType = feature.ogr().GetFieldDefnRef(iField)->GetType();
if (fieldType == OFTString || fieldType == OFTInteger || fieldType == OFTInteger64)
if (typeFilter.empty() || std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
{
std::string tmpKey = "field." + key.substr(0, end - key.begin());
AddChoice(tmpKey, item);
......
......@@ -67,7 +67,7 @@ private:
AddParameter(ParameterType_InputImage, "in", "InputImage");
SetParameterDescription("in", "Support image");
AddParameter(ParameterType_InputFilename, "vec", "Input sampling positions");
AddParameter(ParameterType_InputVectorData, "vec", "Input sampling positions");
SetParameterDescription("vec",
"Vector data file containing sampling"
"positions. (OGR format)");
......@@ -96,9 +96,11 @@ private:
AddParameter(ParameterType_StringList, "outfield.list.names", "Output field names");
SetParameterDescription("outfield.list.names", "Full list of output field names.");
AddParameter(ParameterType_ListView, "field", "Field Name");
AddParameter(ParameterType_Field, "field", "Field Name");
SetParameterDescription("field", "Name of the field carrying the class name in the input vectors.");
SetListViewSingleSelectionMode("field", true);
SetVectorData("field", "vec");
SetTypeFilter("field", { OFTString, OFTInteger, OFTInteger64 });
AddParameter(ParameterType_Int, "layer", "Layer Index");
SetParameterDescription("layer", "Layer index to read in the input vector file.");
......@@ -134,6 +136,7 @@ private:
ClearChoices("field");
FieldParameter::TypeFilterType typeFilter = GetTypeFilter("field");
for (int iField = 0; iField < feature.ogr().GetFieldCount(); iField++)
{
std::string key, item = feature.ogr().GetFieldDefnRef(iField)->GetNameRef();
......@@ -143,7 +146,7 @@ private:
OGRFieldType fieldType = feature.ogr().GetFieldDefnRef(iField)->GetType();
if (fieldType == OFTString || fieldType == OFTInteger || fieldType == OFTInteger64)
if (typeFilter.empty() || std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
{
std::string tmpKey = "field." + key.substr(0, end - key.begin());
AddChoice(tmpKey, item);
......
......@@ -121,7 +121,7 @@ private:
SetParameterDescription("mask", "Validity mask (only pixels corresponding to a mask value greater than 0 will be used for statistics)");
MandatoryOff("mask");
AddParameter(ParameterType_InputFilename, "vec", "Input vectors");
AddParameter(ParameterType_InputVectorData, "vec", "Input vectors");
SetParameterDescription("vec", "Input geometries to analyse");
AddParameter(ParameterType_OutputFilename, "out", "Output vectors");
......@@ -190,9 +190,10 @@ private:
// Default strategy : smallest
SetParameterString("strategy", "smallest");
AddParameter(ParameterType_ListView, "field", "Field Name");
AddParameter(ParameterType_Field, "field", "Field Name");
SetParameterDescription("field", "Name of the field carrying the class name in the input vectors.");
SetListViewSingleSelectionMode("field", true);
SetVectorData("field", "vec");
AddParameter(ParameterType_Int, "layer", "Layer Index");
SetParameterDescription("layer", "Layer index to read in the input vector file.");
......
......@@ -105,6 +105,7 @@ void TrainImagesBase::ShareSamplingParameters()
ShareParameter("sample.vfn", "polystat.field", "Field containing the class integer label for supervision",
"Field containing the class id for supervision. "
"The values in this field shall be cast into integers.");
SetVectorData("sample.vfn", "io.vd");
}
void TrainImagesBase::ConnectSamplingParameters()
......
......@@ -49,8 +49,10 @@ void TrainVectorBase<TInputValue, TOutputValue>::DoInit()
this->MandatoryOff("layer");
this->SetDefaultParameterInt("layer", 0);
this->AddParameter(ParameterType_ListView, "feat", "Field names for training features");
this->AddParameter(ParameterType_Field, "feat", "Field names for training features");
this->SetParameterDescription("feat", "List of field names in the input vector data to be used as features for training.");
this->SetVectorData("feat", "io.vd");
this->SetTypeFilter("feat", { OFTInteger, OFTInteger64, OFTReal });
// Add validation data used to compute confusion matrix or contingency table
this->AddParameter(ParameterType_Group, "valid", "Validation data");
......@@ -68,11 +70,13 @@ void TrainVectorBase<TInputValue, TOutputValue>::DoInit()
this->SetDefaultParameterInt("valid.layer", 0);
// Add class field if we used validation
this->AddParameter(ParameterType_ListView, "cfield", "Field containing the class integer label for supervision");
this->AddParameter(ParameterType_Field, "cfield", "Field containing the class integer label for supervision");
this->SetParameterDescription("cfield",
"Field containing the class id for supervision. "
"The values in this field shall be cast into integers. "
"Only geometries with this field available will be taken into account.");
this->SetVectorData("cfield", "io.vd");
this->SetTypeFilter("cfield", { OFTString, OFTInteger, OFTInteger64, OFTReal });
this->SetListViewSingleSelectionMode("cfield", true);
this->AddParameter(ParameterType_Bool, "v", "Verbose mode");
......@@ -107,6 +111,8 @@ void TrainVectorBase<TInputValue, TOutputValue>::DoUpdateParameters()
this->ClearChoices("feat");
this->ClearChoices("cfield");
FieldParameter::TypeFilterType featTypeFilter = this->GetTypeFilter("feat");
FieldParameter::TypeFilterType cfieldTypeFilter = this->GetTypeFilter("cfield");
for (int iField = 0; iField < feature.ogr().GetFieldCount(); iField++)
{
std::string key, item = feature.ogr().GetFieldDefnRef(iField)->GetNameRef();
......@@ -116,12 +122,12 @@ void TrainVectorBase<TInputValue, TOutputValue>::DoUpdateParameters()
OGRFieldType fieldType = feature.ogr().GetFieldDefnRef(iField)->GetType();
if (fieldType == OFTInteger || fieldType == OFTInteger64 || fieldType == OFTReal)
if (featTypeFilter.empty() || std::find(featTypeFilter.begin(), featTypeFilter.end(), fieldType) != std::end(featTypeFilter))
{
std::string tmpKey = "feat." + key.substr(0, static_cast<unsigned long>(end - key.begin()));
this->AddChoice(tmpKey, item);
}
if (fieldType == OFTString || fieldType == OFTInteger || fieldType == OFTInteger64 || fieldType == OFTReal)
if (cfieldTypeFilter.empty() || std::find(cfieldTypeFilter.begin(), cfieldTypeFilter.end(), fieldType) != std::end(cfieldTypeFilter))
{
std::string tmpKey = "cfield." + key.substr(0, static_cast<unsigned long>(end - key.begin()));
this->AddChoice(tmpKey, item);
......
......@@ -156,7 +156,8 @@ private:
void DoUpdateParameters() override
{
if (!HasUserValue("mode") && HasValue("inr") && HasValue("inm") &&
otb::PleiadesPToXSAffineTransformCalculator::CanCompute(GetParameterImage("inr"), GetParameterImage("inm")))
otb::PleiadesPToXSAffineTransformCalculator::CanCompute(GetParameterImage("inr")->GetImageMetadata(),
GetParameterImage("inm")->GetImageMetadata()))
{
otbAppLogWARNING("Forcing PHR mode with PHR data. You need to add \"-mode default\" to force the default mode with PHR images.");
SetParameterString("mode", "phr");
......@@ -266,7 +267,8 @@ private:
otbAppLogINFO("Using the PHR mode");
otb::PleiadesPToXSAffineTransformCalculator::TransformType::OffsetType offset =
otb::PleiadesPToXSAffineTransformCalculator::ComputeOffset(GetParameterImage("inr"), GetParameterImage("inm"));
otb::PleiadesPToXSAffineTransformCalculator::ComputeOffset(GetParameterImage("inr")->GetImageMetadata(),
GetParameterImage("inm")->GetImageMetadata());
m_BasicResampler->SetInput(movingImage);
origin += offset;
......
......@@ -147,7 +147,7 @@ public:
double TotalSeconds() const
{
return m_Duration.total_nanoseconds() * 1e9;
return m_Duration.total_nanoseconds() * 1e-9;
}
friend Duration& operator+=(Duration & u, Duration const& v)
......
Markdown is supported
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