31 #ifndef OGR_FEATURE_H_INCLUDED
32 #define OGR_FEATURE_H_INCLUDED
34 #include "cpl_atomic_ops.h"
37 #include "ogr_geomcoordinateprecision.h"
52 #ifndef DEFINE_OGRFeatureH
54 #define DEFINE_OGRFeatureH
114 char *pszAlternativeName;
127 std::string m_osDomainName{};
129 std::string m_osComment{};
132 bool m_bSealed =
false;
139 void SetName(
const char *);
146 void SetAlternativeName(
const char *);
150 return pszAlternativeName;
176 eJustify = eJustifyIn;
184 void SetWidth(
int nWidthIn);
191 void SetPrecision(
int nPrecisionIn);
198 void SetTZFlag(
int nTZFlag);
203 void SetDefault(
const char *);
204 const char *GetDefault()
const;
205 int IsDefaultDriverSpecific()
const;
222 void SetNullable(
int bNullableIn);
229 void SetUnique(
int bUniqueIn);
233 return m_osDomainName;
236 void SetDomainName(
const std::string &osDomainName);
243 void SetComment(
const std::string &osComment);
268 struct CPL_DLL TemporaryUnsealer
275 : m_poFieldDefn(poFieldDefn)
280 TemporaryUnsealer(TemporaryUnsealer &&) =
default;
281 TemporaryUnsealer &operator=(TemporaryUnsealer &&) =
default;
285 m_poFieldDefn->
Seal();
290 return m_poFieldDefn;
296 TemporaryUnsealer GetTemporaryUnsealer();
302 #ifdef GDAL_COMPILATION
314 inline OGRFieldDefn::TemporaryUnsealer whileUnsealing(
OGRFieldDefn *
object)
316 return object->GetTemporaryUnsealer();
349 char *pszName =
nullptr;
355 mutable int bNullable =
true;
356 bool m_bSealed =
false;
367 void SetName(
const char *);
399 void SetNullable(
int bNullableIn);
403 return m_oCoordPrecision;
431 struct CPL_DLL TemporaryUnsealer
438 : m_poFieldDefn(poFieldDefn)
443 TemporaryUnsealer(TemporaryUnsealer &&) =
default;
444 TemporaryUnsealer &operator=(TemporaryUnsealer &&) =
default;
448 m_poFieldDefn->
Seal();
453 return m_poFieldDefn;
459 TemporaryUnsealer GetTemporaryUnsealer();
465 #ifdef GDAL_COMPILATION
477 inline OGRGeomFieldDefn::TemporaryUnsealer
480 return object->GetTemporaryUnsealer();
520 volatile int nRefCount = 0;
522 mutable std::vector<std::unique_ptr<OGRFieldDefn>> apoFieldDefn{};
523 mutable std::vector<std::unique_ptr<OGRGeomFieldDefn>> apoGeomFieldDefn{};
525 char *pszFeatureClassName =
nullptr;
527 bool bIgnoreStyle =
false;
529 friend class TemporaryUnsealer;
530 bool m_bSealed =
false;
531 int m_nTemporaryUnsealCount = 0;
538 void SetName(
const char *pszName);
539 virtual const char *GetName()
const;
541 virtual int GetFieldCount()
const;
544 virtual int GetFieldIndex(
const char *)
const;
545 int GetFieldIndexCaseSensitive(
const char *)
const;
552 struct CPL_DLL Fields
558 inline explicit Fields(
OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
562 struct CPL_DLL ConstIterator
570 : m_poFDefn(poFDefn), m_nIdx(nIdx)
579 inline ConstIterator &operator++()
585 inline bool operator!=(
const ConstIterator &it)
const
587 return m_nIdx != it.m_nIdx;
591 inline ConstIterator
begin()
593 return ConstIterator(m_poFDefn, 0);
596 inline ConstIterator
end()
601 inline size_t size()
const
637 int GetFieldCountUnsafe()
const
639 return static_cast<int>(apoFieldDefn.size());
645 if (apoFieldDefn.empty())
647 return apoFieldDefn[
static_cast<std::size_t
>(i)].get();
652 if (apoFieldDefn.empty())
654 return apoFieldDefn[
static_cast<std::size_t
>(i)].get();
660 virtual OGRErr DeleteFieldDefn(
int iField);
661 virtual OGRErr ReorderFieldDefns(
const int *panMap);
663 virtual int GetGeomFieldCount()
const;
666 virtual int GetGeomFieldIndex(
const char *)
const;
673 struct CPL_DLL GeomFields
679 inline explicit GeomFields(
OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
683 struct CPL_DLL ConstIterator
691 : m_poFDefn(poFDefn), m_nIdx(nIdx)
700 inline ConstIterator &operator++()
706 inline bool operator!=(
const ConstIterator &it)
const
708 return m_nIdx != it.m_nIdx;
712 inline ConstIterator
begin()
714 return ConstIterator(m_poFDefn, 0);
717 inline ConstIterator
end()
722 inline size_t size()
const
752 return GeomFields(
this);
756 virtual void AddGeomFieldDefn(std::unique_ptr<OGRGeomFieldDefn> &&);
757 virtual OGRErr DeleteGeomFieldDefn(
int iGeomField);
766 return CPLAtomicInc(&nRefCount);
771 return CPLAtomicDec(&nRefCount);
781 virtual int IsGeometryIgnored()
const;
782 virtual void SetGeometryIgnored(
int bIgnore);
791 bIgnoreStyle = bIgnore;
794 virtual int IsSame(
const OGRFeatureDefn *poOtherFeatureDefn)
const;
797 void ReserveSpaceForFields(
int nFieldCountIn);
800 std::vector<int> ComputeMapForSetFrom(
const OGRFeatureDefn *poSrcFDefn,
801 bool bForgiving =
true)
const;
803 static OGRFeatureDefn *CreateFeatureDefn(
const char *pszName =
nullptr);
822 void Seal(
bool bSealFields);
824 void Unseal(
bool bUnsealFields);
827 struct CPL_DLL TemporaryUnsealer
831 bool m_bSealFields =
false;
837 TemporaryUnsealer(TemporaryUnsealer &&) =
default;
838 TemporaryUnsealer &operator=(TemporaryUnsealer &&) =
default;
840 ~TemporaryUnsealer();
844 return m_poFeatureDefn;
850 TemporaryUnsealer GetTemporaryUnsealer(
bool bSealFields =
true);
856 #ifdef GDAL_COMPILATION
877 inline OGRFeatureDefn::TemporaryUnsealer whileUnsealing(
OGRFeatureDefn *
object,
878 bool bSealFields =
true)
880 return object->GetTemporaryUnsealer(bSealFields);
899 char *m_pszNativeData;
900 char *m_pszNativeMediaType;
902 bool SetFieldInternal(
int i,
const OGRField *puValue);
906 mutable char *m_pszStyleString;
908 mutable char *m_pszTmpFieldValue;
922 std::unique_ptr<Private> m_poPrivate;
947 FieldValue &operator=(
const std::string &osVal);
949 FieldValue &operator=(
const std::vector<int> &oArray);
951 FieldValue &operator=(
const std::vector<GIntBig> &oArray);
953 FieldValue &operator=(
const std::vector<double> &oArray);
955 FieldValue &operator=(
const std::vector<std::string> &oArray);
970 void SetDateTime(
int nYear,
int nMonth,
int nDay,
int nHour = 0,
971 int nMinute = 0,
float fSecond = 0.f,
int nTZFlag = 0);
974 int GetIndex()
const;
981 return GetDefn()->GetNameRef();
987 return GetDefn()->GetType();
993 return GetDefn()->GetSubType();
1005 bool IsUnset()
const;
1009 bool IsNull()
const;
1012 const OGRField *GetRawValue()
const;
1020 return GetRawValue()->Integer;
1029 return GetRawValue()->Integer64;
1038 return GetRawValue()->Real;
1047 return GetRawValue()->String;
1051 bool GetDateTime(
int *pnYear,
int *pnMonth,
int *pnDay,
int *pnHour,
1052 int *pnMinute,
float *pfSecond,
int *pnTZFlag)
const;
1055 operator int()
const
1057 return GetAsInteger();
1064 return GetAsInteger64();
1068 operator double()
const
1070 return GetAsDouble();
1074 operator const char *()
const
1076 return GetAsString();
1080 operator const std::vector<int> &()
const
1082 return GetAsIntegerList();
1087 operator const std::vector<GIntBig> &()
const
1089 return GetAsInteger64List();
1093 operator const std::vector<double> &()
const
1095 return GetAsDoubleList();
1099 operator const std::vector<std::string> &()
const
1101 return GetAsStringList();
1108 int GetAsInteger()
const;
1111 GIntBig GetAsInteger64()
const;
1113 double GetAsDouble()
const;
1115 const char *GetAsString()
const;
1117 const std::vector<int> &GetAsIntegerList()
const;
1120 const std::vector<GIntBig> &GetAsInteger64List()
const;
1122 const std::vector<double> &GetAsDoubleList()
const;
1124 const std::vector<std::string> &GetAsStringList()
const;
1132 std::unique_ptr<Private> m_poPrivate;
1169 const FieldValue operator[](
int iField)
const;
1178 const FieldValue operator[](
const char *pszFieldName)
const;
1179 FieldValue operator[](
const char *pszFieldName);
1201 int GetGeomFieldCount()
const
1222 const OGRGeometry *GetGeomFieldRef(
int iField)
const;
1224 OGRGeometry *GetGeomFieldRef(
const char *pszFName);
1225 const OGRGeometry *GetGeomFieldRef(
const char *pszFName)
const;
1234 int GetFieldCount()
const
1254 int IsFieldSet(
int iField)
const;
1256 void UnsetField(
int iField);
1258 bool IsFieldNull(
int iField)
const;
1260 void SetFieldNull(
int iField);
1262 bool IsFieldSetAndNotNull(
int iField)
const;
1266 return pauFields + i;
1271 return pauFields + i;
1274 int GetFieldAsInteger(
int i)
const;
1275 GIntBig GetFieldAsInteger64(
int i)
const;
1276 double GetFieldAsDouble(
int i)
const;
1277 const char *GetFieldAsString(
int i)
const;
1278 const char *GetFieldAsISO8601DateTime(
int i,
1280 const int *GetFieldAsIntegerList(
int i,
int *pnCount)
const;
1281 const GIntBig *GetFieldAsInteger64List(
int i,
int *pnCount)
const;
1282 const double *GetFieldAsDoubleList(
int i,
int *pnCount)
const;
1283 char **GetFieldAsStringList(
int i)
const;
1284 GByte *GetFieldAsBinary(
int i,
int *pnCount)
const;
1285 int GetFieldAsDateTime(
int i,
int *pnYear,
int *pnMonth,
int *pnDay,
1286 int *pnHour,
int *pnMinute,
int *pnSecond,
1287 int *pnTZFlag)
const;
1288 int GetFieldAsDateTime(
int i,
int *pnYear,
int *pnMonth,
int *pnDay,
1289 int *pnHour,
int *pnMinute,
float *pfSecond,
1290 int *pnTZFlag)
const;
1291 char *GetFieldAsSerializedJSon(
int i)
const;
1294 bool IsFieldSetUnsafe(
int i)
const
1301 bool IsFieldNullUnsafe(
int i)
const
1308 bool IsFieldSetAndNotNullUnsafe(
int i)
const
1310 return IsFieldSetUnsafe(i) && !IsFieldNullUnsafe(i);
1315 int GetFieldAsIntegerUnsafe(
int i)
const
1317 return pauFields[i].Integer;
1320 GIntBig GetFieldAsInteger64Unsafe(
int i)
const
1322 return pauFields[i].Integer64;
1325 double GetFieldAsDoubleUnsafe(
int i)
const
1327 return pauFields[i].Real;
1330 const char *GetFieldAsStringUnsafe(
int i)
const
1332 return pauFields[i].String;
1339 return GetFieldAsInteger(GetFieldIndex(pszFName));
1344 return GetFieldAsInteger64(GetFieldIndex(pszFName));
1349 return GetFieldAsDouble(GetFieldIndex(pszFName));
1354 return GetFieldAsString(GetFieldIndex(pszFName));
1360 return GetFieldAsISO8601DateTime(GetFieldIndex(pszFName), papszOptions);
1365 return GetFieldAsIntegerList(GetFieldIndex(pszFName), pnCount);
1371 return GetFieldAsInteger64List(GetFieldIndex(pszFName), pnCount);
1376 return GetFieldAsDoubleList(GetFieldIndex(pszFName), pnCount);
1381 return GetFieldAsStringList(GetFieldIndex(pszFName));
1384 void SetField(
int i,
int nValue);
1385 void SetField(
int i,
GIntBig nValue);
1386 void SetField(
int i,
double dfValue);
1387 void SetField(
int i,
const char *pszValue);
1388 void SetField(
int i,
int nCount,
const int *panValues);
1389 void SetField(
int i,
int nCount,
const GIntBig *panValues);
1390 void SetField(
int i,
int nCount,
const double *padfValues);
1391 void SetField(
int i,
const char *
const *papszValues);
1392 void SetField(
int i,
const OGRField *puValue);
1393 void SetField(
int i,
int nCount,
const void *pabyBinary);
1394 void SetField(
int i,
int nYear,
int nMonth,
int nDay,
int nHour = 0,
1395 int nMinute = 0,
float fSecond = 0.f,
int nTZFlag = 0);
1400 void SetFieldSameTypeUnsafe(
int i,
int nValue)
1402 pauFields[i].Integer = nValue;
1403 pauFields[i].Set.nMarker2 = 0;
1404 pauFields[i].Set.nMarker3 = 0;
1407 void SetFieldSameTypeUnsafe(
int i,
GIntBig nValue)
1409 pauFields[i].Integer64 = nValue;
1412 void SetFieldSameTypeUnsafe(
int i,
double dfValue)
1414 pauFields[i].Real = dfValue;
1417 void SetFieldSameTypeUnsafe(
int i,
char *pszValueTransferred)
1419 pauFields[i].String = pszValueTransferred;
1426 SetField(GetFieldIndex(pszFName), nValue);
1431 SetField(GetFieldIndex(pszFName), nValue);
1436 SetField(GetFieldIndex(pszFName), dfValue);
1439 void SetField(
const char *pszFName,
const char *pszValue)
1441 SetField(GetFieldIndex(pszFName), pszValue);
1444 void SetField(
const char *pszFName,
int nCount,
const int *panValues)
1446 SetField(GetFieldIndex(pszFName), nCount, panValues);
1451 SetField(GetFieldIndex(pszFName), nCount, panValues);
1454 void SetField(
const char *pszFName,
int nCount,
const double *padfValues)
1456 SetField(GetFieldIndex(pszFName), nCount, padfValues);
1459 void SetField(
const char *pszFName,
const char *
const *papszValues)
1461 SetField(GetFieldIndex(pszFName), papszValues);
1466 SetField(GetFieldIndex(pszFName), puValue);
1469 void SetField(
const char *pszFName,
int nYear,
int nMonth,
int nDay,
1470 int nHour = 0,
int nMinute = 0,
float fSecond = 0.f,
1473 SetField(GetFieldIndex(pszFName), nYear, nMonth, nDay, nHour, nMinute,
1484 void DumpReadable(FILE *,
CSLConstList papszOptions =
nullptr)
const;
1485 std::string DumpReadableAsString(
CSLConstList papszOptions =
nullptr)
const;
1488 OGRErr SetFrom(
const OGRFeature *,
const int *panMap,
int bForgiving = TRUE,
1489 bool bUseISO8601ForDateTimeAsString =
false);
1491 int bForgiving = TRUE,
1492 bool bUseISO8601ForDateTimeAsString =
false);
1498 const int *panRemapSource);
1501 int Validate(
int nValidateFlags,
int bEmitError)
const;
1502 void FillUnsetWithDefault(
int bNotNullableOnly,
char **papszOptions);
1504 bool SerializeToBinary(std::vector<GByte> &abyBuffer)
const;
1505 bool DeserializeFromBinary(
const GByte *pabyBuffer,
size_t nSize);
1507 virtual const char *GetStyleString()
const;
1508 virtual void SetStyleString(
const char *);
1509 virtual void SetStyleStringDirectly(
char *);
1516 return m_poStyleTable;
1520 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable);
1524 return m_pszNativeData;
1529 return m_pszNativeMediaType;
1532 void SetNativeData(
const char *pszNativeData);
1533 void SetNativeMediaType(
const char *pszNativeMediaType);
1551 return reinterpret_cast<OGRFeature *
>(hFeature);
1559 struct CPL_DLL OGRFeatureUniquePtrDeleter
1569 typedef std::unique_ptr<OGRFeature, OGRFeatureUniquePtrDeleter>
1576 return poFeature->
begin();
1582 return poFeature->
end();
1589 return poFeature->begin();
1595 return poFeature->end();
1630 std::string m_osName;
1631 std::string m_osDescription;
1638 OGRFieldDomain(
const std::string &osName,
const std::string &osDescription,
1672 return m_osDescription;
1681 return m_eDomainType;
1690 return m_eFieldType;
1699 return m_eFieldSubType;
1720 return m_eSplitPolicy;
1729 m_eSplitPolicy = policy;
1738 return m_eMergePolicy;
1747 m_eMergePolicy = policy;
1760 std::vector<OGRCodedValue> m_asValues{};
1782 const std::string &osDescription,
1784 std::vector<OGRCodedValue> &&asValues);
1797 return m_asValues.data();
1808 bool m_bMinIsInclusive;
1809 bool m_bMaxIsInclusive;
1843 const std::string &osDescription,
1845 const OGRField &sMin,
bool bMinIsInclusive,
1846 const OGRField &sMax,
bool bMaxIsInclusive);
1851 m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_sMin,
1852 m_bMinIsInclusive, m_sMax, m_bMaxIsInclusive);
1853 poDomain->SetMergePolicy(m_eMergePolicy);
1854 poDomain->SetSplitPolicy(m_eSplitPolicy);
1873 bIsInclusiveOut = m_bMinIsInclusive;
1892 bIsInclusiveOut = m_bMaxIsInclusive;
1904 std::string m_osGlob;
1921 const std::string &osDescription,
1923 const std::string &osBlob);
1928 m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_osGlob);
1929 poDomain->SetMergePolicy(m_eMergePolicy);
1930 poDomain->SetSplitPolicy(m_eSplitPolicy);
1950 class swq_expr_node;
1951 class swq_custom_func_registrar;
1952 struct swq_evaluation_context;
1954 class CPL_DLL OGRFeatureQuery
1959 swq_evaluation_context *m_psContext =
nullptr;
1961 char **FieldCollector(
void *,
char **);
1963 static GIntBig *EvaluateAgainstIndices(
const swq_expr_node *,
OGRLayer *,
1966 static int CanUseIndex(
const swq_expr_node *,
OGRLayer *);
1969 swq_custom_func_registrar *poCustomFuncRegistrar);
1978 swq_custom_func_registrar *poCustomFuncRegistrar =
nullptr);
1980 swq_custom_func_registrar *poCustomFuncRegistrar =
nullptr);
1987 char **GetUsedFields();
Definition of a coded / enumerated field domain.
Definition: ogr_feature.h:1758
const OGRCodedValue * GetEnumeration() const
Get the enumeration as (code, value) pairs.
Definition: ogr_feature.h:1795
Definition of a feature class or feature layer.
Definition: ogr_feature.h:517
int Reference()
Increments the reference count by one.
Definition: ogr_feature.h:764
virtual int GetFieldCount() const
Fetch number of fields on this feature.
Definition: ogrfeaturedefn.cpp:277
virtual OGRFieldDefn * GetFieldDefn(int i)
Fetch field definition.
Definition: ogrfeaturedefn.cpp:321
static OGRFeatureDefn * FromHandle(OGRFeatureDefnH hFeatureDefn)
Convert a OGRFeatureDefnH to a OGRFeatureDefn*.
Definition: ogr_feature.h:817
GeomFields GetGeomFields()
Return an object that can be used to iterate over geometry fields.
Definition: ogr_feature.h:750
virtual bool IsStyleIgnored() const
Determine whether the style can be omitted when fetching features.
Definition: ogr_feature.h:784
Fields GetFields()
Return an object that can be used to iterate over non-geometry fields.
Definition: ogr_feature.h:629
int Dereference()
Decrements the reference count by one.
Definition: ogr_feature.h:769
static OGRFeatureDefnH ToHandle(OGRFeatureDefn *poFeatureDefn)
Convert a OGRFeatureDefn* to a OGRFeatureDefnH.
Definition: ogr_feature.h:809
virtual OGRGeomFieldDefn * GetGeomFieldDefn(int i)
Fetch geometry field definition.
Definition: ogrfeaturedefn.cpp:671
virtual int GetGeomFieldCount() const
Fetch number of geometry fields on this feature.
Definition: ogrfeaturedefn.cpp:622
virtual int GetFieldIndex(const char *) const
Find field by name.
Definition: ogrfeaturedefn.cpp:1230
int GetReferenceCount() const
Fetch current reference count.
Definition: ogr_feature.h:774
virtual int GetGeomFieldIndex(const char *) const
Find geometry field by name.
Definition: ogrfeaturedefn.cpp:921
virtual void SetStyleIgnored(bool bIgnore)
Set whether the style can be omitted when fetching features.
Definition: ogr_feature.h:789
Field value iterator class.
Definition: ogr_feature.h:1129
Exception raised by operator[](const char*) when a field is not found.
Definition: ogr_feature.h:1175
Field value.
Definition: ogr_feature.h:919
bool empty() const
Return whether the field value is unset/empty.
Definition: ogr_feature.h:998
int GetInteger() const
Return the integer value.
Definition: ogr_feature.h:1018
OGRFieldType GetType() const
Return field type.
Definition: ogr_feature.h:985
void Unset()
Unset the field.
Definition: ogr_feature.h:964
const char * GetString() const
Return the string value.
Definition: ogr_feature.h:1045
double GetDouble() const
Return the double value.
Definition: ogr_feature.h:1036
const char * GetName() const
Return field name.
Definition: ogr_feature.h:979
GIntBig GetInteger64() const
Return the 64-bit integer value.
Definition: ogr_feature.h:1027
OGRFieldSubType GetSubType() const
Return field subtype.
Definition: ogr_feature.h:991
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:893
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition: ogr_feature.h:1181
const char * GetFieldAsISO8601DateTime(const char *pszFName, CSLConstList papszOptions) const
Fetch OFTDateTime field value as a ISO8601 representation.
Definition: ogr_feature.h:1357
static OGRFeatureH ToHandle(OGRFeature *poFeature)
Convert a OGRFeature* to a OGRFeatureH.
Definition: ogr_feature.h:1541
char ** GetFieldAsStringList(const char *pszFName) const
Fetch field value as a list of strings.
Definition: ogr_feature.h:1379
virtual OGRStyleTable * GetStyleTable() const
Return style table.
Definition: ogr_feature.h:1514
ConstFieldIterator end() const
Return end of field value iterator.
Definition: ogrfeature.cpp:8339
ConstFieldIterator begin() const
Return begin of field value iterator.
Definition: ogrfeature.cpp:8334
void SetField(const char *pszFName, int nCount, const GIntBig *panValues)
Set field to list of 64 bit integers value.
Definition: ogr_feature.h:1449
const OGRFeatureDefn * GetDefnRef() const
Fetch feature definition.
Definition: ogr_feature.h:1186
OGRFieldDefn * GetFieldDefnRef(int iField)
Fetch definition for this field.
Definition: ogr_feature.h:1244
const double * GetFieldAsDoubleList(const char *pszFName, int *pnCount) const
Fetch field value as a list of doubles.
Definition: ogr_feature.h:1374
void SetField(const char *pszFName, int nCount, const int *panValues)
This method currently on has an effect of OFTIntegerList, OFTInteger64List and OFTRealList fields.
Definition: ogr_feature.h:1444
void SetField(const char *pszFName, GIntBig nValue)
Set field to 64 bit integer value.
Definition: ogr_feature.h:1429
void SetField(const char *pszFName, const char *pszValue)
Set field to string value.
Definition: ogr_feature.h:1439
void SetField(const char *pszFName, int nValue)
Set field to integer value.
Definition: ogr_feature.h:1424
const OGRFieldDefn * GetFieldDefnRef(int iField) const
Fetch definition for this field.
Definition: ogr_feature.h:1239
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:1469
const OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField) const
Fetch definition for this geometry field.
Definition: ogr_feature.h:1211
const char * GetNativeData() const
Returns the native data for the feature.
Definition: ogr_feature.h:1522
int GetFieldIndex(const char *pszName) const
Fetch the field index given field name.
Definition: ogr_feature.h:1249
static OGRFeature * FromHandle(OGRFeatureH hFeature)
Convert a OGRFeatureH to a OGRFeature*.
Definition: ogr_feature.h:1549
int GetGeomFieldIndex(const char *pszName) const
Fetch the geometry field index given geometry field name.
Definition: ogr_feature.h:1216
OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField)
Fetch definition for this geometry field.
Definition: ogr_feature.h:1206
GIntBig GetFieldAsInteger64(const char *pszFName) const
Fetch field value as integer 64 bit.
Definition: ogr_feature.h:1342
const int * GetFieldAsIntegerList(const char *pszFName, int *pnCount) const
Fetch field value as a list of integers.
Definition: ogr_feature.h:1363
void SetField(const char *pszFName, double dfValue)
Set field to double value.
Definition: ogr_feature.h:1434
const char * GetFieldAsString(const char *pszFName) const
Fetch field value as a string.
Definition: ogr_feature.h:1352
void SetField(const char *pszFName, const char *const *papszValues)
This method currently on has an effect of OFTStringList fields.
Definition: ogr_feature.h:1459
const OGRField * GetRawFieldRef(int i) const
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:1269
int GetFieldAsInteger(const char *pszFName) const
Fetch field value as integer.
Definition: ogr_feature.h:1337
const char * GetNativeMediaType() const
Returns the native media type for the feature.
Definition: ogr_feature.h:1527
void SetField(const char *pszFName, const OGRField *puValue)
Set field.
Definition: ogr_feature.h:1464
GIntBig GetFID() const
Get feature identifier.
Definition: ogr_feature.h:1477
OGRField * GetRawFieldRef(int i)
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:1264
void SetField(const char *pszFName, int nCount, const double *padfValues)
This method currently on has an effect of OFTIntegerList, OFTInteger64List, OFTRealList fields.
Definition: ogr_feature.h:1454
double GetFieldAsDouble(const char *pszFName) const
Fetch field value as a double.
Definition: ogr_feature.h:1347
const GIntBig * GetFieldAsInteger64List(const char *pszFName, int *pnCount) const
Fetch field value as a list of 64 bit integers.
Definition: ogr_feature.h:1368
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:111
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:141
void Unseal()
Unseal a OGRFieldDefn.
Definition: ogrfielddefn.cpp:2120
int IsNullable() const
Return whether this field can receive null values.
Definition: ogr_feature.h:217
void Seal()
Seal a OGRFieldDefn.
Definition: ogrfielddefn.cpp:2101
static OGRFieldDefn * FromHandle(OGRFieldDefnH hFieldDefn)
Convert a OGRFieldDefnH to a OGRFieldDefn*.
Definition: ogr_feature.h:258
int IsUnique() const
Return whether this field has a unique constraint.
Definition: ogr_feature.h:224
OGRFieldSubType GetSubType() const
Fetch subtype of this field.
Definition: ogr_feature.h:161
OGRJustification GetJustify() const
Get the justification for this field.
Definition: ogr_feature.h:169
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:212
int GetPrecision() const
Get the formatting precision for this field.
Definition: ogr_feature.h:186
OGRFieldType GetType() const
Fetch type of this field.
Definition: ogr_feature.h:153
int GetWidth() const
Get the formatting width for this field.
Definition: ogr_feature.h:179
const std::string & GetComment() const
Return the (optional) comment for this field.
Definition: ogr_feature.h:238
int GetTZFlag() const
Get the time zone flag.
Definition: ogr_feature.h:193
void SetJustify(OGRJustification eJustifyIn)
Set the justification for this field.
Definition: ogr_feature.h:174
const char * GetAlternativeNameRef() const
Fetch the alternative name (or "alias") for this field.
Definition: ogr_feature.h:148
static OGRFieldDefnH ToHandle(OGRFieldDefn *poFieldDefn)
Convert a OGRFieldDefn* to a OGRFieldDefnH.
Definition: ogr_feature.h:250
const std::string & GetDomainName() const
Return the name of the field domain for this field.
Definition: ogr_feature.h:231
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:207
Definition of a field domain.
Definition: ogr_feature.h:1627
OGRFieldDomainMergePolicy GetMergePolicy() const
Get the merge policy.
Definition: ogr_feature.h:1736
void SetMergePolicy(OGRFieldDomainMergePolicy policy)
Set the merge policy.
Definition: ogr_feature.h:1745
static OGRFieldDomain * FromHandle(OGRFieldDomainH hFieldDomain)
Convert a OGRFieldDomainH to a OGRFieldDomain*.
Definition: ogr_feature.h:1709
OGRFieldSubType GetFieldSubType() const
Get the field subtype.
Definition: ogr_feature.h:1697
virtual ~OGRFieldDomain()=0
Destructor.
virtual OGRFieldDomain * Clone() const =0
Clone.
OGRFieldDomainSplitPolicy GetSplitPolicy() const
Get the split policy.
Definition: ogr_feature.h:1718
static OGRFieldDomainH ToHandle(OGRFieldDomain *poFieldDomain)
Convert a OGRFieldDomain* to a OGRFieldDomainH.
Definition: ogr_feature.h:1703
const std::string & GetDescription() const
Get the description of the field domain.
Definition: ogr_feature.h:1670
OGRFieldType GetFieldType() const
Get the field type.
Definition: ogr_feature.h:1688
OGRFieldDomainType GetDomainType() const
Get the type of the field domain.
Definition: ogr_feature.h:1679
const std::string & GetName() const
Get the name of the field domain.
Definition: ogr_feature.h:1660
void SetSplitPolicy(OGRFieldDomainSplitPolicy policy)
Set the split policy.
Definition: ogr_feature.h:1727
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:346
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:389
void Seal()
Seal a OGRGeomFieldDefn.
Definition: ogrgeomfielddefn.cpp:841
void Unseal()
Unseal a OGRGeomFieldDefn.
Definition: ogrgeomfielddefn.cpp:860
int IsNullable() const
Return whether this geometry field can receive null values.
Definition: ogr_feature.h:394
static OGRGeomFieldDefn * FromHandle(OGRGeomFieldDefnH hGeomFieldDefn)
Convert a OGRGeomFieldDefnH to a OGRGeomFieldDefn*.
Definition: ogr_feature.h:421
OGRwkbGeometryType GetType() const
Fetch geometry type of this field.
Definition: ogr_feature.h:374
const OGRGeomCoordinatePrecision & GetCoordinatePrecision() const
Return the coordinate precision associated to this geometry field.
Definition: ogr_feature.h:401
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:384
static OGRGeomFieldDefnH ToHandle(OGRGeomFieldDefn *poGeomFieldDefn)
Convert a OGRGeomFieldDefn* to a OGRGeomFieldDefnH.
Definition: ogr_feature.h:413
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:369
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:377
Definition of a field domain for field content validated by a glob.
Definition: ogr_feature.h:1902
OGRGlobFieldDomain * Clone() const override
Clone.
Definition: ogr_feature.h:1925
const std::string & GetGlob() const
Get the glob expression.
Definition: ogr_feature.h:1938
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:74
Definition of a numeric field domain with a range of validity for values.
Definition: ogr_feature.h:1804
OGRRangeFieldDomain * Clone() const override
Clone.
Definition: ogr_feature.h:1848
const OGRField & GetMin(bool &bIsInclusiveOut) const
Get the minimum value.
Definition: ogr_feature.h:1871
const OGRField & GetMax(bool &bIsInclusiveOut) const
Get the maximum value.
Definition: ogr_feature.h:1890
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:169
This class represents a style table.
Definition: ogr_featurestyle.h:86
#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
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1183
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:976
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:185
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:215
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition: ogr_api.h:421
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition: ogr_api.h:423
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition: ogr_api.h:425
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition: ogr_api.h:433
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition: ogr_api.h:430
#define OGRUnsetMarker
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a unset field.
Definition: ogr_core.h:868
#define OGR_TZFLAG_UNKNOWN
Time zone flag indicating unknown timezone.
Definition: ogr_core.h:882
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:404
OGRFieldSubType
List of field subtypes.
Definition: ogr_core.h:821
OGRFieldDomainMergePolicy
Merge policy for field domains.
Definition: ogr_core.h:1288
@ OFDMP_DEFAULT_VALUE
Default value.
Definition: ogr_core.h:1290
OGRFieldDomainType
Type of field domain.
Definition: ogr_core.h:1253
OGRJustification
Display justification for field values.
Definition: ogr_core.h:846
OGRFieldType
List of feature field types.
Definition: ogr_core.h:793
#define OGRNullMarker
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a null field.
Definition: ogr_core.h:876
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:416
@ wkbUnknown
unknown type, non-standard
Definition: ogr_core.h:417
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:387
OGRFieldDomainSplitPolicy
Split policy for field domains.
Definition: ogr_core.h:1270
@ OFDSP_DEFAULT_VALUE
Default value.
Definition: ogr_core.h:1272
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition: ogr_feature.h:1570
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition: ogr_feature.h:63
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition: ogr_feature.h:65
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition: ogr_feature.h:67
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition: ogr_feature.h:75
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition: ogr_feature.h:72
void * OGRStyleTableH
Opaque type for a style table (OGRStyleTable)
Definition: ogr_feature.h:69
Simple feature style classes.
Simple feature geometry classes.
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:434
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:442
Associates a code and a value.
Definition: ogr_core.h:1240
Geometry coordinate precision.
Definition: ogr_geomcoordinateprecision.h:50
OGRFeature field attribute value union.
Definition: ogr_core.h:910