14#ifndef OGR_FEATURE_H_INCLUDED
15#define OGR_FEATURE_H_INCLUDED
17#include "cpl_atomic_ops.h"
72 char *pszAlternativeName;
86 bool m_bGenerated =
false;
88 std::string m_osDomainName{};
90 std::string m_osComment{};
93 bool m_bSealed =
false;
106 void SetName(
const char *);
113 void SetAlternativeName(
const char *);
117 return pszAlternativeName;
145 eJustify = eJustifyIn;
153 void SetWidth(
int nWidthIn);
160 void SetPrecision(
int nPrecisionIn);
167 void SetTZFlag(
int nTZFlag);
172 void SetDefault(
const char *);
173 const char *GetDefault()
const;
174 int IsDefaultDriverSpecific()
const;
191 void SetNullable(
int bNullableIn);
218 m_bGenerated = bGeneratedIn;
221 void SetUnique(
int bUniqueIn);
225 return m_osDomainName;
228 void SetDomainName(
const std::string &osDomainName);
235 void SetComment(
const std::string &osComment);
260 struct CPL_DLL TemporaryUnsealer
267 : m_poFieldDefn(poFieldDefn)
272 TemporaryUnsealer(TemporaryUnsealer &&) =
default;
273 TemporaryUnsealer &operator=(TemporaryUnsealer &&) =
default;
277 m_poFieldDefn->
Seal();
282 return m_poFieldDefn;
288 TemporaryUnsealer GetTemporaryUnsealer();
291#ifdef GDAL_COMPILATION
303inline OGRFieldDefn::TemporaryUnsealer whileUnsealing(
OGRFieldDefn *
object)
305 return object->GetTemporaryUnsealer();
338 char *pszName =
nullptr;
344 mutable int bNullable =
true;
345 bool m_bSealed =
false;
362 void SetName(
const char *);
394 void SetNullable(
int bNullableIn);
398 return m_oCoordPrecision;
426 struct CPL_DLL TemporaryUnsealer
433 : m_poFieldDefn(poFieldDefn)
438 TemporaryUnsealer(TemporaryUnsealer &&) =
default;
439 TemporaryUnsealer &operator=(TemporaryUnsealer &&) =
default;
443 m_poFieldDefn->
Seal();
448 return m_poFieldDefn;
454 TemporaryUnsealer GetTemporaryUnsealer();
457#ifdef GDAL_COMPILATION
469inline OGRGeomFieldDefn::TemporaryUnsealer
472 return object->GetTemporaryUnsealer();
512 volatile int nRefCount = 0;
514 mutable std::vector<std::unique_ptr<OGRFieldDefn>> apoFieldDefn{};
515 mutable std::vector<std::unique_ptr<OGRGeomFieldDefn>> apoGeomFieldDefn{};
517 char *pszFeatureClassName =
nullptr;
519 bool bIgnoreStyle =
false;
521 friend class TemporaryUnsealer;
522 bool m_bSealed =
false;
523 int m_nTemporaryUnsealCount = 0;
530 void SetName(
const char *pszName);
531 virtual const char *GetName()
const;
533 virtual int GetFieldCount()
const;
536 virtual int GetFieldIndex(
const char *)
const;
537 int GetFieldIndexCaseSensitive(
const char *)
const;
544 struct CPL_DLL Fields
550 inline explicit Fields(
OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
554 struct CPL_DLL ConstIterator
562 : m_poFDefn(poFDefn), m_nIdx(nIdx)
571 inline ConstIterator &operator++()
577 inline bool operator!=(
const ConstIterator &it)
const
579 return m_nIdx != it.m_nIdx;
583 inline ConstIterator
begin()
585 return ConstIterator(m_poFDefn, 0);
588 inline ConstIterator
end()
593 inline size_t size()
const
629 int GetFieldCountUnsafe()
const
631 return static_cast<int>(apoFieldDefn.size());
637 if (apoFieldDefn.empty())
639 return apoFieldDefn[
static_cast<std::size_t
>(i)].get();
644 if (apoFieldDefn.empty())
646 return apoFieldDefn[
static_cast<std::size_t
>(i)].get();
652 virtual OGRErr DeleteFieldDefn(
int iField);
662 virtual std::unique_ptr<OGRFieldDefn> StealFieldDefn(
int iField);
664 virtual void AddFieldDefn(std::unique_ptr<OGRFieldDefn> &&poFieldDefn);
666 virtual OGRErr ReorderFieldDefns(
const int *panMap);
676 virtual std::unique_ptr<OGRGeomFieldDefn> StealGeomFieldDefn(
int iField);
678 virtual int GetGeomFieldCount()
const;
681 virtual int GetGeomFieldIndex(
const char *)
const;
688 struct CPL_DLL GeomFields
694 inline explicit GeomFields(
OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
698 struct CPL_DLL ConstIterator
706 : m_poFDefn(poFDefn), m_nIdx(nIdx)
715 inline ConstIterator &operator++()
721 inline bool operator!=(
const ConstIterator &it)
const
723 return m_nIdx != it.m_nIdx;
727 inline ConstIterator
begin()
729 return ConstIterator(m_poFDefn, 0);
732 inline ConstIterator
end()
737 inline size_t size()
const
767 return GeomFields(
this);
771 virtual void AddGeomFieldDefn(std::unique_ptr<OGRGeomFieldDefn> &&);
772 virtual OGRErr DeleteGeomFieldDefn(
int iGeomField);
781 return CPLAtomicInc(&nRefCount);
786 return CPLAtomicDec(&nRefCount);
796 virtual int IsGeometryIgnored()
const;
797 virtual void SetGeometryIgnored(
int bIgnore);
806 bIgnoreStyle = bIgnore;
809 virtual int IsSame(
const OGRFeatureDefn *poOtherFeatureDefn)
const;
812 void ReserveSpaceForFields(
int nFieldCountIn);
815 std::vector<int> ComputeMapForSetFrom(
const OGRFeatureDefn *poSrcFDefn,
816 bool bForgiving =
true)
const;
818 static OGRFeatureDefn *CreateFeatureDefn(
const char *pszName =
nullptr);
837 void Seal(
bool bSealFields);
839 void Unseal(
bool bUnsealFields);
842 struct CPL_DLL TemporaryUnsealer
846 bool m_bSealFields =
false;
852 TemporaryUnsealer(TemporaryUnsealer &&) =
default;
853 TemporaryUnsealer &operator=(TemporaryUnsealer &&) =
default;
855 ~TemporaryUnsealer();
859 return m_poFeatureDefn;
865 TemporaryUnsealer GetTemporaryUnsealer(
bool bSealFields =
true);
871#ifdef GDAL_COMPILATION
892inline OGRFeatureDefn::TemporaryUnsealer whileUnsealing(
OGRFeatureDefn *
object,
893 bool bSealFields =
true)
895 return object->GetTemporaryUnsealer(bSealFields);
914 char *m_pszNativeData;
915 char *m_pszNativeMediaType;
917 bool SetFieldInternal(
int i,
const OGRField *puValue);
921 mutable char *m_pszStyleString;
923 mutable char *m_pszTmpFieldValue;
937 std::unique_ptr<Private> m_poPrivate;
962 FieldValue &operator=(
const std::string &osVal);
964 FieldValue &operator=(
const std::vector<int> &oArray);
966 FieldValue &operator=(
const std::vector<GIntBig> &oArray);
968 FieldValue &operator=(
const std::vector<double> &oArray);
970 FieldValue &operator=(
const std::vector<std::string> &oArray);
985 void SetDateTime(
int nYear,
int nMonth,
int nDay,
int nHour = 0,
986 int nMinute = 0,
float fSecond = 0.f,
int nTZFlag = 0);
989 int GetIndex()
const;
996 return GetDefn()->GetNameRef();
1002 return GetDefn()->GetType();
1008 return GetDefn()->GetSubType();
1020 bool IsUnset()
const;
1024 bool IsNull()
const;
1027 const OGRField *GetRawValue()
const;
1035 return GetRawValue()->Integer;
1044 return GetRawValue()->Integer64;
1053 return GetRawValue()->Real;
1062 return GetRawValue()->String;
1066 bool GetDateTime(
int *pnYear,
int *pnMonth,
int *pnDay,
int *pnHour,
1067 int *pnMinute,
float *pfSecond,
int *pnTZFlag)
const;
1070 operator int()
const
1072 return GetAsInteger();
1079 return GetAsInteger64();
1083 operator double()
const
1085 return GetAsDouble();
1089 operator const char *()
const
1091 return GetAsString();
1095 operator const std::vector<int> &()
const
1097 return GetAsIntegerList();
1102 operator const std::vector<GIntBig> &()
const
1104 return GetAsInteger64List();
1108 operator const std::vector<double> &()
const
1110 return GetAsDoubleList();
1114 operator const std::vector<std::string> &()
const
1116 return GetAsStringList();
1123 int GetAsInteger()
const;
1126 GIntBig GetAsInteger64()
const;
1128 double GetAsDouble()
const;
1130 const char *GetAsString()
const;
1132 const std::vector<int> &GetAsIntegerList()
const;
1135 const std::vector<GIntBig> &GetAsInteger64List()
const;
1137 const std::vector<double> &GetAsDoubleList()
const;
1139 const std::vector<std::string> &GetAsStringList()
const;
1147 std::unique_ptr<Private> m_poPrivate;
1184 const FieldValue operator[](
int iField)
const;
1193 const FieldValue operator[](
const char *pszFieldName)
const;
1194 FieldValue operator[](
const char *pszFieldName);
1212 OGRErr SetGeometry(std::unique_ptr<OGRGeometry>);
1217 int GetGeomFieldCount()
const
1238 const OGRGeometry *GetGeomFieldRef(
int iField)
const;
1240 OGRGeometry *GetGeomFieldRef(
const char *pszFName);
1241 const OGRGeometry *GetGeomFieldRef(
const char *pszFName)
const;
1244 OGRErr SetGeomField(
int iField, std::unique_ptr<OGRGeometry>);
1251 int GetFieldCount()
const
1271 int IsFieldSet(
int iField)
const;
1273 void UnsetField(
int iField);
1275 bool IsFieldNull(
int iField)
const;
1277 void SetFieldNull(
int iField);
1279 bool IsFieldSetAndNotNull(
int iField)
const;
1283 return pauFields + i;
1288 return pauFields + i;
1291 int GetFieldAsInteger(
int i)
const;
1292 GIntBig GetFieldAsInteger64(
int i)
const;
1293 double GetFieldAsDouble(
int i)
const;
1294 const char *GetFieldAsString(
int i)
const;
1295 const char *GetFieldAsISO8601DateTime(
int i,
1297 const int *GetFieldAsIntegerList(
int i,
int *pnCount)
const;
1298 const GIntBig *GetFieldAsInteger64List(
int i,
int *pnCount)
const;
1299 const double *GetFieldAsDoubleList(
int i,
int *pnCount)
const;
1300 char **GetFieldAsStringList(
int i)
const;
1301 GByte *GetFieldAsBinary(
int i,
int *pnCount)
const;
1302 int GetFieldAsDateTime(
int i,
int *pnYear,
int *pnMonth,
int *pnDay,
1303 int *pnHour,
int *pnMinute,
int *pnSecond,
1304 int *pnTZFlag)
const;
1305 int GetFieldAsDateTime(
int i,
int *pnYear,
int *pnMonth,
int *pnDay,
1306 int *pnHour,
int *pnMinute,
float *pfSecond,
1307 int *pnTZFlag)
const;
1308 char *GetFieldAsSerializedJSon(
int i)
const;
1311 bool IsFieldSetUnsafe(
int i)
const
1318 bool IsFieldNullUnsafe(
int i)
const
1325 bool IsFieldSetAndNotNullUnsafe(
int i)
const
1327 return IsFieldSetUnsafe(i) && !IsFieldNullUnsafe(i);
1332 int GetFieldAsIntegerUnsafe(
int i)
const
1334 return pauFields[i].Integer;
1337 GIntBig GetFieldAsInteger64Unsafe(
int i)
const
1339 return pauFields[i].Integer64;
1342 double GetFieldAsDoubleUnsafe(
int i)
const
1344 return pauFields[i].Real;
1347 const char *GetFieldAsStringUnsafe(
int i)
const
1349 return pauFields[i].String;
1356 return GetFieldAsInteger(GetFieldIndex(pszFName));
1361 return GetFieldAsInteger64(GetFieldIndex(pszFName));
1366 return GetFieldAsDouble(GetFieldIndex(pszFName));
1371 return GetFieldAsString(GetFieldIndex(pszFName));
1377 return GetFieldAsISO8601DateTime(GetFieldIndex(pszFName), papszOptions);
1382 return GetFieldAsIntegerList(GetFieldIndex(pszFName), pnCount);
1388 return GetFieldAsInteger64List(GetFieldIndex(pszFName), pnCount);
1393 return GetFieldAsDoubleList(GetFieldIndex(pszFName), pnCount);
1398 return GetFieldAsStringList(GetFieldIndex(pszFName));
1401 void SetField(
int i,
int nValue);
1402 void SetField(
int i,
GIntBig nValue);
1403 void SetField(
int i,
double dfValue);
1404 void SetField(
int i,
const char *pszValue);
1405 void SetField(
int i,
int nCount,
const int *panValues);
1406 void SetField(
int i,
int nCount,
const GIntBig *panValues);
1407 void SetField(
int i,
int nCount,
const double *padfValues);
1408 void SetField(
int i,
const char *
const *papszValues);
1409 void SetField(
int i,
const OGRField *puValue);
1410 void SetField(
int i,
int nCount,
const void *pabyBinary);
1411 void SetField(
int i,
int nYear,
int nMonth,
int nDay,
int nHour = 0,
1412 int nMinute = 0,
float fSecond = 0.f,
int nTZFlag = 0);
1417 void SetFieldSameTypeUnsafe(
int i,
int nValue)
1419 pauFields[i].Integer = nValue;
1420 pauFields[i].Set.nMarker2 = 0;
1421 pauFields[i].Set.nMarker3 = 0;
1424 void SetFieldSameTypeUnsafe(
int i,
GIntBig nValue)
1426 pauFields[i].Integer64 = nValue;
1429 void SetFieldSameTypeUnsafe(
int i,
double dfValue)
1431 pauFields[i].Real = dfValue;
1434 void SetFieldSameTypeUnsafe(
int i,
char *pszValueTransferred)
1436 pauFields[i].String = pszValueTransferred;
1443 SetField(GetFieldIndex(pszFName), nValue);
1448 SetField(GetFieldIndex(pszFName), nValue);
1453 SetField(GetFieldIndex(pszFName), dfValue);
1456 void SetField(
const char *pszFName,
const char *pszValue)
1458 SetField(GetFieldIndex(pszFName), pszValue);
1461 void SetField(
const char *pszFName,
int nCount,
const int *panValues)
1463 SetField(GetFieldIndex(pszFName), nCount, panValues);
1468 SetField(GetFieldIndex(pszFName), nCount, panValues);
1471 void SetField(
const char *pszFName,
int nCount,
const double *padfValues)
1473 SetField(GetFieldIndex(pszFName), nCount, padfValues);
1476 void SetField(
const char *pszFName,
const char *
const *papszValues)
1478 SetField(GetFieldIndex(pszFName), papszValues);
1483 SetField(GetFieldIndex(pszFName), puValue);
1486 void SetField(
const char *pszFName,
int nYear,
int nMonth,
int nDay,
1487 int nHour = 0,
int nMinute = 0,
float fSecond = 0.f,
1490 SetField(GetFieldIndex(pszFName), nYear, nMonth, nDay, nHour, nMinute,
1501 void DumpReadable(FILE *,
CSLConstList papszOptions =
nullptr)
const;
1502 std::string DumpReadableAsString(
CSLConstList papszOptions =
nullptr)
const;
1505 OGRErr SetFrom(
const OGRFeature *,
const int *panMap,
int bForgiving = TRUE,
1506 bool bUseISO8601ForDateTimeAsString =
false);
1508 int bForgiving = TRUE,
1509 bool bUseISO8601ForDateTimeAsString =
false);
1515 const int *panRemapSource);
1518 int Validate(
int nValidateFlags,
int bEmitError)
const;
1519 void FillUnsetWithDefault(
int bNotNullableOnly,
char **papszOptions);
1521 bool SerializeToBinary(std::vector<GByte> &abyBuffer)
const;
1522 bool DeserializeFromBinary(
const GByte *pabyBuffer,
size_t nSize);
1524 virtual const char *GetStyleString()
const;
1525 virtual void SetStyleString(
const char *);
1526 virtual void SetStyleStringDirectly(
char *);
1533 return m_poStyleTable;
1537 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable);
1541 return m_pszNativeData;
1546 return m_pszNativeMediaType;
1549 void SetNativeData(
const char *pszNativeData);
1550 void SetNativeMediaType(
const char *pszNativeMediaType);
1568 return reinterpret_cast<OGRFeature *
>(hFeature);
1576struct CPL_DLL OGRFeatureUniquePtrDeleter
1586typedef std::unique_ptr<OGRFeature, OGRFeatureUniquePtrDeleter>
1593 return poFeature->
begin();
1599 return poFeature->
end();
1606 return poFeature->begin();
1612 return poFeature->end();
1647 std::string m_osName;
1648 std::string m_osDescription;
1655 OGRFieldDomain(
const std::string &osName,
const std::string &osDescription,
1689 return m_osDescription;
1698 return m_eDomainType;
1707 return m_eFieldType;
1716 return m_eFieldSubType;
1737 return m_eSplitPolicy;
1746 m_eSplitPolicy = policy;
1755 return m_eMergePolicy;
1764 m_eMergePolicy = policy;
1777 std::vector<OGRCodedValue> m_asValues{};
1799 const std::string &osDescription,
1801 std::vector<OGRCodedValue> &&asValues);
1814 return m_asValues.data();
1825 bool m_bMinIsInclusive;
1826 bool m_bMaxIsInclusive;
1860 const std::string &osDescription,
1862 const OGRField &sMin,
bool bMinIsInclusive,
1863 const OGRField &sMax,
bool bMaxIsInclusive);
1868 m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_sMin,
1869 m_bMinIsInclusive, m_sMax, m_bMaxIsInclusive);
1870 poDomain->SetMergePolicy(m_eMergePolicy);
1871 poDomain->SetSplitPolicy(m_eSplitPolicy);
1890 bIsInclusiveOut = m_bMinIsInclusive;
1909 bIsInclusiveOut = m_bMaxIsInclusive;
1921 std::string m_osGlob;
1938 const std::string &osDescription,
1940 const std::string &osBlob);
1945 m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_osGlob);
1946 poDomain->SetMergePolicy(m_eMergePolicy);
1947 poDomain->SetSplitPolicy(m_eSplitPolicy);
1968class swq_custom_func_registrar;
1969struct swq_evaluation_context;
1971class CPL_DLL OGRFeatureQuery
1976 swq_evaluation_context *m_psContext =
nullptr;
1978 char **FieldCollector(
void *,
char **);
1980 static GIntBig *EvaluateAgainstIndices(
const swq_expr_node *,
OGRLayer *,
1983 static int CanUseIndex(
const swq_expr_node *,
OGRLayer *);
1986 swq_custom_func_registrar *poCustomFuncRegistrar);
1995 swq_custom_func_registrar *poCustomFuncRegistrar =
nullptr);
1997 swq_custom_func_registrar *poCustomFuncRegistrar =
nullptr);
2004 char **GetUsedFields();
Definition of a coded / enumerated field domain.
Definition ogr_feature.h:1775
const OGRCodedValue * GetEnumeration() const
Get the enumeration as (code, value) pairs.
Definition ogr_feature.h:1812
Definition of a feature class or feature layer.
Definition ogr_feature.h:509
int Reference()
Increments the reference count by one.
Definition ogr_feature.h:779
virtual int GetFieldCount() const
Fetch number of fields on this feature.
Definition ogrfeaturedefn.cpp:262
virtual OGRFieldDefn * GetFieldDefn(int i)
Fetch field definition.
Definition ogrfeaturedefn.cpp:306
GeomFields GetGeomFields()
Return an object that can be used to iterate over geometry fields.
Definition ogr_feature.h:765
virtual bool IsStyleIgnored() const
Determine whether the style can be omitted when fetching features.
Definition ogr_feature.h:799
Fields GetFields()
Return an object that can be used to iterate over non-geometry fields.
Definition ogr_feature.h:621
int Dereference()
Decrements the reference count by one.
Definition ogr_feature.h:784
static OGRFeatureDefnH ToHandle(OGRFeatureDefn *poFeatureDefn)
Convert a OGRFeatureDefn* to a OGRFeatureDefnH.
Definition ogr_feature.h:824
static OGRFeatureDefn * FromHandle(OGRFeatureDefnH hFeatureDefn)
Convert a OGRFeatureDefnH to a OGRFeatureDefn*.
Definition ogr_feature.h:832
virtual OGRGeomFieldDefn * GetGeomFieldDefn(int i)
Fetch geometry field definition.
Definition ogrfeaturedefn.cpp:715
virtual int GetGeomFieldCount() const
Fetch number of geometry fields on this feature.
Definition ogrfeaturedefn.cpp:666
virtual int GetFieldIndex(const char *) const
Find field by name.
Definition ogrfeaturedefn.cpp:1274
int GetReferenceCount() const
Fetch current reference count.
Definition ogr_feature.h:789
virtual int GetGeomFieldIndex(const char *) const
Find geometry field by name.
Definition ogrfeaturedefn.cpp:965
virtual void SetStyleIgnored(bool bIgnore)
Set whether the style can be omitted when fetching features.
Definition ogr_feature.h:804
Field value iterator class.
Definition ogr_feature.h:1144
Exception raised by operator[](const char*) when a field is not found.
Definition ogr_feature.h:1190
Field value.
Definition ogr_feature.h:934
bool empty() const
Return whether the field value is unset/empty.
Definition ogr_feature.h:1013
int GetInteger() const
Return the integer value.
Definition ogr_feature.h:1033
OGRFieldType GetType() const
Return field type.
Definition ogr_feature.h:1000
void Unset()
Unset the field.
Definition ogr_feature.h:979
double GetDouble() const
Return the double value.
Definition ogr_feature.h:1051
const char * GetName() const
Return field name.
Definition ogr_feature.h:994
GIntBig GetInteger64() const
Return the 64-bit integer value.
Definition ogr_feature.h:1042
OGRFieldSubType GetSubType() const
Return field subtype.
Definition ogr_feature.h:1006
const char * GetString() const
Return the string value.
Definition ogr_feature.h:1060
A simple feature, including geometry and attributes.
Definition ogr_feature.h:908
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition ogr_feature.h:1196
const char * GetFieldAsISO8601DateTime(const char *pszFName, CSLConstList papszOptions) const
Fetch OFTDateTime field value as a ISO8601 representation.
Definition ogr_feature.h:1374
static OGRFeatureH ToHandle(OGRFeature *poFeature)
Convert a OGRFeature* to a OGRFeatureH.
Definition ogr_feature.h:1558
char ** GetFieldAsStringList(const char *pszFName) const
Fetch field value as a list of strings.
Definition ogr_feature.h:1396
ConstFieldIterator end() const
Return end of field value iterator.
Definition ogrfeature.cpp:8424
ConstFieldIterator begin() const
Return begin of field value iterator.
Definition ogrfeature.cpp:8419
void SetField(const char *pszFName, int nCount, const GIntBig *panValues)
Set field to list of 64 bit integers value.
Definition ogr_feature.h:1466
const OGRFeatureDefn * GetDefnRef() const
Fetch feature definition.
Definition ogr_feature.h:1201
OGRFieldDefn * GetFieldDefnRef(int iField)
Fetch definition for this field.
Definition ogr_feature.h:1261
const double * GetFieldAsDoubleList(const char *pszFName, int *pnCount) const
Fetch field value as a list of doubles.
Definition ogr_feature.h:1391
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:1461
void SetField(const char *pszFName, GIntBig nValue)
Set field to 64 bit integer value.
Definition ogr_feature.h:1446
void SetField(const char *pszFName, const char *pszValue)
Set field to string value.
Definition ogr_feature.h:1456
void SetField(const char *pszFName, int nValue)
Set field to integer value.
Definition ogr_feature.h:1441
const OGRFieldDefn * GetFieldDefnRef(int iField) const
Fetch definition for this field.
Definition ogr_feature.h:1256
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:1486
const OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField) const
Fetch definition for this geometry field.
Definition ogr_feature.h:1227
const char * GetNativeData() const
Returns the native data for the feature.
Definition ogr_feature.h:1539
int GetFieldIndex(const char *pszName) const
Fetch the field index given field name.
Definition ogr_feature.h:1266
int GetGeomFieldIndex(const char *pszName) const
Fetch the geometry field index given geometry field name.
Definition ogr_feature.h:1232
OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField)
Fetch definition for this geometry field.
Definition ogr_feature.h:1222
GIntBig GetFieldAsInteger64(const char *pszFName) const
Fetch field value as integer 64 bit.
Definition ogr_feature.h:1359
const int * GetFieldAsIntegerList(const char *pszFName, int *pnCount) const
Fetch field value as a list of integers.
Definition ogr_feature.h:1380
void SetField(const char *pszFName, double dfValue)
Set field to double value.
Definition ogr_feature.h:1451
const char * GetFieldAsString(const char *pszFName) const
Fetch field value as a string.
Definition ogr_feature.h:1369
void SetField(const char *pszFName, const char *const *papszValues)
This method currently on has an effect of OFTStringList fields.
Definition ogr_feature.h:1476
const OGRField * GetRawFieldRef(int i) const
Fetch a pointer to the internal field value given the index.
Definition ogr_feature.h:1286
int GetFieldAsInteger(const char *pszFName) const
Fetch field value as integer.
Definition ogr_feature.h:1354
const char * GetNativeMediaType() const
Returns the native media type for the feature.
Definition ogr_feature.h:1544
void SetField(const char *pszFName, const OGRField *puValue)
Set field.
Definition ogr_feature.h:1481
GIntBig GetFID() const
Get feature identifier.
Definition ogr_feature.h:1494
OGRField * GetRawFieldRef(int i)
Fetch a pointer to the internal field value given the index.
Definition ogr_feature.h:1281
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:1471
virtual OGRStyleTable * GetStyleTable() const
Return style table.
Definition ogr_feature.h:1531
double GetFieldAsDouble(const char *pszFName) const
Fetch field value as a double.
Definition ogr_feature.h:1364
static OGRFeature * FromHandle(OGRFeatureH hFeature)
Convert a OGRFeatureH to a OGRFeature*.
Definition ogr_feature.h:1566
const GIntBig * GetFieldAsInteger64List(const char *pszFName, int *pnCount) const
Fetch field value as a list of 64 bit integers.
Definition ogr_feature.h:1385
Definition of an attribute of an OGRFeatureDefn.
Definition ogr_feature.h:69
const char * GetNameRef() const
Fetch name of this field.
Definition ogr_feature.h:108
void Unseal()
Unseal a OGRFieldDefn.
Definition ogrfielddefn.cpp:2314
int IsNullable() const
Return whether this field can receive null values.
Definition ogr_feature.h:186
void Seal()
Seal a OGRFieldDefn.
Definition ogrfielddefn.cpp:2295
int IsUnique() const
Return whether this field has a unique constraint.
Definition ogr_feature.h:193
OGRFieldSubType GetSubType() const
Fetch subtype of this field.
Definition ogr_feature.h:129
bool IsGenerated() const
Return whether the field is a generated field.
Definition ogr_feature.h:206
OGRJustification GetJustify() const
Get the justification for this field.
Definition ogr_feature.h:138
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition ogr_feature.h:181
int GetPrecision() const
Get the formatting precision for this field.
Definition ogr_feature.h:155
OGRFieldType GetType() const
Fetch type of this field.
Definition ogr_feature.h:120
int GetWidth() const
Get the formatting width for this field.
Definition ogr_feature.h:148
const std::string & GetComment() const
Return the (optional) comment for this field.
Definition ogr_feature.h:230
int GetTZFlag() const
Get the time zone flag.
Definition ogr_feature.h:162
void SetGenerated(bool bGeneratedIn)
SetGenerated set the field generated status.
Definition ogr_feature.h:216
void SetJustify(OGRJustification eJustifyIn)
Set the justification for this field.
Definition ogr_feature.h:143
const char * GetAlternativeNameRef() const
Fetch the alternative name (or "alias") for this field.
Definition ogr_feature.h:115
static OGRFieldDefnH ToHandle(OGRFieldDefn *poFieldDefn)
Convert a OGRFieldDefn* to a OGRFieldDefnH.
Definition ogr_feature.h:242
const std::string & GetDomainName() const
Return the name of the field domain for this field.
Definition ogr_feature.h:223
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition ogr_feature.h:176
static OGRFieldDefn * FromHandle(OGRFieldDefnH hFieldDefn)
Convert a OGRFieldDefnH to a OGRFieldDefn*.
Definition ogr_feature.h:250
Definition of a field domain.
Definition ogr_feature.h:1644
OGRFieldDomainMergePolicy GetMergePolicy() const
Get the merge policy.
Definition ogr_feature.h:1753
void SetMergePolicy(OGRFieldDomainMergePolicy policy)
Set the merge policy.
Definition ogr_feature.h:1762
static OGRFieldDomain * FromHandle(OGRFieldDomainH hFieldDomain)
Convert a OGRFieldDomainH to a OGRFieldDomain*.
Definition ogr_feature.h:1726
virtual OGRFieldDomain * Clone() const =0
Clone.
OGRFieldSubType GetFieldSubType() const
Get the field subtype.
Definition ogr_feature.h:1714
const std::string & GetName() const
Get the name of the field domain.
Definition ogr_feature.h:1677
virtual ~OGRFieldDomain()=0
Destructor.
const std::string & GetDescription() const
Get the description of the field domain.
Definition ogr_feature.h:1687
OGRFieldDomainSplitPolicy GetSplitPolicy() const
Get the split policy.
Definition ogr_feature.h:1735
static OGRFieldDomainH ToHandle(OGRFieldDomain *poFieldDomain)
Convert a OGRFieldDomain* to a OGRFieldDomainH.
Definition ogr_feature.h:1720
OGRFieldType GetFieldType() const
Get the field type.
Definition ogr_feature.h:1705
OGRFieldDomainType GetDomainType() const
Get the type of the field domain.
Definition ogr_feature.h:1696
void SetSplitPolicy(OGRFieldDomainSplitPolicy policy)
Set the split policy.
Definition ogr_feature.h:1744
Definition of a geometry field of an OGRFeatureDefn.
Definition ogr_feature.h:335
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition ogr_feature.h:384
void Seal()
Seal a OGRGeomFieldDefn.
Definition ogrgeomfielddefn.cpp:884
void Unseal()
Unseal a OGRGeomFieldDefn.
Definition ogrgeomfielddefn.cpp:903
static OGRGeomFieldDefn * FromHandle(OGRGeomFieldDefnH hGeomFieldDefn)
Convert a OGRGeomFieldDefnH to a OGRGeomFieldDefn*.
Definition ogr_feature.h:416
int IsNullable() const
Return whether this geometry field can receive null values.
Definition ogr_feature.h:389
OGRwkbGeometryType GetType() const
Fetch geometry type of this field.
Definition ogr_feature.h:369
const OGRGeomCoordinatePrecision & GetCoordinatePrecision() const
Return the coordinate precision associated to this geometry field.
Definition ogr_feature.h:396
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition ogr_feature.h:379
static OGRGeomFieldDefnH ToHandle(OGRGeomFieldDefn *poGeomFieldDefn)
Convert a OGRGeomFieldDefn* to a OGRGeomFieldDefnH.
Definition ogr_feature.h:408
const char * GetNameRef() const
Fetch name of this field.
Definition ogr_feature.h:364
Abstract base class for all geometry classes.
Definition ogr_geometry.h:360
Definition of a field domain for field content validated by a glob.
Definition ogr_feature.h:1919
OGRGlobFieldDomain * Clone() const override
Clone.
Definition ogr_feature.h:1942
const std::string & GetGlob() const
Get the glob expression.
Definition ogr_feature.h:1955
This class represents a layer of simple features, with access methods.
Definition ogrsf_frmts.h:61
Definition of a numeric field domain with a range of validity for values.
Definition ogr_feature.h:1821
OGRRangeFieldDomain * Clone() const override
Clone.
Definition ogr_feature.h:1865
const OGRField & GetMax(bool &bIsInclusiveOut) const
Get the maximum value.
Definition ogr_feature.h:1907
const OGRField & GetMin(bool &bIsInclusiveOut) const
Get the minimum value.
Definition ogr_feature.h:1888
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
This class represents a style table.
Definition ogr_featurestyle.h:69
#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:962
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1111
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:896
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:205
Forward definitions of GDAL/OGR/OSR C handle types.
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition gdal_fwd.h:119
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition gdal_fwd.h:121
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition gdal_fwd.h:138
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition gdal_fwd.h:128
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition gdal_fwd.h:125
#define OGRUnsetMarker
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a unset field.
Definition ogr_core.h:863
#define OGR_TZFLAG_UNKNOWN
Time zone flag indicating unknown timezone.
Definition ogr_core.h:877
int OGRBoolean
Type for a OGR boolean.
Definition ogr_core.h:387
OGRFieldSubType
List of field subtypes.
Definition ogr_core.h:816
OGRFieldDomainMergePolicy
Merge policy for field domains.
Definition ogr_core.h:1271
@ OFDMP_DEFAULT_VALUE
Default value.
Definition ogr_core.h:1273
OGRFieldDomainType
Type of field domain.
Definition ogr_core.h:1236
OGRJustification
Display justification for field values.
Definition ogr_core.h:841
OGRFieldType
List of feature field types.
Definition ogr_core.h:788
#define OGRNullMarker
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a null field.
Definition ogr_core.h:871
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:406
@ wkbUnknown
unknown type, non-standard
Definition ogr_core.h:407
int OGRErr
Type for a OGR error.
Definition ogr_core.h:370
OGRFieldDomainSplitPolicy
Split policy for field domains.
Definition ogr_core.h:1253
@ OFDSP_DEFAULT_VALUE
Default value.
Definition ogr_core.h:1255
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition ogr_feature.h:1587
Simple feature style classes.
Geometry coordinate precision class.
Simple feature geometry classes.
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:467
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:475
Associates a code and a value.
Definition ogr_core.h:1223
Geometry coordinate precision.
Definition ogr_geomcoordinateprecision.h:40
OGRFeature field attribute value union.
Definition ogr_core.h:905