Commit 042e4ba7 authored by jbrossar's avatar jbrossar

[WIP] Corrected bugs

parent e4d8aac9
Pipeline #7051 failed with stages
in 30 minutes and 33 seconds
......@@ -123,11 +123,4 @@ ExternalProject_Add(GDAL
)
ExternalProject_Add_Step(GDAL update_deprecated_shebang
COMMAND /bin/sh -x
${CMAKE_SOURCE_DIR}/patches/GDAL/update_deprecated_shebang.sh
${SB_INSTALL_PREFIX}/bin
DEPENDEES install
)
SUPERBUILD_PATCH_SOURCE(GDAL)
#!/bin/sh -x
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# 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.
#
#
SCRIPTS_DIR=$1
for f in $SCRIPTS_DIR/*.py; do
sed -i "s%#\!/usr/bin/env python%#\!/usr/bin/env python3%" $f
done
diff -burN OTB-8.0.0-alpha1.orig/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx OTB-8.0.0-alpha1/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
--- OTB-8.0.0-alpha1.orig/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx 2021-02-23 15:50:31.726374416 +0100
+++ OTB-8.0.0-alpha1/Modules/IO/IOGDAL/src/otbGDALImageIO.cxx 2021-02-25 14:18:43.775614822 +0100
@@ -832,12 +832,15 @@
{
gcpCount = 0; // fix for uninitialized gcpCount in gdal (when
// reading Palsar image)
- }
- std::string key;
+ itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::GCPCountKey, 0);
+ }
+ else
+ {
itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::GCPCountKey, gcpCount);
+ std::string key;
for (unsigned int cpt = 0; cpt < gcpCount; ++cpt)
{
@@ -863,6 +866,7 @@
}
m_Imd.Add(MDGeom::GCP, gcps);
}
+ }
/* -------------------------------------------------------------------- */
/* Get the six coefficients of affine geoTtransform */
\ No newline at end of file
......@@ -104,14 +104,14 @@ int vnsGenericRSTransformFromImage(int itkNotUsed(argc), char* argv[])
TransformType::Pointer wgs2img = TransformType::New();
wgs2img->SetInputProjectionRef(wgsRef);
wgs2img->SetOutputProjectionRef(reader->GetOutput()->GetProjectionRef());
wgs2img->SetOutputKeywordList(reader->GetOutput()->GetImageKeywordlist());
wgs2img->SetOutputImageMetadata(&(reader->GetOutput()->GetImageMetadata()));
wgs2img->InstantiateTransform();
// Instanciate Image->WGS transform
TransformType::Pointer img2wgs = TransformType::New();
img2wgs->SetInputProjectionRef(reader->GetOutput()->GetProjectionRef());
img2wgs->SetInputKeywordList(reader->GetOutput()->GetImageKeywordlist());
img2wgs->SetInputImageMetadata(&(reader->GetOutput()->GetImageMetadata()));
img2wgs->SetOutputProjectionRef(wgsRef);
img2wgs->InstantiateTransform();
......@@ -157,22 +157,22 @@ int vnsGenericRSTransformImageAndMNTToWGS84ConversionChecking(int itkNotUsed(arg
GeoDistanceType::Pointer geoDistance = GeoDistanceType::New();
GeoDistance3DType::Pointer geoDistance3d = GeoDistance3DType::New();
otb::DEMHandler::Pointer demHandler = otb::DEMHandler::Instance();
demHandler->OpenDEMDirectory(argv[2]);
demHandler->OpenGeoidFile(argv[3]);
double heightAboveEllipsoid = demHandler->GetHeightAboveEllipsoid(refGeoPt);
auto & demHandler = otb::DEMHandler::GetInstance();
demHandler.OpenDEMDirectory(argv[2]);
demHandler.OpenGeoidFile(argv[3]);
double heightAboveEllipsoid = demHandler.GetHeightAboveEllipsoid(refGeoPt);
// Instanciate WGS->Image transform
TransformType::Pointer wgs2img = TransformType::New();
wgs2img->SetInputProjectionRef(wgsRef);
wgs2img->SetOutputProjectionRef(reader->GetOutput()->GetProjectionRef());
wgs2img->SetOutputKeywordList(reader->GetOutput()->GetImageKeywordlist());
wgs2img->SetOutputImageMetadata(&(reader->GetOutput()->GetImageMetadata()));
wgs2img->InstantiateTransform();
// Instanciate Image->WGS transform
TransformType::Pointer img2wgs = TransformType::New();
img2wgs->SetInputProjectionRef(reader->GetOutput()->GetProjectionRef());
img2wgs->SetInputKeywordList(reader->GetOutput()->GetImageKeywordlist());
img2wgs->SetInputImageMetadata(&(reader->GetOutput()->GetImageMetadata()));
img2wgs->SetOutputProjectionRef(wgsRef);
img2wgs->InstantiateTransform();
......@@ -181,13 +181,13 @@ int vnsGenericRSTransformImageAndMNTToWGS84ConversionChecking(int itkNotUsed(arg
Transform3DType::Pointer wgs2img3d = Transform3DType::New();
wgs2img3d->SetInputProjectionRef(wgsRef);
wgs2img3d->SetOutputProjectionRef(reader->GetOutput()->GetProjectionRef());
wgs2img3d->SetOutputKeywordList(reader->GetOutput()->GetImageKeywordlist());
wgs2img3d->SetOutputImageMetadata(&(reader->GetOutput()->GetImageMetadata()));
wgs2img3d->InstantiateTransform();
// Instanciate Image->WGS transform 3D
Transform3DType::Pointer img2wgs3d = Transform3DType::New();
img2wgs3d->SetInputProjectionRef(reader->GetOutput()->GetProjectionRef());
img2wgs3d->SetInputKeywordList(reader->GetOutput()->GetImageKeywordlist());
img2wgs3d->SetInputImageMetadata(&(reader->GetOutput()->GetImageMetadata()));
img2wgs3d->SetOutputProjectionRef(wgsRef);
img2wgs3d->InstantiateTransform();
......
......@@ -110,7 +110,7 @@ int vnsGenericRSTransformGenericTest(int argc, char * argv[])
reader->UpdateOutputInformation();
transform->SetInputProjectionRef(reader->GetOutput()->GetProjectionRef());
transform->SetInputKeywordList(reader->GetOutput()->GetImageKeywordlist());
transform->SetInputImageMetadata(&(reader->GetOutput()->GetImageMetadata()));
std::cout<<"Input projection read from image: "<<argv[6]<<std::endl;
}
......@@ -147,7 +147,7 @@ int vnsGenericRSTransformGenericTest(int argc, char * argv[])
reader->UpdateOutputInformation();
transform->SetOutputProjectionRef(reader->GetOutput()->GetProjectionRef());
transform->SetOutputKeywordList(reader->GetOutput()->GetImageKeywordlist());
transform->SetOutputImageMetadata(&(reader->GetOutput()->GetImageMetadata()));
std::cout<<"Output projection read from image: "<<argv[8]<<std::endl;
}
......@@ -187,7 +187,7 @@ int vnsGenericRSTransformGenericTest(int argc, char * argv[])
}
double averageElevation = atof(argv[14]);
otb::DEMHandler::Instance()->SetDefaultHeightAboveEllipsoid(averageElevation);
otb::DEMHandler::GetInstance().SetDefaultHeightAboveEllipsoid(averageElevation);
std::cout<<"Average elevation "<<averageElevation<<" used."<<std::endl;
}
......@@ -199,7 +199,7 @@ int vnsGenericRSTransformGenericTest(int argc, char * argv[])
return EXIT_FAILURE;
}
otb::DEMHandler::Instance()->OpenDEMDirectory(argv[14]);
otb::DEMHandler::GetInstance().OpenDEMDirectory(argv[14]);
std::cout<<"Elevation from DEM "<<argv[14]<<" used."<<std::endl;
}
......
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