Commit 7ea71805 authored by Cédric Traizet's avatar Cédric Traizet

Revert "Merge branch '1769_drop_support_gdal_1' into 'develop'"

This reverts merge request !334
parent 09151663
......@@ -86,7 +86,7 @@ See table \ref{tab:otb-dependencies} for the full list of dependencies.
\hline
\textbf{ITK} & \url{http://www.itk.org} & yes & 4.6.0 \\
\hline
\textbf{GDAL} & \url{http://www.gdal.org} & yes & 2.0 \\
\textbf{GDAL} & \url{http://www.gdal.org} & yes & 1.10 (2.x also supported) \\
\hline
\textbf{OSSIM} & \url{http://www.ossim.org} & yes & 1.8.20-3 \\
\hline
......
......@@ -45,6 +45,7 @@
#include "itkObjectFactory.h" // that should have been included by itkMacro.h
#include "otbOGRLayerWrapper.h"
#include "otbOGRVersionProxy.h"
#include "otbOGRExtendedFilenameToOptions.h"
class OGRLayer;
......@@ -163,7 +164,7 @@ public:
* \note No condition is assumed on the non-nullity of \c source.
* \see \c DataSource(GDALDataset *)
*/
static Pointer New(GDALDataset * sourcemode, Modes::type mode = Modes::Read , const std::vector< std::string > & layerOptions = std::vector< std::string >() );
static Pointer New(ogr::version_proxy::GDALDatasetType * sourcemode, Modes::type mode = Modes::Read , const std::vector< std::string > & layerOptions = std::vector< std::string >() );
//@}
/**\name Projection Reference property */
......@@ -300,7 +301,7 @@ public:
* \throw None
* \post Assumes ownership of the \c source.
*/
void Reset(GDALDataset * source);
void Reset(ogr::version_proxy::GDALDatasetType * source);
/**\name Layers modification */
//@{
......@@ -476,6 +477,8 @@ public:
}
/** Flushes all changes to disk.
* \throw itd::ExceptionObject in case the flush operation failed.
* \sa \c GDALDataset::SyncToDisk()
*/
void SyncToDisk();
......@@ -494,7 +497,7 @@ public:
* \warning You must under no circumstance try to delete the \c GDALDataset
* obtained this way.
*/
GDALDataset & ogr();
ogr::version_proxy::GDALDatasetType & ogr();
void SetLayerCreationOptions( const std::vector< std::string > & options );
void AddLayerCreationOptions( std::vector< std::string > options );
......@@ -514,7 +517,7 @@ protected:
/** Init constructor.
* \post The newly constructed object owns the \c source parameter.
*/
DataSource(GDALDataset * source, Modes::type mode , const std::vector< std::string > & layerOption = std::vector< std::string >() );
DataSource(ogr::version_proxy::GDALDatasetType * source, Modes::type mode , const std::vector< std::string > & layerOption = std::vector< std::string >() );
/** Destructor.
* \post The \c GDALDataset owned is released (if not null).
*/
......@@ -551,7 +554,7 @@ private:
std::string GetDatasetDescription() const;
private:
GDALDataset *m_DataSource;
ogr::version_proxy::GDALDatasetType *m_DataSource;
std::vector< std::string > m_LayerOptions;
Modes::type m_OpenMode;
int m_FirstModifiableLayerID;
......
......@@ -43,7 +43,7 @@
// to the compilation mode of the client code.
inline
GDALDataset & otb::ogr::DataSource::ogr()
otb::ogr::version_proxy::GDALDatasetType & otb::ogr::DataSource::ogr()
{
assert(m_DataSource && "GDALDataset not initialized");
return *m_DataSource;
......
......@@ -97,9 +97,10 @@ typedef mpl::map
, mpl::pair<char* , mpl::int_<OFTString> >
, mpl::pair<char const* , mpl::int_<OFTString> >
, mpl::pair<std::vector<std::string>, mpl::int_<OFTStringList> >
, mpl::pair<GIntBig, mpl::int_<OFTInteger64> >
, mpl::pair<std::vector<GIntBig>, mpl::int_<OFTInteger64List> >
#ifdef OTB_USE_GDAL_20
, mpl::pair<GIntBig, mpl::int_<OFTInteger64> >
, mpl::pair<std::vector<GIntBig>, mpl::int_<OFTInteger64List> >
#endif
// OFTBinary
// OFTDate
// OFTTime
......@@ -340,8 +341,10 @@ typedef mpl::map
, mpl::pair<mpl::int_<OFTRealList>, MemberContainerGetterPtr<double, &OGRFeature::GetFieldAsDoubleList> >
, mpl::pair<mpl::int_<OFTString>, MemberGetterPtr<char const*, &OGRFeature::GetFieldAsString, std::string> >
, mpl::pair<mpl::int_<OFTStringList>, StringListMemberGetterPtr<std::vector<std::string> > >
#ifdef OTB_USE_GDAL_20
, mpl::pair<mpl::int_<OFTInteger64>, MemberGetterPtr<GIntBig, &OGRFeature::GetFieldAsInteger64> >
, mpl::pair<mpl::int_<OFTInteger64List>, MemberContainerGetterPtr<GIntBig, &OGRFeature::GetFieldAsInteger64List> >
#endif
> FieldGetters_Map;
/**\ingroup GeometryInternals
......@@ -357,8 +360,10 @@ typedef mpl::map
, mpl::pair<mpl::int_<OFTRealList>, MemberContainerSetterPtr<double, &OGRFeature::SetField> >
, mpl::pair<mpl::int_<OFTString>, MemberSetterPtr<char const*, &OGRFeature::SetField/*, std::string*/> >
, mpl::pair<mpl::int_<OFTStringList>, StringListMemberSetterPtr<std::vector<std::string> > >
#ifdef OTB_USE_GDAL_20
, mpl::pair<mpl::int_<OFTInteger64>, MemberSetterPtr<GIntBig, &OGRFeature::SetField> >
, mpl::pair<mpl::int_<OFTInteger64List>, MemberContainerSetterPtr<const GIntBig, &OGRFeature::SetField> >
#endif
> FieldSetters_Map;
/**\ingroup GeometryInternals
......
......@@ -27,7 +27,6 @@
#include <cassert>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include "ogr_feature.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
......@@ -44,8 +43,6 @@
#include "OTBGdalAdaptersExport.h"
class GDALDataset;
namespace otb
{
namespace ogr
......@@ -108,35 +105,6 @@ private:
std::vector<char const*> m_raw;
};
/**
* Return the list of available drivers.
*
* \return A vector of string containing the list of available drivers.
*/
OTBGdalAdapters_EXPORT
std::vector<std::string> GetAvailableDriversAsStringVector();
/**
* Return the list of files composing the dataset.
*
* \param dataset Pointer to the dataset to get the file list from. Will not be
* checked for null pointer.
*
* \return A vector of string containing the list of files.
*/
OTBGdalAdapters_EXPORT
std::vector<std::string> GetFileListAsStringVector(GDALDataset * dataset);
/**
* Returns true if the field 'index' is set and not-null in the given feature
*
* Before gdal 2.2, it calls OGRFeature::IsFieldSet().
* After gdal 2.2, it calls OGRFeature::IsFieldSetAndNotNull()
*/
OTBGdalAdapters_EXPORT
bool IsFieldSetAndNotNull(OGRFeature *feat, int index);
} // ogr namespace
} // end namespace otb
......
......@@ -36,6 +36,7 @@
#endif
// #include "itkIndent.h", included from field
#include "otbOGRFeatureWrapper.h"
#include "otbOGRVersionProxy.h"
#include <string>
// #include "ogr_core.h" // OGRwkbGeometryType, included from feature -> field
......@@ -118,7 +119,7 @@ public:
* OGRDataSource::ExecuteSQL(). It's actually the constructor called by \c
* DataSource::ExecuteSQL().
*/
Layer(OGRLayer* layer, GDALDataset& sourceInChargeOfLifeTime, bool modifiable);
Layer(OGRLayer* layer, otb::ogr::version_proxy::GDALDatasetType& sourceInChargeOfLifeTime, bool modifiable);
//@}
/**\name Features collection */
......
/*
* Copyright (C) 2005-2017 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 otbOGRVersionProxy_h
#define otbOGRVersionProxy_h
#include <string>
#include <vector>
#include "otbConfigure.h"
#include "itkMacro.h"
#if defined(_MSC_VER)
#pragma warning ( push )
#pragma warning ( disable: 4251 )
#include "ogr_core.h" // OGR enums
#pragma warning ( pop )
#else
#include "ogr_core.h" // OGR enums
#endif
#ifdef OTB_USE_GDAL_20
class GDALDataset;
class GDALDriver;
#else
class OGRDataSource;
class OGRSFDriver;
#endif
class OGRFeature;
#include "OTBGdalAdaptersExport.h"
namespace otb
{
namespace ogr
{
namespace version_proxy
{
/**
* With Gdal >= 2.0, this function will test equality between type and
* OFTInteger64 enum. Otherwise, it returns false.
*/
OTBGdalAdapters_EXPORT bool IsOFTInteger64(OGRFieldType type);
/**
* This namespace holds proxy functions hiding interface changes in gdal 2.0
*
* This namespace holds proxy functions hiding interface changes in OGR
* dataset between gdal 1.x (x>10) and gdal 2.x. It defines a common
* interface that should be used in place of calling directly the
* wrapped gdal functions.
*
* Whenever GDALDataset and GDALDriver have to be used to open a
* vector dataset (or OGRDataSource an OGRSFDriver for gdal 1.x), one
* should use ogr::version_proxy types GDALDatasetType and
* GDALDriverType.
*
* See function documentation for details.
*/
#ifdef OTB_USE_GDAL_20
typedef GDALDataset GDALDatasetType;
typedef GDALDriver GDALDriverType;
#else
typedef OGRDataSource GDALDatasetType;
typedef OGRSFDriver GDALDriverType;
#endif
/**
* This function opens a file, possibly in read-only mode, and returns
* a dataset.
*
* Calls OGRSFDriverRegistrar::Open for gdal 1.x implementation and GDALopenEx for
* gdal 2.x implementation.
* \param filename Filename of the file to open
* \param readOnly: If true, dataset is open in read-only mode.
* \return NULL if file could not be open.
*/
OTBGdalAdapters_EXPORT
GDALDatasetType * Open(const char * filename, bool readOnly = true , std::vector< std::string > const & options = std::vector< std::string >() );
/**
* This function closes a dataset.
*
* Calls OGRDataSource::DestroyDataSource for gdal 1.x
* implementation and GDALClose for gdal 2.x implementation.
*
* \param dataset Pointer to the dataset to close. Will not be
* checked for null pointer.
*/
OTBGdalAdapters_EXPORT
void Close(GDALDatasetType * dataset);
/**
* This function creates a new dataset.
*
* Calls OGRSFDriver::CreateDataSource for gdal 1.x implementation
* and GDALDriver::Create with (0,0) raster size for gdal 2.x
* implementation
*
* \param driver Pointer to the driver used for creation. Will not
* be checked for null pointer.
*
* \param name Name of the dataset to create.
*
* \return NULL if dataset could not be created.
*/
OTBGdalAdapters_EXPORT
GDALDatasetType * Create(GDALDriverType * driver, const char * name , std::vector< std::string > const & options = std::vector< std::string >() );
/**
* This function physically deletes an existing dataset.
*
* Calls OGRDataSource::DeleteDataSource for gdal 1.x implementation
* and GDALDriver::Delete for gdal 2.x implementation.
*
* \param name Name of the dataset to destroy.
*/
OTBGdalAdapters_EXPORT
bool Delete(const char * name);
/**
* This function returns a pointer to the driver from its name.
*
* Calls OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName() for
* gdal 1.x implementation and
* GetGDALDriverManager()->GetDriverByName() for gdal 2.x
* implementation.
*
* \param name Name of the driver to retrieve
*
* \return NULL if no driver could be retrieved.
*/
OTBGdalAdapters_EXPORT
GDALDriverType * GetDriverByName(const char * name);
OTBGdalAdapters_EXPORT
std::string GetDriverNameFromDataSource(const GDALDatasetType * ds);
/**
* Sync dataset to disk.
*
* Calls OGRDataSource::SyncToDisk() for gdal 1.x implementation and
* GDALDataset::FlushCache() for gdal 2.x implementation.
*
* \param dataset Pointer to the dataset to sync. Will not be
* checked for null pointer.
*
* \return True if sync went on without any error.
*/
OTBGdalAdapters_EXPORT
bool SyncToDisk(GDALDatasetType * dataset);
/**
* \return The name of the dataset class behind the implementation
* (OGRDataSource for gdal 1.x and GdalDataset for gdal 2.x)
*/
OTBGdalAdapters_EXPORT
std::string GetDatasetClassName();
/**
* \return The name of the driver class behind the implementation
* (OGRSFDriver for gdal 1.x and GDALDriver for gdal 2.x)
*/
OTBGdalAdapters_EXPORT
std::string GetDriverClassName();
/**
* Return the list of files composing the dataset.
*
* Calls OGRDataSource::GetName() and wrap in string vector for gdal
* 1.x implementation, and GDALDataset::GetFileList and wrap in
* string vector for gdal 2.x implementation.
*
* \param dataset Pointer to the dataset to get the file list from. Will not be
* checked for null pointer.
*
* \return A vector of string containing the list of files.
*/
OTBGdalAdapters_EXPORT
std::vector<std::string> GetFileListAsStringVector(GDALDatasetType * dataset);
/**
* Return the list of available drivers.
*
* Calls OGRSFDriverRegistrar::GetRegistrar() for gdal 1.x
* implementation and GetGDALDriverManager() for gdal 2.x
* implementation.
*
* \return A vector of string containing the list of available drivers.
*/
OTBGdalAdapters_EXPORT
std::vector<std::string> GetAvailableDriversAsStringVector();
/**
* Returns true if the field 'index' is set and not-null in the given feature
*
* Before gdal 2.2, it calls OGRFeature::IsFieldSet().
* After gdal 2.2, it calls OGRFeature::IsFieldSetAndNotNull()
*/
OTBGdalAdapters_EXPORT
bool IsFieldSetAndNotNull(OGRFeature *feat, int index);
}
}
} // end namespace otb
#endif
......@@ -28,8 +28,8 @@ set(OTBGdalAdapters_SRC
otbOGRDriversInit.cxx
otbGeometriesToGeometriesFilter.cxx
otbOGRDataSourceWrapper.cxx
otbOGRVersionProxy.cxx
otbOGRExtendedFilenameToOptions.cxx
otbOGRHelpers.cxx
)
add_library(OTBGdalAdapters ${OTBGdalAdapters_SRC})
......
......@@ -48,13 +48,13 @@ bool otb::ogr::DataSource::Clear()
return true;
}
void otb::ogr::DataSource::Reset(GDALDataset * source)
void otb::ogr::DataSource::Reset(otb::ogr::version_proxy::GDALDatasetType * source)
{
if (m_DataSource) {
// OGR makes a pointless check for non-nullity in
// GDALDataset::DestroyDataSource (pointless because "delete 0" is
// perfectly valid -> it's a no-op)
GDALClose(m_DataSource); // void, noexcept
ogr::version_proxy::Close(m_DataSource); // void, noexcept
}
m_DataSource = source;
}
......@@ -108,7 +108,7 @@ char const* DeduceDriverName(std::string filename)
ExtensionDriverAssociation const* whichIt =
std::find_if(
boost::begin(k_ExtensionDriverMap), boost::end(k_ExtensionDriverMap),
[&](auto const & x) { return x.Matches(extension); } );
boost::bind(&ExtensionDriverAssociation::Matches, _1, extension));
if (whichIt == boost::end(k_ExtensionDriverMap))
{
return nullptr; // nothing found
......@@ -126,16 +126,10 @@ otb::ogr::DataSource::DataSource()
{
Drivers::Init();
GDALDriver * d =
GetGDALDriverManager()->GetDriverByName("Memory");
ogr::version_proxy::GDALDriverType * d =
ogr::version_proxy::GetDriverByName("Memory");
assert(d && "OGR Memory driver not found");
m_DataSource = d->Create( "in-memory" ,
0 ,
0 ,
0 ,
GDT_Unknown ,
0 );
m_DataSource = ogr::version_proxy::Create(d,"in-memory");
if (!m_DataSource) {
itkExceptionMacro(<< "Failed to create OGRMemDataSource: "
<< CPLGetLastErrorMsg());
......@@ -143,7 +137,7 @@ otb::ogr::DataSource::DataSource()
}
otb::ogr::DataSource::DataSource(
GDALDataset * source ,
otb::ogr::version_proxy::GDALDatasetType * source ,
Modes::type mode ,
const std::vector< std::string > & options /*NULL*/ )
: m_DataSource(source) ,
......@@ -161,12 +155,10 @@ otb::ogr::DataSource::Pointer otb::ogr::DataSource::OpenDataSource(std::string c
std::string simpleFileName = fileNameHelper->GetSimpleFileName();
bool update = (mode != Modes::Read);
GDALDataset * source = (GDALDataset *)GDALOpenEx(
simpleFileName.c_str(),
(update? GDAL_OF_UPDATE: GDAL_OF_READONLY) | GDAL_OF_VECTOR,
NULL,
otb::ogr::StringListConverter( fileNameHelper->GetGDALOpenOptions() ).to_ogr(),
NULL);
ogr::version_proxy::GDALDatasetType * source =
ogr::version_proxy::Open( simpleFileName.c_str() ,
!update ,
fileNameHelper->GetGDALOpenOptions() );
if (!source)
{
// In read mode, this is a failure
......@@ -186,8 +178,8 @@ otb::ogr::DataSource::Pointer otb::ogr::DataSource::OpenDataSource(std::string c
<<simpleFileName<<">.");
}
GDALDriver * d =
GetGDALDriverManager()->GetDriverByName( driverName );
ogr::version_proxy::GDALDriverType * d =
ogr::version_proxy::GetDriverByName( driverName );
if(!d)
{
......@@ -195,13 +187,10 @@ otb::ogr::DataSource::Pointer otb::ogr::DataSource::OpenDataSource(std::string c
<< ", check your OGR configuration for available drivers." );
}
source = d->Create( simpleFileName.c_str() ,
0 ,
0 ,
0 ,
GDT_Unknown ,
otb::ogr::StringListConverter(
fileNameHelper->GetGDALCreationOptions() ).to_ogr() );
source = ogr::version_proxy::Create(
d ,
simpleFileName.c_str() ,
fileNameHelper->GetGDALCreationOptions() );
if (!source) {
itkGenericExceptionMacro(<< "Failed to create GDALDataset <"
<< simpleFileName << "> (driver name: <" << driverName
......@@ -218,41 +207,12 @@ void DeleteDataSource(std::string const& datasourceName)
fileNameHelper->SetExtendedFileName( datasourceName.c_str() );
std::string simpleFileName = fileNameHelper->GetSimpleFileName();
// Open dataset
GDALDataset * poDS = (GDALDataset *)GDALOpenEx(
simpleFileName.c_str(),
GDAL_OF_UPDATE | GDAL_OF_VECTOR,
NULL,
NULL,
NULL);
GDALDriver * poDriver = NULL;
bool success =1;
if(poDS)
{
poDriver = poDS->GetDriver();
GDALClose(poDS);
}
else
{
itkGenericExceptionMacro(<< "Cannot open data source " << simpleFileName
<< ": " << CPLGetLastErrorMsg());
}
if(poDriver)
bool ret = otb::ogr::version_proxy::Delete(simpleFileName.c_str());
if (!ret)
{
OGRErr ret = poDriver->Delete(simpleFileName.c_str());
if (ret != OGRERR_NONE)
{
itkGenericExceptionMacro(<< "Deletion of data source " << simpleFileName
itkGenericExceptionMacro(<< "Deletion of data source " << simpleFileName
<< " failed: " << CPLGetLastErrorMsg());
}
}
else
{
itkGenericExceptionMacro(<< "Cannot get driver associated with data source " << simpleFileName
<< ": " << CPLGetLastErrorMsg());
}
}
otb::ogr::DataSource::Pointer
......@@ -268,15 +228,12 @@ otb::ogr::DataSource::New(std::string const& datasourceName, Modes::type mode)
}
Drivers::Init();
GDALDataset * ds = (GDALDataset *)GDALOpenEx(
simpleFileName.c_str(),
GDAL_OF_READONLY | GDAL_OF_VECTOR,
NULL,
NULL,
NULL);
ogr::version_proxy::GDALDatasetType * ds =
ogr::version_proxy::Open( simpleFileName.c_str() , true );
bool ds_exists = (ds!=nullptr);
GDALClose(ds);
ogr::version_proxy::Close(ds);
if (ds_exists && mode == Modes::Overwrite)
......@@ -289,7 +246,7 @@ otb::ogr::DataSource::New(std::string const& datasourceName, Modes::type mode)
/*static*/
otb::ogr::DataSource::Pointer
otb::ogr::DataSource::New(GDALDataset * source , Modes::type mode , const std::vector< std::string > & layerOptions )
otb::ogr::DataSource::New(otb::ogr::version_proxy::GDALDatasetType * source , Modes::type mode , const std::vector< std::string > & layerOptions )
{
Pointer res = new DataSource( source , mode , layerOptions );
res->UnRegister();
......@@ -770,7 +727,12 @@ OGREnvelope otb::ogr::DataSource::GetGlobalExtent(bool force/* = false */, std::
cExtent.MaxX = real_maxx;
cExtent.MaxY = real_maxy;
#if GDAL_VERSION_NUM >= 1700
OGRCoordinateTransformation::DestroyCT(coordTransformation);
#else
#warning the following resource release may crash, please update your version of GDAL
delete coordTransformation; // note there is no garanty
#endif
}
// else: If srs are invalid, we assume that extent are coherent
......@@ -823,14 +785,20 @@ bool otb::ogr::DataSource::HasCapability(std::string const& capabilityName) cons
void otb::ogr::DataSource::SyncToDisk()
{
assert(m_DataSource && "Datasource not initialized");
m_DataSource->FlushCache();
bool ret = otb::ogr::version_proxy::SyncToDisk(m_DataSource);
if(!ret)
{
itkExceptionMacro( << "Cannot flush the pending of the OGRDataSource <"
<< GetDatasetDescription() << ">: " << CPLGetLastErrorMsg());
}
}
std::string otb::ogr::DataSource::GetDatasetDescription() const
{
std::vector<std::string> files =
otb::ogr::GetFileListAsStringVector( m_DataSource );
otb::ogr::version_proxy::GetFileListAsStringVector( m_DataSource );
std::string description = "";
for( std::vector<std::string>::const_iterator it = files.begin() ;
it!=files.end() ; ++it )
......
......@@ -43,7 +43,7 @@
otb::ogr::Feature::Feature(OGRFeatureDefn & definition)
: m_Feature(
OGRFeature::CreateFeature(&definition),
[&](auto const & x) {return OGRFeature::DestroyFeature(x);})
boost::bind(&OGRFeature::DestroyFeature, _1))
{
CheckInvariants();
}
......@@ -52,7 +52,7 @@ otb::ogr::Feature::Feature(OGRFeature * feature)
{
if (feature)
{
m_Feature.reset(feature, [&](auto const & x) {return OGRFeature::DestroyFeature(x);});
m_Feature.reset(feature, boost::bind(&OGRFeature::DestroyFeature, _1));
}
// else default is perfect -> delete null
}
......@@ -78,11 +78,16 @@ void otb::ogr::Feature::UncheckedSetFrom(Feature const& rhs, bool mustForgive)
void otb::ogr::Feature::UncheckedSetFrom(Feature const& rhs, int * map, bool mustForgive)
{
#if GDAL_VERSION_NUM >= 1900
const OGRErr res = m_Feature->SetFrom(&rhs.ogr(), map, mustForgive);
if (res != OGRERR_NONE)
{
itkGenericExceptionMacro(<<"Cannot assign from another feature: " << CPLGetLastErrorMsg());
}
#else
itkGenericExceptionMacro("OGRLayer::SetFrom(feature, fieldmap, forgive) is not supported by OGR v"
<< GDAL_VERSION_NUM << ". Upgrade to a version >= 1.9.0, and recompile OTB.")
#endif
}
/*===========================================================================*/
......
......@@ -37,6 +37,7 @@
#endif
#include "otbOGRFeatureWrapper.h"
#include "otbJoinContainer.h"
#include "otbOGRVersionProxy.h"
#include <boost/array.hpp>
/*===========================================================================*/
/*===========================[ Static Assertions ]===========================*/
......@@ -166,7 +167,7 @@ std::ostream & otb::ogr::Field::UncheckedPrintSelf(
bool otb::ogr::Field::UncheckedHasBeenSet() const
{
return otb::ogr::IsFieldSetAndNotNull(m_Feature.get(), m_index);
return otb::ogr::version_proxy::IsFieldSetAndNotNull(m_Feature.get(), m_index);
}
void otb::ogr::Field::UncheckedUnset() const
......
......@@ -25,6 +25,10 @@
#include "otbOGRGeometryWrapper.h"
#include "ogr_geometry.h"
#if GDAL_VERSION_NUM < 1900
# include "itkMacro.h"
#endif
#ifdef _MSC_VER
// warning conversion int -> bool