21 #ifndef otbVectorDataKeywordlist_h
22 #define otbVectorDataKeywordlist_h
28 #include "itkLightObject.h"
29 #include "itkObjectFactory.h"
30 #if defined(__GNUC__) || defined(__clang__)
31 #pragma GCC diagnostic push
32 #pragma GCC diagnostic ignored "-Wshadow"
33 #include "ogr_feature.h"
34 #pragma GCC diagnostic pop
36 #include "ogr_feature.h"
55 #include "OTBVectorDataBaseExport.h"
63 typedef std::pair<OGRFieldDefn*, OGRField>
FieldType;
68 return "VectorDataKeywordlist";
71 void AddField(OGRFieldDefn* fieldDefn, OGRField* field);
77 void AddField(
const std::string& key,
const std::string& value);
84 std::string GetFieldAsString(
const std::string& key)
const;
90 bool HasField(
const std::string& key)
const;
96 void SetFieldAsString(
const std::string& key,
const std::string& value);
103 double GetFieldAsDouble(
const std::string& key)
const;
109 void SetFieldAsDouble(
const std::string& key,
double value);
116 void SetFieldAsInt(
const std::string& key,
int value);
123 int GetFieldAsInt(
const std::string& key)
const;
129 FieldType GetNthField(
unsigned int index)
const;
134 unsigned int GetNumberOfFields()
const;
139 std::vector<std::string> GetFieldList()
const;
144 void CopyFieldList(
const Self& kwl);
149 virtual void Print(std::ostream& os, itk::Indent indent = 0)
const;
161 void operator=(
const Self&);
164 virtual void PrintSelf(std::ostream& os, itk::Indent indent)
const;
167 std::string PrintField(FieldType field)
const;
168 FieldType CopyOgrField(FieldType field);