Commit 0c8eab2c authored by Julien Michel's avatar Julien Michel

BUG: Properly handle Integer64 fields in OGRFieldWrapper and OGRLayerStreamStitchingFilter

parent 940ed00f
......@@ -23,6 +23,7 @@
/*===============================[ Includes ]================================*/
/*===========================================================================*/
#include "otbOGRFieldWrapper.h"
#include "otbConfigure.h"
#include <cassert>
#include <vector>
#include <boost/mpl/map.hpp>
......@@ -84,6 +85,10 @@ typedef boost::mpl::map
, pair<char* , int_<OFTString> >
, pair<char const* , int_<OFTString> >
, pair<std::vector<std::string>, int_<OFTStringList> >
#ifdef OTB_USE_GDAL_20
, pair<GIntBig, int_<OFTInteger64> >
, pair<std::vector<GIntBig>, int_<OFTInteger64List> >
#endif
// OFTBinary
// OFTDate
// OFTTime
......@@ -312,6 +317,10 @@ typedef map
, pair<int_<OFTRealList>, MemberContainerGetterPtr<double, &OGRFeature::GetFieldAsDoubleList> >
, pair<int_<OFTString>, MemberGetterPtr<char const*, &OGRFeature::GetFieldAsString, std::string> >
, pair<int_<OFTStringList>, StringListMemberGetterPtr<std::vector<std::string> > >
#ifdef OTB_USE_GDAL_20
, pair<int_<OFTInteger64>, MemberGetterPtr<GIntBig, &OGRFeature::GetFieldAsInteger64> >
, pair<int_<OFTInteger64List>, MemberContainerGetterPtr<GIntBig, &OGRFeature::GetFieldAsInteger64List> >
#endif
> FieldGetters_Map;
/**\ingroup GeometryInternals
......@@ -327,6 +336,10 @@ typedef map
, pair<int_<OFTRealList>, MemberContainerSetterPtr<double, &OGRFeature::SetField> >
, pair<int_<OFTString>, MemberSetterPtr<char const*, &OGRFeature::SetField/*, std::string*/> >
, pair<int_<OFTStringList>, StringListMemberSetterPtr<std::vector<std::string> > >
#ifdef OTB_USE_GDAL_20
, pair<int_<OFTInteger64>, MemberSetterPtr<GIntBig, &OGRFeature::SetField> >
, pair<int_<OFTInteger64List>, MemberContainerSetterPtr<const GIntBig, &OGRFeature::SetField> >
#endif
> FieldSetters_Map;
/**\ingroup GeometryInternals
......
......@@ -317,7 +317,11 @@ OGRLayerStreamStitchingFilter<TInputImage>
ogr::Field field = upper.feat[0];
try
{
#ifdef OTB_USE_GDAL_20
fusionFeature[0].SetValue(field.GetValue<GIntBig>());
#else
fusionFeature[0].SetValue(field.GetValue<int>());
#endif
m_OGRLayer.CreateFeature(fusionFeature);
m_OGRLayer.DeleteFeature(lower.feat.GetFID());
m_OGRLayer.DeleteFeature(upper.feat.GetFID());
......
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