Commit 8c0c0db2 authored by Cédric Traizet's avatar Cédric Traizet

ENH: removed variable OTB_USE_GDAL_20 as it is now always true

parent 457fc98c
......@@ -97,10 +97,9 @@ 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> >
#ifdef OTB_USE_GDAL_20
, mpl::pair<GIntBig, mpl::int_<OFTInteger64> >
, mpl::pair<std::vector<GIntBig>, mpl::int_<OFTInteger64List> >
#endif
, mpl::pair<GIntBig, mpl::int_<OFTInteger64> >
, mpl::pair<std::vector<GIntBig>, mpl::int_<OFTInteger64List> >
// OFTBinary
// OFTDate
// OFTTime
......@@ -341,10 +340,8 @@ 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
......@@ -360,10 +357,8 @@ 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
......
......@@ -35,15 +35,8 @@
#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"
......@@ -77,13 +70,8 @@ OTBGdalAdapters_EXPORT bool IsOFTInteger64(OGRFieldType type);
* 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
......
......@@ -25,7 +25,6 @@ ENABLE_SHARED
DEPENDS
OTBBoost
OTBITK
#Add dependency to OTBGDAL as GDAL module need to set OTB_USE_GDAL_20 before configuring otbConfigure.h
OTBGDAL
#Add dependency for extended filename helper class
OTBBoostAdapters
......
......@@ -27,8 +27,6 @@
#cmakedefine OTB_BUILD_SHARED_LIBS
#cmakedefine OTB_USE_GDAL_20
#cmakedefine OTB_USE_OPENMP
#cmakedefine OTB_USE_SSE_FLAGS
......@@ -106,14 +106,12 @@ VectorDataKeywordlist
ss << std::setprecision(15) << m_FieldList[i].second.Integer;
return ss.str();
}
#ifdef OTB_USE_GDAL_20
case OFTInteger64:
{
std::ostringstream ss;
ss << std::setprecision(15) << m_FieldList[i].second.Integer64;
return ss.str();
}
#endif
case OFTReal:
{
std::ostringstream ss;
......@@ -183,7 +181,6 @@ VectorDataKeywordlist
{
return (int)(m_FieldList[i].second.Integer);
}
#ifdef OTB_USE_GDAL_20
// Some fields that were OFTInteger with gdal 1.x are now
// exposed as OFTInteger64. So as to make the old code still
// work with the same data, here we downcast to Integer (if
......@@ -197,7 +194,6 @@ VectorDataKeywordlist
return static_cast<int>(m_FieldList[i].second.Integer64);
}
#endif
case OFTReal:
{
return (int)(m_FieldList[i].second.Real);
......@@ -483,13 +479,11 @@ VectorDataKeywordlist
<< field.second.Date.Hour << field.second.Date.Minute << field.second.Date.Second;
break;
}
#ifdef OTB_USE_GDAL_20
case OFTInteger64:
{
output << std::setprecision(15)<<field.second.Integer64;
break;
}
#endif
default:
output << "Type not handled for printing";
break;
......@@ -511,13 +505,11 @@ VectorDataKeywordlist
outField.second.Integer = field.second.Integer;
break;
}
#ifdef OTB_USE_GDAL_20
case OFTInteger64:
{
outField.second.Integer64 = field.second.Integer64;
break;
}
#endif
case OFTReal:
{
outField.second.Real = field.second.Real;
......
......@@ -321,9 +321,6 @@ OGRLayerStreamStitchingFilter<TInputImage>
ogr::Field field = upper.feat[0];
try
{
#ifdef OTB_USE_GDAL_20
// In this case, the feature id can be either
// OFTInteger64 or OFTInteger
switch(field.GetType())
{
case OFTInteger64:
......@@ -336,10 +333,6 @@ OGRLayerStreamStitchingFilter<TInputImage>
fusionFeature[0].SetValue(field.GetValue<int>());
}
}
#else
// Only OFTInteger supported in this case
fusionFeature[0].SetValue(field.GetValue<int>());
#endif
m_OGRLayer.CreateFeature(fusionFeature);
m_OGRLayer.DeleteFeature(lower.feat.GetFID());
m_OGRLayer.DeleteFeature(upper.feat.GetFID());
......
......@@ -95,11 +95,6 @@ if(EXISTS "${TEMP}/gdalVersion.txt")
file(READ "${TEMP}/gdalVersion.txt" _GDAL_VERSION_STRING)
#can't we use GDAL_VERSION_NUM ?
string(SUBSTRING ${_GDAL_VERSION_STRING} 0 2 VER2)
if("${VER2}" STREQUAL "2.")
set(OTB_USE_GDAL_20 true CACHE INTERNAL "True if GDAL >= 2.0.0 has been detected" FORCE )
else()
set(OTB_USE_GDAL_20 false CACHE INTERNAL "True if GDAL >= 2.0.0 has been detected" FORCE )
endif()
set(GDAL_VERSION_STRING "${_GDAL_VERSION_STRING}" CACHE INTERNAL "" FORCE)
else()
error_message( "${TEMP}/gdalVersion.txt does not exist. Cannot continue.")
......
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