23 #include "ogr_feature.h"
26 #include <boost/array.hpp>
30 namespace otb {
namespace ogr {
33 MemberGetterPtr<int, &OGRFeature::GetFieldAsInteger>,
34 MemberGetterPtr<double, &OGRFeature::GetFieldAsDouble>
45 at<FieldType_Map, float>,
50 at<FieldType_Map, double>,
55 at<FieldType_Map, double >::type,
56 at<FieldType_Map, int >::type
60 at<FieldType_Map, double>::type::value !=
61 at<FieldType_Map, int >::type::value
78 BOOST_MPL_ASSERT((boost::is_same<
int, CppToOGRConverter_trait<int>::type >));
79 BOOST_MPL_ASSERT((boost::is_same<
char*, CppToOGRConverter_trait<
char[8]>::type >));
97 assert(m_Definition &&
"No field definition wrapped");
98 return m_Definition->GetType();
105 <<
" (" << OGRFieldDefn::GetFieldTypeName(defn.
GetType()) <<
")";
112 : m_Definition(*feature.ogr().GetFieldDefnRef(index))
113 , m_Feature(feature.sptr())
124 os << indent << this->GetName() <<
": ";
125 switch (this->GetType())
128 os << this->GetValue<int>();
132 otb::Join(os, this->GetValue<std::vector<int> >(),
", ") <<
'}';
135 os << this->GetValue<double>();
139 otb::Join(os, this->GetValue<std::vector<double> >(),
", ") <<
'}';
142 os << this->GetValue<std::string>();
145 os <<
"??? -> " << this->GetType();
148 os <<
" (" << OGRFieldDefn::GetFieldTypeName(this->GetType()) <<
")";
155 return m_Feature->IsFieldSet(m_index);
160 m_Feature->UnsetField(m_index);
167 OGRField & of = f.
ogr();
168 m_Feature->SetField(m_index, &of);