Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
31a5e9fd
Commit
31a5e9fd
authored
Feb 16, 2016
by
Guillaume Pasero
Browse files
Synchronization, merge branch 'develop' into masked_iterator_decorator
parents
867b9229
16fc6cd6
Changes
73
Hide whitespace changes
Inline
Side-by-side
.travis.yml
View file @
31a5e9fd
...
...
@@ -16,15 +16,12 @@ before_script:
-
export MAKE_CMD=/tmp/ninja
-
export CMAKE_GEN='Ninja'
-
cd /tmp
-
-
wget https://cmake.org/files/v3.4/cmake-3.4.1-Linux-x86_64.tar.gz --no-check-certificate
-
wget https://raw.githubusercontent.com/rkanavath/otb_cmake_scripts/master/rashad-cm.cmake --no-check-certificate
-
tar -xzf cmake-3.4.1-Linux-x86_64.tar.gz
-
wget https://github.com/martine/ninja/releases/download/v1.6.0/ninja-linux.zip --no-check-certificate
-
unzip ninja-linux.zip
-
wget https://www.orfeo-toolbox.org/packages/xdk/OTB-5.2/OTB-5.2.0-xdk-Linux64.run
--no-check-certificate
-
wget https://www.orfeo-toolbox.org/packages/xdk/OTB-5.2/OTB-5.2.0-xdk-Linux64.run --no-check-certificate
-
chmod +x /tmp/OTB-5.2.0-xdk-Linux64.run
-
/tmp/OTB-5.2.0-xdk-Linux64.run
script
:
/tmp/cmake-3.4.1-Linux-x86_64/bin/ctest -VV -S /tmp/rashad-cm.cmake
script
:
/tmp/cmake-3.4.1-Linux-x86_64/bin/ctest -VV -S /home/travis/build/orfeotoolbox/OTB/Utilities/Maintenance/TravisBuild.cmake
CMake/CTestCustom.cmake.in
View file @
31a5e9fd
...
...
@@ -31,6 +31,10 @@ set(CTEST_CUSTOM_COVERAGE_EXCLUDE
# Exclude files from the Examples directories
#".*/Examples/.*"
# Exclude files from the Testing directories
".*/test/.*"
".*/Testing/.*"
# Exclude files from the ThirdParty Utilities directories
".*/Modules/ThirdParty/.*"
".*/Utilities/.*"
...
...
CMake/FindGLEW.cmake
0 → 100644
View file @
31a5e9fd
# Courtesy of: https://raw.github.com/progschj/OpenGL-Examples/
#
# Try to find GLEW library and include path.
# Once done this will define
#
# GLEW_FOUND
# GLEW_INCLUDE_PATH
# GLEW_LIBRARY
#
IF
(
WIN32
)
FIND_PATH
(
GLEW_INCLUDE_PATH GL/glew.h
$ENV{PROGRAMFILES}/GLEW/include
${
GLEW_ROOT_DIR
}
/include
DOC
"The directory where GL/glew.h resides"
)
FIND_LIBRARY
(
GLEW_LIBRARY
NAMES glew GLEW glew32 glew32s
PATHS
$ENV{PROGRAMFILES}/GLEW/lib
${
GLEW_ROOT_DIR
}
/lib
${
PROJECT_SOURCE_DIR
}
/src/nvgl/glew/bin
${
PROJECT_SOURCE_DIR
}
/src/nvgl/glew/lib
DOC
"The GLEW library"
)
ELSE
(
WIN32
)
FIND_PATH
(
GLEW_INCLUDE_PATH GL/glew.h
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${
GLEW_ROOT_DIR
}
/include
DOC
"The directory where GL/glew.h resides"
)
# Prefer the static library.
FIND_LIBRARY
(
GLEW_LIBRARY
NAMES libGLEW.so GLEW
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${
GLEW_ROOT_DIR
}
/lib
DOC
"The GLEW library"
)
ENDIF
(
WIN32
)
SET
(
GLEW_FOUND
"NO"
)
IF
(
GLEW_INCLUDE_PATH AND GLEW_LIBRARY
)
SET
(
GLEW_LIBRARIES
${
GLEW_LIBRARY
}
)
SET
(
GLEW_FOUND
"YES"
)
ENDIF
(
GLEW_INCLUDE_PATH AND GLEW_LIBRARY
)
INCLUDE
(
${
CMAKE_ROOT
}
/Modules/FindPackageHandleStandardArgs.cmake
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
GLEW DEFAULT_MSG GLEW_LIBRARY
)
CMake/FindGLFW.cmake
0 → 100644
View file @
31a5e9fd
# Locate the glfw library
# This module defines the following variables:
# GLFW_LIBRARY, the name of the library;
# GLFW_INCLUDE_DIR, where to find glfw include files.
# GLFW_FOUND, true if both the GLFW_LIBRARY and GLFW_INCLUDE_DIR have been found.
#
# To help locate the library and include file, you could define an environment variable called
# GLFW_ROOT which points to the root of the glfw library installation. This is pretty useful
# on a Windows platform.
#
#
# Usage example to compile an "executable" target to the glfw library:
#
# FIND_PACKAGE (glfw REQUIRED)
# INCLUDE_DIRECTORIES (${GLFW_INCLUDE_DIR})
# ADD_EXECUTABLE (executable ${EXECUTABLE_SRCS})
# TARGET_LINK_LIBRARIES (executable ${GLFW_LIBRARY})
#
# TODO:
# Allow the user to select to link to a shared library or to a static library.
#Search for the include file...
FIND_PATH
(
GLFW_INCLUDE_DIR GLFW/glfw3.h DOC
"Path to GLFW include directory."
HINTS
$ENV{GLFW_ROOT}
PATH_SUFFIX
include
# For finding the include file under the root of the glfw expanded archive, typically on Windows.
)
FIND_LIBRARY
(
GLFW_LIBRARY DOC
"Absolute path to GLFW library."
NAMES glfw glfw3dll glfw3
HINTS
$ENV{GLFW_ROOT}
PATH_SUFFIXES
lib
# For finding the library file under the root of the glfw expanded archive, typically on Windows.
)
IF
(
GLFW_INCLUDE_DIR AND EXISTS
"
${
GLFW_INCLUDE_DIR
}
/GLFW/glfw3.h"
)
FILE
(
STRINGS
"
${
GLFW_INCLUDE_DIR
}
/GLFW/glfw3.h"
glfw_version_str
REGEX
"^#[
\t
]*define[
\t
]+GLFW_VERSION_(MAJOR|MINOR|REVISION)[
\t
]+[0-9]+$"
)
UNSET
(
GLFW_VERSION_STRING
)
FOREACH
(
VPART MAJOR MINOR REVISION
)
FOREACH
(
VLINE
${
glfw_version_str
}
)
IF
(
VLINE MATCHES
"^#[
\t
]*define[
\t
]+GLFW_VERSION_
${
VPART
}
"
)
STRING
(
REGEX REPLACE
"^#[
\t
]*define[
\t
]+GLFW_VERSION_
${
VPART
}
[
\t
]+([0-9]+)$"
"
\\
1"
GLFW_VERSION_PART
"
${
VLINE
}
"
)
IF
(
GLFW_VERSION_STRING
)
SET
(
GLFW_VERSION_STRING
"
${
GLFW_VERSION_STRING
}
.
${
GLFW_VERSION_PART
}
"
)
ELSE
()
SET
(
GLFW_VERSION_STRING
"
${
GLFW_VERSION_PART
}
"
)
ENDIF
()
UNSET
(
GLFW_VERSION_PART
)
ENDIF
()
ENDFOREACH
()
ENDFOREACH
()
ENDIF
()
INCLUDE
(
${
CMAKE_ROOT
}
/Modules/FindPackageHandleStandardArgs.cmake
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
GLFW
REQUIRED_VARS GLFW_LIBRARY GLFW_INCLUDE_DIR
VERSION_VAR GLFW_VERSION_STRING
)
\ No newline at end of file
CMake/OTBGroups.cmake
View file @
31a5e9fd
...
...
@@ -16,6 +16,7 @@ set(group_list
Remote
Segmentation
ThirdParty
Visualization
Wrappers
)
...
...
@@ -34,8 +35,10 @@ set(Radiometry_documentation "This group contains algorithms related to the proc
set
(
Registration_documentation
"This group contains algorithms related to registration of images"
)
set
(
Segmentation_documentation
"This group contains algorithms related to image segmentaiton"
)
set
(
ThirdParty_documentation
"This group contains all Orfeo ToolBox third parties"
)
set
(
Visualization_documentation
"This group contains Ice (visualization framework) and IceViewer (visualization tool)"
)
set
(
Wrappers_documentation
"This group contains the application framework and the wrappers to use it"
)
set
(
Remote_documentation
"This group of modules is for OTB based code that have
additional third-party dependencies not bundled with the toolkit,
new algorithms or implementations seeking greater exposure and adoption,
...
...
Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx
View file @
31a5e9fd
...
...
@@ -213,7 +213,14 @@ private:
goesOn2
=
feature2
.
addr
()
!=
0
;
count
++
;
}
layer2
.
ogr
().
CommitTransaction
();
const
OGRErr
err
=
layer2
.
ogr
().
CommitTransaction
();
if
(
err
!=
OGRERR_NONE
)
{
itkExceptionMacro
(
<<
"Unable to commit transaction for OGR layer "
<<
layer2
.
ogr
().
GetName
()
<<
"."
);
}
source2
->
SyncToDisk
();
clock_t
toc
=
clock
();
...
...
Modules/Applications/AppSegmentation/app/otbLSMSVectorization.cxx
View file @
31a5e9fd
...
...
@@ -335,7 +335,12 @@ private:
firstFeature
=
nextFeature
;
}
layer
.
ogr
().
CommitTransaction
();
const
OGRErr
err
=
layer
.
ogr
().
CommitTransaction
();
if
(
err
!=
OGRERR_NONE
)
{
itkExceptionMacro
(
<<
"Unable to commit transaction for OGR layer "
<<
layer
.
ogr
().
GetName
()
<<
"."
);
}
if
(
extension
==
".shp"
){
sqloss
.
str
(
""
);
...
...
Modules/Applications/AppStereo/test/CMakeLists.txt
View file @
31a5e9fd
...
...
@@ -48,7 +48,7 @@ otb_test_application(NAME apTvDmStereoFramework
#----------- StereoRectificationGridGenerator TESTS ----------------
otb_test_application
(
NAME apT
u
DmStereoRectificationGridGeneratorTest
otb_test_application
(
NAME apT
v
DmStereoRectificationGridGeneratorTest
APP StereoRectificationGridGenerator
OPTIONS -io.inleft
${
EXAMPLEDATA
}
/sensor_stereo_left.tif
...
...
Modules/Core/Common/include/otbConfigurationManager.h
View file @
31a5e9fd
...
...
@@ -18,7 +18,13 @@
#ifndef _otbConfigurationManager_h
#define _otbConfigurationManager_h
#include
"itkVersion.h"
#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 8)
#include
"itksys/FundamentalType.h"
#else
#include
"itk_kwiml.h"
#endif
#include
<string>
#include
<boost/cstdint.hpp>
...
...
@@ -38,7 +44,11 @@ namespace otb
class
ConfigurationManager
{
public:
#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 8)
typedef
::
itksysFundamentalType_UInt64
RAMValueType
;
#else
typedef
KWIML_INT_uint64_t
RAMValueType
;
#endif
/**
* DEMDirectory is a directory were DEM tiles are stored.
...
...
Modules/Core/ImageBase/test/CMakeLists.txt
View file @
31a5e9fd
...
...
@@ -90,7 +90,7 @@ otb_add_test(NAME coTvExtractROI2 COMMAND otbImageBaseTestDriver
26 97 209 100
)
otb_add_test
(
NAME bfT
u
ComplexToVectorImageCastFilterTest COMMAND otbImageBaseTestDriver
otb_add_test
(
NAME bfT
v
ComplexToVectorImageCastFilterTest COMMAND otbImageBaseTestDriver
--compare-n-images
${
NOTOL
}
2
${
BASELINE
}
/bfTvComplexToVectorImageCastFilterTest.tif
${
TEMP
}
/bfTvComplexToVectorImageCastFilterTest.tif
...
...
Modules/Core/PointSet/test/CMakeLists.txt
View file @
31a5e9fd
...
...
@@ -40,7 +40,7 @@ otb_add_test(NAME bfTuImageToPointSetFilterTest COMMAND otbPointSetTestDriver
otb_add_test
(
NAME bfTvTransformPointSetFilter COMMAND otbPointSetTestDriver
otbTransformPointSetFilterTest
)
otb_add_test
(
NAME feT
u
ThresholdImageToPointSet1 COMMAND otbPointSetTestDriver
otb_add_test
(
NAME feT
v
ThresholdImageToPointSet1 COMMAND otbPointSetTestDriver
--compare-ascii
${
EPSILON_3
}
${
BASELINE_FILES
}
/feThresholdImageToPointSet_Threshold_0To255.txt
${
TEMP
}
/feThresholdImageToPointSet_Threshold_0To255.txt
otbThresholdImageToPointSetTest
...
...
@@ -48,7 +48,7 @@ otb_add_test(NAME feTuThresholdImageToPointSet1 COMMAND otbPointSetTestDriver
${
TEMP
}
/feThresholdImageToPointSet_Threshold_0To255.txt
0 255
)
otb_add_test
(
NAME feT
u
ThresholdImageToPointSet2 COMMAND otbPointSetTestDriver
otb_add_test
(
NAME feT
v
ThresholdImageToPointSet2 COMMAND otbPointSetTestDriver
--compare-ascii
${
EPSILON_3
}
${
BASELINE_FILES
}
/feThresholdImageToPointSet_Threshold_0To0.txt
${
TEMP
}
/feThresholdImageToPointSet_Threshold_0To0.txt
otbThresholdImageToPointSetTest
...
...
@@ -56,7 +56,7 @@ otb_add_test(NAME feTuThresholdImageToPointSet2 COMMAND otbPointSetTestDriver
${
TEMP
}
/feThresholdImageToPointSet_Threshold_0To0.txt
0 0
)
otb_add_test
(
NAME feT
u
ThresholdImageToPointSet3 COMMAND otbPointSetTestDriver
otb_add_test
(
NAME feT
v
ThresholdImageToPointSet3 COMMAND otbPointSetTestDriver
--compare-ascii
${
EPSILON_3
}
${
BASELINE_FILES
}
/feThresholdImageToPointSet_Threshold_255To255.txt
${
TEMP
}
/feThresholdImageToPointSet_Threshold_255To255.txt
otbThresholdImageToPointSetTest
...
...
@@ -64,7 +64,7 @@ otb_add_test(NAME feTuThresholdImageToPointSet3 COMMAND otbPointSetTestDriver
${
TEMP
}
/feThresholdImageToPointSet_Threshold_255To255.txt
255 255
)
otb_add_test
(
NAME feT
u
ThresholdImageToPointSet4 COMMAND otbPointSetTestDriver
otb_add_test
(
NAME feT
v
ThresholdImageToPointSet4 COMMAND otbPointSetTestDriver
--compare-ascii
${
EPSILON_3
}
${
BASELINE_FILES
}
/feThresholdImageToPointSet_Threshold_1To200.txt
${
TEMP
}
/feThresholdImageToPointSet_Threshold_1To200.txt
otbThresholdImageToPointSetTest
...
...
Modules/Core/Streaming/include/otbPipelineMemoryPrintCalculator.h
View file @
31a5e9fd
...
...
@@ -19,7 +19,11 @@
#define __otbPipelineMemoryPrintCalculator_h
#include
"itkProcessObject.h"
#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 8)
#include
"itksys/FundamentalType.h"
#else
#include
"itk_kwiml.h"
#endif
#include
<set>
namespace
otb
...
...
@@ -75,7 +79,11 @@ public:
typedef
ProcessObjectType
::
Pointer
ProcessObjectPointerType
;
typedef
itk
::
DataObject
DataObjectType
;
typedef
DataObjectType
::
Pointer
DataObjectPointerType
;
#if ITK_VERSION_MAJOR < 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR <= 8)
typedef
::
itksysFundamentalType_UInt64
MemoryPrintType
;
#else
typedef
KWIML_INT_uint64_t
MemoryPrintType
;
#endif
typedef
std
::
set
<
const
ProcessObjectType
*>
ProcessObjectPointerSetType
;
/** Run-time type information (and related methods). */
...
...
Modules/Filtering/VectorDataManipulation/test/CMakeLists.txt
View file @
31a5e9fd
...
...
@@ -71,7 +71,7 @@ otb_add_test(NAME bfTvPolygonCompacityFunctor COMMAND otbVectorDataManipulationT
${
TEMP
}
/bfPolygonCompacityFunctorTest.txt
)
otb_add_test
(
NAME bfT
u
VectorDataToRandomLineGenerator COMMAND otbVectorDataManipulationTestDriver
otb_add_test
(
NAME bfT
v
VectorDataToRandomLineGenerator COMMAND otbVectorDataManipulationTestDriver
--compare-ogr
${
NOTOL
}
${
BASELINE_FILES
}
/bfTvVectorDataToRandomLineGeneratorOutput.shp
${
TEMP
}
/bfTvVectorDataToRandomLineGeneratorOutput.shp
...
...
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
View file @
31a5e9fd
...
...
@@ -441,11 +441,14 @@ bool GDALImageIO::GetSubDatasetInfo(std::vector<std::string> &names, std::vector
char
**
papszMetadata
;
papszMetadata
=
m_Dataset
->
GetDataSet
()
->
GetMetadata
(
"SUBDATASETS"
);
std
::
cout
<<
m_Dataset
->
GetDataSet
()
->
GetDriver
()
->
GetDescription
()
<<
std
::
endl
;
// Have we find some dataSet ?
// This feature is supported only for hdf4 and hdf5 file (regards to the bug 270)
if
(
(
CSLCount
(
papszMetadata
)
>
0
)
&&
(
(
strcmp
(
m_Dataset
->
GetDataSet
()
->
GetDriver
()
->
GetDescription
(),
"HDF4"
)
==
0
)
||
(
strcmp
(
m_Dataset
->
GetDataSet
()
->
GetDriver
()
->
GetDescription
(),
"HDF5"
)
==
0
)
)
)
(
strcmp
(
m_Dataset
->
GetDataSet
()
->
GetDriver
()
->
GetDescription
(),
"HDF5"
)
==
0
)
||
(
strcmp
(
m_Dataset
->
GetDataSet
()
->
GetDriver
()
->
GetDescription
(),
"SENTINEL2"
)
==
0
)
)
)
{
for
(
int
cpt
=
0
;
papszMetadata
[
cpt
]
!=
NULL
;
++
cpt
)
{
...
...
Modules/IO/IOGDAL/test/otbGDALImageIOTestWriteMetadata.cxx
View file @
31a5e9fd
...
...
@@ -560,9 +560,14 @@ bool writeReadDatasetMetadata(std::string filename, std::vector<std::string> opt
}
poBand
=
poDstDS
->
GetRasterBand
(
1
);
poBand
->
RasterIO
(
GF_Write
,
0
,
0
,
128
,
128
,
abyRaster
,
128
,
128
,
GDT_Byte
,
0
,
0
);
const
OGRErr
errRasterIO
=
poBand
->
RasterIO
(
GF_Write
,
0
,
0
,
128
,
128
,
abyRaster
,
128
,
128
,
GDT_Byte
,
0
,
0
);
if
(
errRasterIO
!=
OGRERR_NONE
)
{
std
::
cerr
<<
"Unable to write image data."
<<
std
::
endl
;
return
false
;
}
// Get some information from dataset
infoDatasetCreate
->
m_Name
=
"Create"
;
...
...
Modules/IO/IOGDAL/test/otbGDALReadPxlComplex.cxx
View file @
31a5e9fd
...
...
@@ -17,6 +17,7 @@
=========================================================================*/
#include
"gdal_priv.h"
#include
"ogr_core.h"
#include
<iostream>
#include
<complex>
...
...
@@ -54,7 +55,7 @@ int otbGDALReadPxlComplexGeneric(int argc, char * argv[])
poDataset
=
(
GDALDataset
*
)
GDALOpen
(
argv
[
1
],
GA_ReadOnly
);
if
(
poDataset
==
NULL
)
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
// Get some information from file
int
nbBand
=
poDataset
->
GetRasterCount
();
...
...
@@ -72,7 +73,7 @@ int otbGDALReadPxlComplexGeneric(int argc, char * argv[])
std
::
cout
<<
"**** METHOD 1 : Use RasterIO to read all selected data in file ****"
<<
std
::
endl
;
std
::
streamoff
nbBytes
=
static_cast
<
std
::
streamoff
>
(
nbBand
)
*
static_cast
<
std
::
streamoff
>
(
nbPixelToRead
)
*
static_cast
<
std
::
streamoff
>
(
bytePerPixel
);
std
::
cout
<<
"nbBytes of the buffer = "
<<
nbBytes
<<
" = "
\
<<
nbBand
<<
" x "
<<
nbPixelToRead
<<
" x "
<<
bytePerPixel
<<
std
::
endl
;
<<
nbBand
<<
" x "
<<
nbPixelToRead
<<
" x "
<<
bytePerPixel
<<
std
::
endl
;
char
*
loadBuffer
=
new
char
[
static_cast
<
unsigned
int
>
(
nbBytes
)];
...
...
@@ -132,9 +133,15 @@ int otbGDALReadPxlComplexGeneric(int argc, char * argv[])
{
poBand
=
poDataset
->
GetRasterBand
(
itBand
+
1
);
poBand
->
RasterIO
(
GF_Read
,
posX
,
posY
,
sizeX
,
sizeY
,
&
(
pPixelValue
[
itBand
*
nbPixelToRead
]),
sizeX
,
sizeY
,
poBand
->
GetRasterDataType
(),
0
,
0
);
OGRErr
errRasterIO
=
poBand
->
RasterIO
(
GF_Read
,
posX
,
posY
,
sizeX
,
sizeY
,
&
(
pPixelValue
[
itBand
*
nbPixelToRead
]),
sizeX
,
sizeY
,
poBand
->
GetRasterDataType
(),
0
,
0
);
if
(
errRasterIO
!=
OGRERR_NONE
)
{
std
::
cerr
<<
"Unable to read image data."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
for
(
unsigned
int
itPxl
=
0
;
itPxl
<
(
unsigned
int
)
nbPixelToRead
;
itPxl
++
)
{
...
...
Modules/Radiometry/SARCalibration/test/CMakeLists.txt
View file @
31a5e9fd
...
...
@@ -173,7 +173,7 @@ otb_add_test(NAME raTvSarBrightnessToImageWithComplexPixelFilter COMMAND otbSAR
1000 1000 250 250
# Extract
)
otb_add_test
(
NAME raT
u
SarParametricMapFunction COMMAND otbSARCalibrationTestDriver
otb_add_test
(
NAME raT
v
SarParametricMapFunction COMMAND otbSARCalibrationTestDriver
--compare-ascii
${
NOTOL
}
${
BASELINE_FILES
}
/raTvSarParametricMapFunctionOutputAscii.txt
${
TEMP
}
/raTvSarParametricMapFunctionOutputAscii.txt
...
...
Modules/Segmentation/Conversion/include/otbPersistentImageToOGRDataFilter.txx
View file @
31a5e9fd
...
...
@@ -173,7 +173,14 @@ PersistentImageToOGRDataFilter<TImage>
//Copy features contained in the memory layer (srcLayer) in the output layer
itk::TimeProbe chrono;
chrono.Start();
dstLayer.ogr().StartTransaction();
OGRErr err = dstLayer.ogr().StartTransaction();
if (err != OGRERR_NONE)
{
itkExceptionMacro(<< "Unable to start transaction for OGR layer " << dstLayer.ogr().GetName() << ".");
}
OGRLayerType::const_iterator featIt = srcLayer.begin();
for(; featIt!=srcLayer.end(); ++featIt)
{
...
...
@@ -182,10 +189,15 @@ PersistentImageToOGRDataFilter<TImage>
dstLayer.CreateFeature( dstFeature );
}
dstLayer.ogr().CommitTransaction();
err = dstLayer.ogr().CommitTransaction();
if (err != OGRERR_NONE)
{
itkExceptionMacro(<< "Unable to commit transaction for OGR layer " << dstLayer.ogr().GetName() << ".");
}
chrono.Stop();
otbMsgDebugMacro(<< "write ogr tile took " << chrono.GetTotal() << " sec");
}
template<class TImage>
...
...
Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.txx
View file @
31a5e9fd
...
...
@@ -144,16 +144,29 @@ PersistentImageToOGRLayerFilter<TImage>
//Copy features contained in the memory layer (srcLayer) in the output layer
itk::TimeProbe chrono;
chrono.Start();
m_OGRLayer.ogr().StartTransaction();
OGRErr err = m_OGRLayer.ogr().StartTransaction();
if (err != OGRERR_NONE)
{
itkExceptionMacro(<< "Unable to start transaction for OGR layer " << m_OGRLayer.ogr().GetName() << ".");
}
OGRLayerType::const_iterator featIt = srcLayer.begin();
for(; featIt!=srcLayer.end(); ++featIt)
{
OGRFeatureType dstFeature(m_OGRLayer.GetLayerDefn());
dstFeature.SetFrom( *featIt, TRUE );
m_OGRLayer.CreateFeature( dstFeature );
}
{
OGRFeatureType dstFeature(m_OGRLayer.GetLayerDefn());
dstFeature.SetFrom( *featIt, TRUE );
m_OGRLayer.CreateFeature( dstFeature );
}
err = m_OGRLayer.ogr().CommitTransaction();
if (err != OGRERR_NONE)
{
itkExceptionMacro(<< "Unable to commit transaction for OGR layer " << m_OGRLayer.ogr().GetName() << ".");
}
m_OGRLayer.ogr().CommitTransaction();
chrono.Stop();
otbMsgDebugMacro(<< "write ogr tile took " << chrono.GetTotal() << " sec");
...
...
Modules/Segmentation/OGRProcessing/include/otbOGRLayerStreamStitchingFilter.txx
View file @
31a5e9fd
...
...
@@ -127,7 +127,13 @@ OGRLayerStreamStitchingFilter<TInputImage>
for(unsigned int x=1; x<=nbColStream; x++)
{
m_OGRLayer.ogr().StartTransaction();
OGRErr errStart = m_OGRLayer.ogr().StartTransaction();
if (errStart != OGRERR_NONE)
{
itkExceptionMacro(<< "Unable to start transaction for OGR layer " << m_OGRLayer.ogr().GetName() << ".");
}
for(unsigned int y=1; y<=nbRowStream; y++)
{
...
...
@@ -351,14 +357,28 @@ OGRLayerStreamStitchingFilter<TInputImage>
progress.CompletedPixel();
} //end for x
m_OGRLayer.ogr().CommitTransaction();
if(m_OGRLayer.ogr().TestCapability("Transactions"))
{
OGRErr errCommitX = m_OGRLayer.ogr().CommitTransaction();
if (errCommitX != OGRERR_NONE)
{
itkExceptionMacro(<< "Unable to commit transaction for OGR layer " << m_OGRLayer.ogr().GetName() << ".");
}
}
} //end for y
m_OGRLayer.ogr().CommitTransaction();
if(m_OGRLayer.ogr().TestCapability("Transactions"))
{
const OGRErr errCommitY = m_OGRLayer.ogr().CommitTransaction();
if (errCommitY != OGRERR_NONE)
{
itkWarningMacro(<< "Unable to commit transaction for OGR layer " << m_OGRLayer.ogr().GetName() << ". Gdal error code " << errCommitY << "." << std::endl);
}
}
}
template<class TImage>
void
OGRLayerStreamStitchingFilter<TImage>
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment