Go to the documentation of this file.
31 #ifndef OGR_FEATURE_H_INCLUDED
32 #define OGR_FEATURE_H_INCLUDED
34 #include "cpl_atomic_ops.h"
51 #ifndef DEFINE_OGRFeatureH
53 #define DEFINE_OGRFeatureH
107 char *pszAlternativeName;
120 std::string m_osDomainName{};
122 std::string m_osComment{};
131 void SetName(
const char *);
137 void SetAlternativeName(
const char *);
140 return pszAlternativeName;
163 eJustify = eJustifyIn;
172 nWidth =
MAX(0, nWidthIn);
181 nPrecision = nPrecisionIn;
196 void SetDefault(
const char *);
197 const char *GetDefault()
const;
198 int IsDefaultDriverSpecific()
const;
215 bNullable = bNullableIn;
229 return m_osDomainName;
233 m_osDomainName = osDomainName;
242 m_osComment = osComment;
290 char *pszName =
nullptr;
296 mutable int bNullable =
true;
306 void SetName(
const char *);
336 bNullable = bNullableIn;
389 volatile int nRefCount = 0;
391 mutable std::vector<std::unique_ptr<OGRFieldDefn>> apoFieldDefn{};
392 mutable std::vector<std::unique_ptr<OGRGeomFieldDefn>> apoGeomFieldDefn{};
394 char *pszFeatureClassName =
nullptr;
396 bool bIgnoreStyle =
false;
403 void SetName(
const char *pszName);
404 virtual const char *GetName()
const;
406 virtual int GetFieldCount()
const;
409 virtual int GetFieldIndex(
const char *)
const;
410 int GetFieldIndexCaseSensitive(
const char *)
const;
417 struct CPL_DLL Fields
423 inline explicit Fields(
OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
427 struct CPL_DLL ConstIterator
435 : m_poFDefn(poFDefn), m_nIdx(nIdx)
443 inline ConstIterator &operator++()
448 inline bool operator!=(
const ConstIterator &it)
const
450 return m_nIdx != it.m_nIdx;
454 inline ConstIterator
begin()
456 return ConstIterator(m_poFDefn, 0);
458 inline ConstIterator
end()
463 inline size_t size()
const
496 int GetFieldCountUnsafe()
const
498 return static_cast<int>(apoFieldDefn.size());
504 if (apoFieldDefn.empty())
506 return apoFieldDefn[
static_cast<std::size_t
>(i)].get();
510 if (apoFieldDefn.empty())
512 return apoFieldDefn[
static_cast<std::size_t
>(i)].get();
517 virtual OGRErr DeleteFieldDefn(
int iField);
518 virtual OGRErr ReorderFieldDefns(
const int *panMap);
520 virtual int GetGeomFieldCount()
const;
523 virtual int GetGeomFieldIndex(
const char *)
const;
530 struct CPL_DLL GeomFields
536 inline explicit GeomFields(
OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
540 struct CPL_DLL ConstIterator
548 : m_poFDefn(poFDefn), m_nIdx(nIdx)
556 inline ConstIterator &operator++()
561 inline bool operator!=(
const ConstIterator &it)
const
563 return m_nIdx != it.m_nIdx;
567 inline ConstIterator
begin()
569 return ConstIterator(m_poFDefn, 0);
571 inline ConstIterator
end()
576 inline size_t size()
const
603 return GeomFields(
this);
607 virtual void AddGeomFieldDefn(std::unique_ptr<OGRGeomFieldDefn> &&);
608 virtual OGRErr DeleteGeomFieldDefn(
int iGeomField);
617 return CPLAtomicInc(&nRefCount);
621 return CPLAtomicDec(&nRefCount);
629 virtual int IsGeometryIgnored()
const;
630 virtual void SetGeometryIgnored(
int bIgnore);
637 bIgnoreStyle = bIgnore;
640 virtual int IsSame(
const OGRFeatureDefn *poOtherFeatureDefn)
const;
643 void ReserveSpaceForFields(
int nFieldCountIn);
646 std::vector<int> ComputeMapForSetFrom(
const OGRFeatureDefn *poSrcFDefn,
647 bool bForgiving =
true)
const;
649 static OGRFeatureDefn *CreateFeatureDefn(
const char *pszName =
nullptr);
687 char *m_pszNativeData;
688 char *m_pszNativeMediaType;
690 bool SetFieldInternal(
int i,
const OGRField *puValue);
694 mutable char *m_pszStyleString;
696 mutable char *m_pszTmpFieldValue;
710 std::unique_ptr<Private> m_poPrivate;
735 FieldValue &operator=(
const std::string &osVal);
737 FieldValue &operator=(
const std::vector<int> &oArray);
739 FieldValue &operator=(
const std::vector<GIntBig> &oArray);
741 FieldValue &operator=(
const std::vector<double> &oArray);
743 FieldValue &operator=(
const std::vector<std::string> &oArray);
756 void SetDateTime(
int nYear,
int nMonth,
int nDay,
int nHour = 0,
757 int nMinute = 0,
float fSecond = 0.f,
int nTZFlag = 0);
760 int GetIndex()
const;
766 return GetDefn()->GetNameRef();
771 return GetDefn()->GetType();
776 return GetDefn()->GetSubType();
788 bool IsUnset()
const;
795 const OGRField *GetRawValue()
const;
803 return GetRawValue()->Integer;
812 return GetRawValue()->Integer64;
821 return GetRawValue()->Real;
830 return GetRawValue()->String;
834 bool GetDateTime(
int *pnYear,
int *pnMonth,
int *pnDay,
int *pnHour,
835 int *pnMinute,
float *pfSecond,
int *pnTZFlag)
const;
840 return GetAsInteger();
846 return GetAsInteger64();
849 operator double()
const
851 return GetAsDouble();
854 operator const char *()
const
856 return GetAsString();
859 operator const std::vector<int> &()
const
861 return GetAsIntegerList();
865 operator const std::vector<GIntBig> &()
const
867 return GetAsInteger64List();
870 operator const std::vector<double> &()
const
872 return GetAsDoubleList();
875 operator const std::vector<std::string> &()
const
877 return GetAsStringList();
883 int GetAsInteger()
const;
886 GIntBig GetAsInteger64()
const;
888 double GetAsDouble()
const;
890 const char *GetAsString()
const;
892 const std::vector<int> &GetAsIntegerList()
const;
895 const std::vector<GIntBig> &GetAsInteger64List()
const;
897 const std::vector<double> &GetAsDoubleList()
const;
899 const std::vector<std::string> &GetAsStringList()
const;
907 std::unique_ptr<Private> m_poPrivate;
944 const FieldValue operator[](
int iField)
const;
953 const FieldValue operator[](
const char *pszFieldName)
const;
954 FieldValue operator[](
const char *pszFieldName);
975 int GetGeomFieldCount()
const
993 const OGRGeometry *GetGeomFieldRef(
int iField)
const;
995 OGRGeometry *GetGeomFieldRef(
const char *pszFName);
996 const OGRGeometry *GetGeomFieldRef(
const char *pszFName)
const;
1005 int GetFieldCount()
const
1022 int IsFieldSet(
int iField)
const;
1024 void UnsetField(
int iField);
1026 bool IsFieldNull(
int iField)
const;
1028 void SetFieldNull(
int iField);
1030 bool IsFieldSetAndNotNull(
int iField)
const;
1034 return pauFields + i;
1038 return pauFields + i;
1041 int GetFieldAsInteger(
int i)
const;
1042 GIntBig GetFieldAsInteger64(
int i)
const;
1043 double GetFieldAsDouble(
int i)
const;
1044 const char *GetFieldAsString(
int i)
const;
1045 const char *GetFieldAsISO8601DateTime(
int i,
1047 const int *GetFieldAsIntegerList(
int i,
int *pnCount)
const;
1048 const GIntBig *GetFieldAsInteger64List(
int i,
int *pnCount)
const;
1049 const double *GetFieldAsDoubleList(
int i,
int *pnCount)
const;
1050 char **GetFieldAsStringList(
int i)
const;
1051 GByte *GetFieldAsBinary(
int i,
int *pnCount)
const;
1052 int GetFieldAsDateTime(
int i,
int *pnYear,
int *pnMonth,
int *pnDay,
1053 int *pnHour,
int *pnMinute,
int *pnSecond,
1054 int *pnTZFlag)
const;
1055 int GetFieldAsDateTime(
int i,
int *pnYear,
int *pnMonth,
int *pnDay,
1056 int *pnHour,
int *pnMinute,
float *pfSecond,
1057 int *pnTZFlag)
const;
1058 char *GetFieldAsSerializedJSon(
int i)
const;
1061 bool IsFieldSetUnsafe(
int i)
const
1067 bool IsFieldNullUnsafe(
int i)
const
1073 bool IsFieldSetAndNotNullUnsafe(
int i)
const
1075 return IsFieldSetUnsafe(i) && !IsFieldNullUnsafe(i);
1079 int GetFieldAsIntegerUnsafe(
int i)
const
1081 return pauFields[i].Integer;
1083 GIntBig GetFieldAsInteger64Unsafe(
int i)
const
1085 return pauFields[i].Integer64;
1087 double GetFieldAsDoubleUnsafe(
int i)
const
1089 return pauFields[i].Real;
1091 const char *GetFieldAsStringUnsafe(
int i)
const
1093 return pauFields[i].String;
1099 return GetFieldAsInteger(GetFieldIndex(pszFName));
1103 return GetFieldAsInteger64(GetFieldIndex(pszFName));
1107 return GetFieldAsDouble(GetFieldIndex(pszFName));
1111 return GetFieldAsString(GetFieldIndex(pszFName));
1116 return GetFieldAsISO8601DateTime(GetFieldIndex(pszFName), papszOptions);
1120 return GetFieldAsIntegerList(GetFieldIndex(pszFName), pnCount);
1125 return GetFieldAsInteger64List(GetFieldIndex(pszFName), pnCount);
1129 return GetFieldAsDoubleList(GetFieldIndex(pszFName), pnCount);
1133 return GetFieldAsStringList(GetFieldIndex(pszFName));
1136 void SetField(
int i,
int nValue);
1137 void SetField(
int i,
GIntBig nValue);
1138 void SetField(
int i,
double dfValue);
1139 void SetField(
int i,
const char *pszValue);
1140 void SetField(
int i,
int nCount,
const int *panValues);
1141 void SetField(
int i,
int nCount,
const GIntBig *panValues);
1142 void SetField(
int i,
int nCount,
const double *padfValues);
1143 void SetField(
int i,
const char *
const *papszValues);
1144 void SetField(
int i,
const OGRField *puValue);
1145 void SetField(
int i,
int nCount,
const void *pabyBinary);
1146 void SetField(
int i,
int nYear,
int nMonth,
int nDay,
int nHour = 0,
1147 int nMinute = 0,
float fSecond = 0.f,
int nTZFlag = 0);
1152 void SetFieldSameTypeUnsafe(
int i,
int nValue)
1154 pauFields[i].Integer = nValue;
1155 pauFields[i].Set.nMarker2 = 0;
1156 pauFields[i].Set.nMarker3 = 0;
1158 void SetFieldSameTypeUnsafe(
int i,
GIntBig nValue)
1160 pauFields[i].Integer64 = nValue;
1162 void SetFieldSameTypeUnsafe(
int i,
double dfValue)
1164 pauFields[i].Real = dfValue;
1166 void SetFieldSameTypeUnsafe(
int i,
char *pszValueTransferred)
1168 pauFields[i].String = pszValueTransferred;
1174 SetField(GetFieldIndex(pszFName), nValue);
1178 SetField(GetFieldIndex(pszFName), nValue);
1182 SetField(GetFieldIndex(pszFName), dfValue);
1184 void SetField(
const char *pszFName,
const char *pszValue)
1186 SetField(GetFieldIndex(pszFName), pszValue);
1188 void SetField(
const char *pszFName,
int nCount,
const int *panValues)
1190 SetField(GetFieldIndex(pszFName), nCount, panValues);
1194 SetField(GetFieldIndex(pszFName), nCount, panValues);
1196 void SetField(
const char *pszFName,
int nCount,
const double *padfValues)
1198 SetField(GetFieldIndex(pszFName), nCount, padfValues);
1200 void SetField(
const char *pszFName,
const char *
const *papszValues)
1202 SetField(GetFieldIndex(pszFName), papszValues);
1206 SetField(GetFieldIndex(pszFName), puValue);
1208 void SetField(
const char *pszFName,
int nYear,
int nMonth,
int nDay,
1209 int nHour = 0,
int nMinute = 0,
float fSecond = 0.f,
1212 SetField(GetFieldIndex(pszFName), nYear, nMonth, nDay, nHour, nMinute,
1222 void DumpReadable(FILE *,
CSLConstList papszOptions =
nullptr)
const;
1223 std::string DumpReadableAsString(
CSLConstList papszOptions =
nullptr)
const;
1226 OGRErr SetFrom(
const OGRFeature *,
const int *panMap,
int bForgiving = TRUE,
1227 bool bUseISO8601ForDateTimeAsString =
false);
1229 int bForgiving = TRUE,
1230 bool bUseISO8601ForDateTimeAsString =
false);
1236 const int *panRemapSource);
1239 int Validate(
int nValidateFlags,
int bEmitError)
const;
1240 void FillUnsetWithDefault(
int bNotNullableOnly,
char **papszOptions);
1242 virtual const char *GetStyleString()
const;
1243 virtual void SetStyleString(
const char *);
1244 virtual void SetStyleStringDirectly(
char *);
1251 return m_poStyleTable;
1254 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable);
1258 return m_pszNativeData;
1262 return m_pszNativeMediaType;
1264 void SetNativeData(
const char *pszNativeData);
1265 void SetNativeMediaType(
const char *pszNativeMediaType);
1283 return reinterpret_cast<OGRFeature *
>(hFeature);
1291 struct CPL_DLL OGRFeatureUniquePtrDeleter
1300 typedef std::unique_ptr<OGRFeature, OGRFeatureUniquePtrDeleter>
1307 return poFeature->
begin();
1312 return poFeature->
end();
1319 return poFeature->begin();
1324 return poFeature->end();
1359 std::string m_osName;
1360 std::string m_osDescription;
1367 OGRFieldDomain(
const std::string &osName,
const std::string &osDescription,
1401 return m_osDescription;
1410 return m_eDomainType;
1419 return m_eFieldType;
1428 return m_eFieldSubType;
1449 return m_eSplitPolicy;
1458 m_eSplitPolicy = policy;
1467 return m_eMergePolicy;
1476 m_eMergePolicy = policy;
1489 std::vector<OGRCodedValue> m_asValues{};
1511 const std::string &osDescription,
1513 std::vector<OGRCodedValue> &&asValues);
1526 return m_asValues.data();
1537 bool m_bMinIsInclusive;
1538 bool m_bMaxIsInclusive;
1572 const std::string &osDescription,
1574 const OGRField &sMin,
bool bMinIsInclusive,
1575 const OGRField &sMax,
bool bMaxIsInclusive);
1580 m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_sMin,
1581 m_bMinIsInclusive, m_sMax, m_bMaxIsInclusive);
1582 poDomain->SetMergePolicy(m_eMergePolicy);
1583 poDomain->SetSplitPolicy(m_eSplitPolicy);
1602 bIsInclusiveOut = m_bMinIsInclusive;
1621 bIsInclusiveOut = m_bMaxIsInclusive;
1633 std::string m_osGlob;
1650 const std::string &osDescription,
1652 const std::string &osBlob);
1657 m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_osGlob);
1658 poDomain->SetMergePolicy(m_eMergePolicy);
1659 poDomain->SetSplitPolicy(m_eSplitPolicy);
1679 class swq_expr_node;
1680 class swq_custom_func_registrar;
1682 class CPL_DLL OGRFeatureQuery
1688 char **FieldCollector(
void *,
char **);
1690 static GIntBig *EvaluateAgainstIndices(
const swq_expr_node *,
OGRLayer *,
1693 static int CanUseIndex(
const swq_expr_node *,
OGRLayer *);
1696 swq_custom_func_registrar *poCustomFuncRegistrar);
1705 swq_custom_func_registrar *poCustomFuncRegistrar =
nullptr);
1707 swq_custom_func_registrar *poCustomFuncRegistrar =
nullptr);
1714 char **GetUsedFields();
#define MAX(a, b)
Macro to compute the maximum of 2 values.
Definition: cpl_port.h:385
#define OGRNullMarker
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a null field.
Definition: ogr_core.h:867
const double * GetFieldAsDoubleList(const char *pszFName, int *pnCount) const
Fetch field value as a list of doubles.
Definition: ogr_feature.h:1127
const char * GetString() const
Return the string value.
Definition: ogr_feature.h:828
static OGRFeatureDefn * FromHandle(OGRFeatureDefnH hFeatureDefn)
Convert a OGRFeatureDefnH to a OGRFeatureDefn*.
Definition: ogr_feature.h:663
OGRFieldSubType GetSubType() const
Return field subtype.
Definition: ogr_feature.h:774
OGRFieldDomainSplitPolicy GetSplitPolicy() const
Get the split policy.
Definition: ogr_feature.h:1447
Fields GetFields()
Return an object that can be used to iterate over non-geometry fields.
Definition: ogr_feature.h:488
OGRFieldDomainMergePolicy
Merge policy for field domains.
Definition: ogr_core.h:1272
virtual bool IsStyleIgnored() const
Determine whether the style can be omitted when fetching features.
Definition: ogr_feature.h:631
@ OFDSP_DEFAULT_VALUE
Default value.
Definition: ogr_core.h:1257
OGRFieldDomainType
Type of field domain.
Definition: ogr_core.h:1237
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:196
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition: ogr_feature.h:62
Exception raised by operator[](const char*) when a field is not found.
Definition: ogr_feature.h:949
const OGRCodedValue * GetEnumeration() const
Get the enumeration as (code, value) pairs.
Definition: ogr_feature.h:1524
void SetField(const char *pszFName, GIntBig nValue)
Set field to 64 bit integer value. OFTInteger, OFTInteger64 and OFTReal fields will be set directly....
Definition: ogr_feature.h:1176
char ** GetFieldAsStringList(const char *pszFName) const
Fetch field value as a list of strings.
Definition: ogr_feature.h:1131
const std::string & GetDomainName() const
Return the name of the field domain for this field.
Definition: ogr_feature.h:227
Field value iterator class.
Definition: ogr_feature.h:903
void SetDomainName(const std::string &osDomainName)
Set the name of the field domain for this field.
Definition: ogr_feature.h:231
virtual OGRStyleTable * GetStyleTable() const
Return style table.
Definition: ogr_feature.h:1249
void SetJustify(OGRJustification eJustifyIn)
Set the justification for this field.
Definition: ogr_feature.h:161
void SetTZFlag(int nTZFlag)
Set the time zone flag.
Definition: ogr_feature.h:188
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:411
OGRFieldType GetType() const
Return field type.
Definition: ogr_feature.h:769
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:325
This class represents a style table.
Definition: ogr_featurestyle.h:84
void SetMergePolicy(OGRFieldDomainMergePolicy policy)
Set the merge policy.
Definition: ogr_feature.h:1474
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:204
static OGRFeatureH ToHandle(OGRFeature *poFeature)
Convert a OGRFeature* to a OGRFeatureH.
Definition: ogr_feature.h:1273
const char * GetName() const
Return field name.
Definition: ogr_feature.h:764
virtual int GetGeomFieldIndex(const char *) const
Find geometry field by name.
Definition: ogrfeaturedefn.cpp:875
OGRFieldDefn * GetFieldDefnRef(int iField)
Fetch definition for this field.
Definition: ogr_feature.h:1013
int GetWidth() const
Get the formatting width for this field.
Definition: ogr_feature.h:166
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:166
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition: ogr_feature.h:71
void * OGRStyleTableH
Opaque type for a style table (OGRStyleTable)
Definition: ogr_feature.h:68
static OGRFieldDomain * FromHandle(OGRFieldDomainH hFieldDomain)
Convert a OGRFieldDomainH to a OGRFieldDomain*.
Definition: ogr_feature.h:1438
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition: ogr_feature.h:66
void SetSplitPolicy(OGRFieldDomainSplitPolicy policy)
Set the split policy.
Definition: ogr_feature.h:1456
void SetField(const char *pszFName, const OGRField *puValue)
Set field.
Definition: ogr_feature.h:1204
const OGRField & GetMin(bool &bIsInclusiveOut) const
Get the minimum value.
Definition: ogr_feature.h:1600
double GetFieldAsDouble(const char *pszFName) const
Fetch field value as a double.
Definition: ogr_feature.h:1105
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:334
const std::string & GetDescription() const
Get the description of the field domain.
Definition: ogr_feature.h:1399
virtual OGRFieldDomain * Clone() const =0
Clone.
OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField)
Fetch definition for this geometry field.
Definition: ogr_feature.h:979
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:73
bool empty() const
Return whether the field value is unset/empty.
Definition: ogr_feature.h:781
@ OFDMP_DEFAULT_VALUE
Default value.
Definition: ogr_core.h:1275
static OGRGeomFieldDefnH ToHandle(OGRGeomFieldDefn *poGeomFieldDefn)
Convert a OGRGeomFieldDefn* to a OGRGeomFieldDefnH.
Definition: ogr_feature.h:344
int GetPrecision() const
Get the formatting precision for this field. This should normally be zero for fields of types other t...
Definition: ogr_feature.h:175
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:307
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:321
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition: ogr_feature.h:1301
const OGRField & GetMax(bool &bIsInclusiveOut) const
Get the maximum value.
Definition: ogr_feature.h:1619
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition: ogr_api.h:362
int GetGeomFieldIndex(const char *pszName) const
Fetch the geometry field index given geometry field name.
Definition: ogr_feature.h:987
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:132
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:395
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition: ogr_api.h:360
void SetPrecision(int nPrecisionIn)
Set the formatting precision for this field in characters.
Definition: ogr_feature.h:179
virtual OGRFieldDefn * GetFieldDefn(int i)
Fetch field definition.
Definition: ogrfeaturedefn.cpp:312
Field value.
Definition: ogr_feature.h:706
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition: ogr_api.h:367
const std::string & GetComment() const
Return the (optional) comment for this field.
Definition: ogr_feature.h:236
ConstFieldIterator begin() const
Return begin of field value iterator.
Definition: ogrfeature.cpp:7513
void SetComment(const std::string &osComment)
Set the comment for this field.
Definition: ogr_feature.h:240
OGRFieldDomainMergePolicy GetMergePolicy() const
Get the merge policy.
Definition: ogr_feature.h:1465
int IsUnique() const
Return whether this field has a unique constraint.
Definition: ogr_feature.h:218
Definition of a field domain for field content validated by a glob.
Definition: ogr_feature.h:1630
OGRFeature field attribute value union.
Definition: ogr_core.h:900
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition: ogr_feature.h:956
virtual OGRGeomFieldDefn * GetGeomFieldDefn(int i)
Fetch geometry field definition.
Definition: ogrfeaturedefn.cpp:640
void SetField(const char *pszFName, int nCount, const double *padfValues)
Definition: ogr_feature.h:1196
Associates a code and a value.
Definition: ogr_core.h:1224
int GetFieldIndex(const char *pszName) const
Fetch the field index given field name.
Definition: ogr_feature.h:1017
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1178
void Unset()
Unset the field.
Definition: ogr_feature.h:751
virtual int GetFieldCount() const
Fetch number of fields on this feature.
Definition: ogrfeaturedefn.cpp:268
void SetField(const char *pszFName, const char *pszValue)
Set field to string value.
Definition: ogr_feature.h:1184
const std::string & GetName() const
Get the name of the field domain.
Definition: ogr_feature.h:1389
void SetField(const char *pszFName, int nYear, int nMonth, int nDay, int nHour=0, int nMinute=0, float fSecond=0.f, int nTZFlag=0)
Set field to date.
Definition: ogr_feature.h:1208
static OGRFieldDefn * FromHandle(OGRFieldDefnH hFieldDefn)
Convert a OGRFieldDefnH to a OGRFieldDefn*.
Definition: ogr_feature.h:258
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition: ogr_api.h:370
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:103
int IsNullable() const
Return whether this geometry field can receive null values.
Definition: ogr_feature.h:330
void SetUnique(int bUniqueIn)
Set whether this field has a unique constraint.
Definition: ogr_feature.h:222
void SetField(const char *pszFName, int nCount, const int *panValues)
Definition: ogr_feature.h:1188
#define OGRUnsetMarker
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a unset field.
Definition: ogr_core.h:859
Definition of a numeric field domain with a range of validity for values.
Definition: ogr_feature.h:1532
OGRJustification
Display justification for field values.
Definition: ogr_core.h:836
virtual void SetStyleIgnored(bool bIgnore)
Set whether the style can be omitted when fetching features.
Definition: ogr_feature.h:635
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition: ogr_api.h:358
OGRFieldType GetFieldType() const
Get the field type.
Definition: ogr_feature.h:1417
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:286
double GetDouble() const
Return the double value.
Definition: ogr_feature.h:819
const GIntBig * GetFieldAsInteger64List(const char *pszFName, int *pnCount) const
Fetch field value as a list of 64 bit integers.
Definition: ogr_feature.h:1122
Definition of a field domain.
Definition: ogr_feature.h:1355
static OGRFeature * FromHandle(OGRFeatureH hFeature)
Convert a OGRFeatureH to a OGRFeature*.
Definition: ogr_feature.h:1281
int Dereference()
Decrements the reference count by one.
Definition: ogr_feature.h:619
#define OGR_TZFLAG_UNKNOWN
Time zone flag indicating unknown timezone.
Definition: ogr_core.h:873
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:419
OGRFieldType GetType() const
Fetch type of this field.
Definition: ogr_feature.h:143
int GetTZFlag() const
Get the time zone flag.
Definition: ogr_feature.h:184
virtual int GetFieldIndex(const char *) const
Find field by name.
Definition: ogrfeaturedefn.cpp:1177
OGRFieldSubType GetFieldSubType() const
Get the field subtype.
Definition: ogr_feature.h:1426
const char * GetAlternativeNameRef() const
Fetch the alternative name (or "alias") for this field.
Definition: ogr_feature.h:138
OGRFieldDomainSplitPolicy
Split policy for field domains.
Definition: ogr_core.h:1254
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:378
GeomFields GetGeomFields()
Return an object that can be used to iterate over geometry fields.
Definition: ogr_feature.h:601
static OGRFieldDomainH ToHandle(OGRFieldDomain *poFieldDomain)
Convert a OGRFieldDomain* to a OGRFieldDomainH.
Definition: ogr_feature.h:1432
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:226
const OGRFieldDefn * GetFieldDefnRef(int iField) const
Fetch definition for this field.
Definition: ogr_feature.h:1009
int GetInteger() const
Return the integer value.
Definition: ogr_feature.h:801
const OGRField * GetRawFieldRef(int i) const
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:1036
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:406
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:200
void SetField(const char *pszFName, double dfValue)
Set field to double value.
Definition: ogr_feature.h:1180
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:976
OGRField * GetRawFieldRef(int i)
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:1032
int Reference()
Increments the reference count by one.
Definition: ogr_feature.h:615
Definition of a coded / enumerated field domain.
Definition: ogr_feature.h:1486
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:680
ConstFieldIterator end() const
Return end of field value iterator.
Definition: ogrfeature.cpp:7518
const OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField) const
Fetch definition for this geometry field.
Definition: ogr_feature.h:983
OGRwkbGeometryType GetType() const
Fetch geometry type of this field.
Definition: ogr_feature.h:312
const char * GetNativeMediaType() const
Returns the native media type for the feature.
Definition: ogr_feature.h:1260
OGRFieldSubType
List of field subtypes.
Definition: ogr_core.h:811
void SetNullable(int bNullableIn)
Set whether this field can receive null values.
Definition: ogr_feature.h:213
void SetNullable(int bNullableIn)
Set whether this geometry field can receive null values.
Definition: ogr_feature.h:334
OGRRangeFieldDomain * Clone() const override
Clone.
Definition: ogr_feature.h:1577
static OGRGeomFieldDefn * FromHandle(OGRGeomFieldDefnH hGeomFieldDefn)
Convert a OGRGeomFieldDefnH to a OGRGeomFieldDefn*.
Definition: ogr_feature.h:352
static OGRFeatureDefnH ToHandle(OGRFeatureDefn *poFeatureDefn)
Convert a OGRFeatureDefn* to a OGRFeatureDefnH.
Definition: ogr_feature.h:655
int IsNullable() const
Return whether this field can receive null values.
Definition: ogr_feature.h:209
OGRFieldType
List of feature field types.
Definition: ogr_core.h:783
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition: ogr_feature.h:64
virtual int GetGeomFieldCount() const
Fetch number of geometry fields on this feature.
Definition: ogrfeaturedefn.cpp:591
GIntBig GetFieldAsInteger64(const char *pszFName) const
Fetch field value as integer 64 bit.
Definition: ogr_feature.h:1101
const char * GetFieldAsString(const char *pszFName) const
Fetch field value as a string.
Definition: ogr_feature.h:1109
GIntBig GetInteger64() const
Return the 64-bit integer value.
Definition: ogr_feature.h:810
void SetField(const char *pszFName, const char *const *papszValues)
Definition: ogr_feature.h:1200
void SetWidth(int nWidthIn)
Set the formatting width for this field in characters.
Definition: ogr_feature.h:170
Definition of a feature class or feature layer.
Definition: ogr_feature.h:385
const std::string & GetGlob() const
Get the glob expression.
Definition: ogr_feature.h:1667
int GetFieldAsInteger(const char *pszFName) const
Fetch field value as integer.
Definition: ogr_feature.h:1097
int GetReferenceCount() const
Fetch current reference count.
Definition: ogr_feature.h:623
OGRFieldSubType GetSubType() const
Fetch subtype of this field.
Definition: ogr_feature.h:150
void SetField(const char *pszFName, int nValue)
Set field to integer value. OFTInteger, OFTInteger64 and OFTReal fields will be set directly....
Definition: ogr_feature.h:1172
const int * GetFieldAsIntegerList(const char *pszFName, int *pnCount) const
Fetch field value as a list of integers.
Definition: ogr_feature.h:1118
@ wkbUnknown
unknown type, non-standard
Definition: ogr_core.h:408
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition: ogr_feature.h:74
OGRGlobFieldDomain * Clone() const override
Clone.
Definition: ogr_feature.h:1654
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1042
OGRJustification GetJustify() const
Get the justification for this field.
Definition: ogr_feature.h:157
const char * GetNativeData() const
Returns the native data for the feature.
Definition: ogr_feature.h:1256
const char * GetFieldAsISO8601DateTime(const char *pszFName, CSLConstList papszOptions) const
Fetch OFTDateTime field value as a ISO8601 representation.
Definition: ogr_feature.h:1113
OGRFieldDomainType GetDomainType() const
Get the type of the field domain.
Definition: ogr_feature.h:1408
GIntBig GetFID() const
Get feature identifier.
Definition: ogr_feature.h:1216
void SetField(const char *pszFName, int nCount, const GIntBig *panValues)
Set field to list of 64 bit integers value.
Definition: ogr_feature.h:1192
static OGRFieldDefnH ToHandle(OGRFieldDefn *poFieldDefn)
Convert a OGRFieldDefn* to a OGRFieldDefnH.
Definition: ogr_feature.h:250