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 ...@@ -97,10 +97,9 @@ typedef mpl::map
, mpl::pair<char* , mpl::int_<OFTString> > , mpl::pair<char* , mpl::int_<OFTString> >
, mpl::pair<char const* , mpl::int_<OFTString> > , mpl::pair<char const* , mpl::int_<OFTString> >
, mpl::pair<std::vector<std::string>, mpl::int_<OFTStringList> > , mpl::pair<std::vector<std::string>, mpl::int_<OFTStringList> >
#ifdef OTB_USE_GDAL_20 , mpl::pair<GIntBig, mpl::int_<OFTInteger64> >
, mpl::pair<GIntBig, mpl::int_<OFTInteger64> > , mpl::pair<std::vector<GIntBig>, mpl::int_<OFTInteger64List> >
, mpl::pair<std::vector<GIntBig>, mpl::int_<OFTInteger64List> >
#endif
// OFTBinary // OFTBinary
// OFTDate // OFTDate
// OFTTime // OFTTime
...@@ -341,10 +340,8 @@ typedef mpl::map ...@@ -341,10 +340,8 @@ typedef mpl::map
, mpl::pair<mpl::int_<OFTRealList>, MemberContainerGetterPtr<double, &OGRFeature::GetFieldAsDoubleList> > , 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_<OFTString>, MemberGetterPtr<char const*, &OGRFeature::GetFieldAsString, std::string> >
, mpl::pair<mpl::int_<OFTStringList>, StringListMemberGetterPtr<std::vector<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_<OFTInteger64>, MemberGetterPtr<GIntBig, &OGRFeature::GetFieldAsInteger64> >
, mpl::pair<mpl::int_<OFTInteger64List>, MemberContainerGetterPtr<GIntBig, &OGRFeature::GetFieldAsInteger64List> > , mpl::pair<mpl::int_<OFTInteger64List>, MemberContainerGetterPtr<GIntBig, &OGRFeature::GetFieldAsInteger64List> >
#endif
> FieldGetters_Map; > FieldGetters_Map;
/**\ingroup GeometryInternals /**\ingroup GeometryInternals
...@@ -360,10 +357,8 @@ typedef mpl::map ...@@ -360,10 +357,8 @@ typedef mpl::map
, mpl::pair<mpl::int_<OFTRealList>, MemberContainerSetterPtr<double, &OGRFeature::SetField> > , 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_<OFTString>, MemberSetterPtr<char const*, &OGRFeature::SetField/*, std::string*/> >
, mpl::pair<mpl::int_<OFTStringList>, StringListMemberSetterPtr<std::vector<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_<OFTInteger64>, MemberSetterPtr<GIntBig, &OGRFeature::SetField> >
, mpl::pair<mpl::int_<OFTInteger64List>, MemberContainerSetterPtr<const GIntBig, &OGRFeature::SetField> > , mpl::pair<mpl::int_<OFTInteger64List>, MemberContainerSetterPtr<const GIntBig, &OGRFeature::SetField> >
#endif
> FieldSetters_Map; > FieldSetters_Map;
/**\ingroup GeometryInternals /**\ingroup GeometryInternals
......
...@@ -35,15 +35,8 @@ ...@@ -35,15 +35,8 @@
#include "ogr_core.h" // OGR enums #include "ogr_core.h" // OGR enums
#endif #endif
#ifdef OTB_USE_GDAL_20
class GDALDataset; class GDALDataset;
class GDALDriver; class GDALDriver;
#else
class OGRDataSource;
class OGRSFDriver;
#endif
class OGRFeature; class OGRFeature;
#include "OTBGdalAdaptersExport.h" #include "OTBGdalAdaptersExport.h"
...@@ -77,13 +70,8 @@ OTBGdalAdapters_EXPORT bool IsOFTInteger64(OGRFieldType type); ...@@ -77,13 +70,8 @@ OTBGdalAdapters_EXPORT bool IsOFTInteger64(OGRFieldType type);
* See function documentation for details. * See function documentation for details.
*/ */
#ifdef OTB_USE_GDAL_20
typedef GDALDataset GDALDatasetType; typedef GDALDataset GDALDatasetType;
typedef GDALDriver GDALDriverType; typedef GDALDriver GDALDriverType;
#else
typedef OGRDataSource GDALDatasetType;
typedef OGRSFDriver GDALDriverType;
#endif
/** /**
* This function opens a file, possibly in read-only mode, and returns * This function opens a file, possibly in read-only mode, and returns
......
...@@ -25,7 +25,6 @@ ENABLE_SHARED ...@@ -25,7 +25,6 @@ ENABLE_SHARED
DEPENDS DEPENDS
OTBBoost OTBBoost
OTBITK OTBITK
#Add dependency to OTBGDAL as GDAL module need to set OTB_USE_GDAL_20 before configuring otbConfigure.h
OTBGDAL OTBGDAL
#Add dependency for extended filename helper class #Add dependency for extended filename helper class
OTBBoostAdapters OTBBoostAdapters
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
#cmakedefine OTB_BUILD_SHARED_LIBS #cmakedefine OTB_BUILD_SHARED_LIBS
#cmakedefine OTB_USE_GDAL_20
#cmakedefine OTB_USE_OPENMP #cmakedefine OTB_USE_OPENMP
#cmakedefine OTB_USE_SSE_FLAGS #cmakedefine OTB_USE_SSE_FLAGS
...@@ -106,14 +106,12 @@ VectorDataKeywordlist ...@@ -106,14 +106,12 @@ VectorDataKeywordlist
ss << std::setprecision(15) << m_FieldList[i].second.Integer; ss << std::setprecision(15) << m_FieldList[i].second.Integer;
return ss.str(); return ss.str();
} }
#ifdef OTB_USE_GDAL_20
case OFTInteger64: case OFTInteger64:
{ {
std::ostringstream ss; std::ostringstream ss;
ss << std::setprecision(15) << m_FieldList[i].second.Integer64; ss << std::setprecision(15) << m_FieldList[i].second.Integer64;
return ss.str(); return ss.str();
} }
#endif
case OFTReal: case OFTReal:
{ {
std::ostringstream ss; std::ostringstream ss;
...@@ -183,7 +181,6 @@ VectorDataKeywordlist ...@@ -183,7 +181,6 @@ VectorDataKeywordlist
{ {
return (int)(m_FieldList[i].second.Integer); return (int)(m_FieldList[i].second.Integer);
} }
#ifdef OTB_USE_GDAL_20
// Some fields that were OFTInteger with gdal 1.x are now // Some fields that were OFTInteger with gdal 1.x are now
// exposed as OFTInteger64. So as to make the old code still // exposed as OFTInteger64. So as to make the old code still
// work with the same data, here we downcast to Integer (if // work with the same data, here we downcast to Integer (if
...@@ -197,7 +194,6 @@ VectorDataKeywordlist ...@@ -197,7 +194,6 @@ VectorDataKeywordlist
return static_cast<int>(m_FieldList[i].second.Integer64); return static_cast<int>(m_FieldList[i].second.Integer64);
} }
#endif
case OFTReal: case OFTReal:
{ {
return (int)(m_FieldList[i].second.Real); return (int)(m_FieldList[i].second.Real);
...@@ -483,13 +479,11 @@ VectorDataKeywordlist ...@@ -483,13 +479,11 @@ VectorDataKeywordlist
<< field.second.Date.Hour << field.second.Date.Minute << field.second.Date.Second; << field.second.Date.Hour << field.second.Date.Minute << field.second.Date.Second;
break; break;
} }
#ifdef OTB_USE_GDAL_20
case OFTInteger64: case OFTInteger64:
{ {
output << std::setprecision(15)<<field.second.Integer64; output << std::setprecision(15)<<field.second.Integer64;
break; break;
} }
#endif
default: default:
output << "Type not handled for printing"; output << "Type not handled for printing";
break; break;
...@@ -511,13 +505,11 @@ VectorDataKeywordlist ...@@ -511,13 +505,11 @@ VectorDataKeywordlist
outField.second.Integer = field.second.Integer; outField.second.Integer = field.second.Integer;
break; break;
} }
#ifdef OTB_USE_GDAL_20
case OFTInteger64: case OFTInteger64:
{ {
outField.second.Integer64 = field.second.Integer64; outField.second.Integer64 = field.second.Integer64;
break; break;
} }
#endif
case OFTReal: case OFTReal:
{ {
outField.second.Real = field.second.Real; outField.second.Real = field.second.Real;
......
...@@ -321,9 +321,6 @@ OGRLayerStreamStitchingFilter<TInputImage> ...@@ -321,9 +321,6 @@ OGRLayerStreamStitchingFilter<TInputImage>
ogr::Field field = upper.feat[0]; ogr::Field field = upper.feat[0];
try try
{ {
#ifdef OTB_USE_GDAL_20
// In this case, the feature id can be either
// OFTInteger64 or OFTInteger
switch(field.GetType()) switch(field.GetType())
{ {
case OFTInteger64: case OFTInteger64:
...@@ -336,10 +333,6 @@ OGRLayerStreamStitchingFilter<TInputImage> ...@@ -336,10 +333,6 @@ OGRLayerStreamStitchingFilter<TInputImage>
fusionFeature[0].SetValue(field.GetValue<int>()); 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.CreateFeature(fusionFeature);
m_OGRLayer.DeleteFeature(lower.feat.GetFID()); m_OGRLayer.DeleteFeature(lower.feat.GetFID());
m_OGRLayer.DeleteFeature(upper.feat.GetFID()); m_OGRLayer.DeleteFeature(upper.feat.GetFID());
......
...@@ -95,11 +95,6 @@ if(EXISTS "${TEMP}/gdalVersion.txt") ...@@ -95,11 +95,6 @@ if(EXISTS "${TEMP}/gdalVersion.txt")
file(READ "${TEMP}/gdalVersion.txt" _GDAL_VERSION_STRING) file(READ "${TEMP}/gdalVersion.txt" _GDAL_VERSION_STRING)
#can't we use GDAL_VERSION_NUM ? #can't we use GDAL_VERSION_NUM ?
string(SUBSTRING ${_GDAL_VERSION_STRING} 0 2 VER2) 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) set(GDAL_VERSION_STRING "${_GDAL_VERSION_STRING}" CACHE INTERNAL "" FORCE)
else() else()
error_message( "${TEMP}/gdalVersion.txt does not exist. Cannot continue.") 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