15#ifndef OGR_FEATURE_H_INCLUDED
16#define OGR_FEATURE_H_INCLUDED
18#include "cpl_atomic_ops.h"
21#include "ogr_geomcoordinateprecision.h"
36#ifndef DEFINE_OGRFeatureH
38#define DEFINE_OGRFeatureH
98 char *pszAlternativeName;
111 std::string m_osDomainName{};
113 std::string m_osComment{};
116 bool m_bSealed =
false;
123 void SetName(
const char *);
130 void SetAlternativeName(
const char *);
134 return pszAlternativeName;
160 eJustify = eJustifyIn;
168 void SetWidth(
int nWidthIn);
175 void SetPrecision(
int nPrecisionIn);
182 void SetTZFlag(
int nTZFlag);
187 void SetDefault(
const char *);
188 const char *GetDefault()
const;
189 int IsDefaultDriverSpecific()
const;
206 void SetNullable(
int bNullableIn);
213 void SetUnique(
int bUniqueIn);
217 return m_osDomainName;
220 void SetDomainName(
const std::string &osDomainName);
227 void SetComment(
const std::string &osComment);
252 struct CPL_DLL TemporaryUnsealer
259 : m_poFieldDefn(poFieldDefn)
264 TemporaryUnsealer(TemporaryUnsealer &&) =
default;
265 TemporaryUnsealer &operator=(TemporaryUnsealer &&) =
default;
269 m_poFieldDefn->
Seal();
274 return m_poFieldDefn;
280 TemporaryUnsealer GetTemporaryUnsealer();
286#ifdef GDAL_COMPILATION
298inline OGRFieldDefn::TemporaryUnsealer whileUnsealing(
OGRFieldDefn *
object)
300 return object->GetTemporaryUnsealer();
333 char *pszName =
nullptr;
339 mutable int bNullable =
true;
340 bool m_bSealed =
false;
351 void SetName(
const char *);
383 void SetNullable(
int bNullableIn);
387 return m_oCoordPrecision;
415 struct CPL_DLL TemporaryUnsealer
422 : m_poFieldDefn(poFieldDefn)
427 TemporaryUnsealer(TemporaryUnsealer &&) =
default;
428 TemporaryUnsealer &operator=(TemporaryUnsealer &&) =
default;
432 m_poFieldDefn->
Seal();
437 return m_poFieldDefn;
443 TemporaryUnsealer GetTemporaryUnsealer();
449#ifdef GDAL_COMPILATION
461inline OGRGeomFieldDefn::TemporaryUnsealer
464 return object->GetTemporaryUnsealer();
504 volatile int nRefCount = 0;
506 mutable std::vector<std::unique_ptr<OGRFieldDefn>> apoFieldDefn{};
507 mutable std::vector<std::unique_ptr<OGRGeomFieldDefn>> apoGeomFieldDefn{};
509 char *pszFeatureClassName =
nullptr;
511 bool bIgnoreStyle =
false;
513 friend class TemporaryUnsealer;
514 bool m_bSealed =
false;
515 int m_nTemporaryUnsealCount = 0;
522 void SetName(
const char *pszName);
523 virtual const char *GetName()
const;
525 virtual int GetFieldCount()
const;
528 virtual int GetFieldIndex(
const char *)
const;
529 int GetFieldIndexCaseSensitive(
const char *)
const;
536 struct CPL_DLL Fields
542 inline explicit Fields(
OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
546 struct CPL_DLL ConstIterator
554 : m_poFDefn(poFDefn), m_nIdx(nIdx)
563 inline ConstIterator &operator++()
569 inline bool operator!=(
const ConstIterator &it)
const
571 return m_nIdx != it.m_nIdx;
575 inline ConstIterator
begin()
577 return ConstIterator(m_poFDefn, 0);
580 inline ConstIterator
end()
585 inline size_t size()
const
621 int GetFieldCountUnsafe()
const
623 return static_cast<int>(apoFieldDefn.size());
629 if (apoFieldDefn.empty())
631 return apoFieldDefn[
static_cast<std::size_t
>(i)].get();
636 if (apoFieldDefn.empty())
638 return apoFieldDefn[
static_cast<std::size_t
>(i)].get();
644 virtual OGRErr DeleteFieldDefn(
int iField);
645 virtual OGRErr ReorderFieldDefns(
const int *panMap);
647 virtual int GetGeomFieldCount()
const;
650 virtual int GetGeomFieldIndex(
const char *)
const;
657 struct CPL_DLL GeomFields
663 inline explicit GeomFields(
OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
667 struct CPL_DLL ConstIterator
675 : m_poFDefn(poFDefn), m_nIdx(nIdx)
684 inline ConstIterator &operator++()
690 inline bool operator!=(
const ConstIterator &it)
const
692 return m_nIdx != it.m_nIdx;
696 inline ConstIterator
begin()
698 return ConstIterator(m_poFDefn, 0);
701 inline ConstIterator
end()
706 inline size_t size()
const
736 return GeomFields(
this);
740 virtual void AddGeomFieldDefn(std::unique_ptr<OGRGeomFieldDefn> &&);
741 virtual OGRErr DeleteGeomFieldDefn(
int iGeomField);
750 return CPLAtomicInc(&nRefCount);
755 return CPLAtomicDec(&nRefCount);
765 virtual int IsGeometryIgnored()
const;
766 virtual void SetGeometryIgnored(
int bIgnore);
775 bIgnoreStyle = bIgnore;
778 virtual int IsSame(
const OGRFeatureDefn *poOtherFeatureDefn)
const;
781 void ReserveSpaceForFields(
int nFieldCountIn);
784 std::vector<int> ComputeMapForSetFrom(
const OGRFeatureDefn *poSrcFDefn,
785 bool bForgiving =
true)
const;
787 static OGRFeatureDefn *CreateFeatureDefn(
const char *pszName =
nullptr);
806 void Seal(
bool bSealFields);
808 void Unseal(
bool bUnsealFields);
811 struct CPL_DLL TemporaryUnsealer
815 bool m_bSealFields =
false;
821 TemporaryUnsealer(TemporaryUnsealer &&) =
default;
822 TemporaryUnsealer &operator=(TemporaryUnsealer &&) =
default;
824 ~TemporaryUnsealer();
828 return m_poFeatureDefn;
834 TemporaryUnsealer GetTemporaryUnsealer(
bool bSealFields =
true);
840#ifdef GDAL_COMPILATION
861inline OGRFeatureDefn::TemporaryUnsealer whileUnsealing(
OGRFeatureDefn *
object,
862 bool bSealFields =
true)
864 return object->GetTemporaryUnsealer(bSealFields);
883 char *m_pszNativeData;
884 char *m_pszNativeMediaType;
886 bool SetFieldInternal(
int i,
const OGRField *puValue);
890 mutable char *m_pszStyleString;
892 mutable char *m_pszTmpFieldValue;
906 std::unique_ptr<Private> m_poPrivate;
931 FieldValue &operator=(
const std::string &osVal);
933 FieldValue &operator=(
const std::vector<int> &oArray);
935 FieldValue &operator=(
const std::vector<GIntBig> &oArray);
937 FieldValue &operator=(
const std::vector<double> &oArray);
939 FieldValue &operator=(
const std::vector<std::string> &oArray);
954 void SetDateTime(
int nYear,
int nMonth,
int nDay,
int nHour = 0,
955 int nMinute = 0,
float fSecond = 0.f,
int nTZFlag = 0);
958 int GetIndex()
const;
965 return GetDefn()->GetNameRef();
971 return GetDefn()->GetType();
977 return GetDefn()->GetSubType();
989 bool IsUnset()
const;
996 const OGRField *GetRawValue()
const;
1004 return GetRawValue()->Integer;
1013 return GetRawValue()->Integer64;
1022 return GetRawValue()->Real;
1031 return GetRawValue()->String;
1035 bool GetDateTime(
int *pnYear,
int *pnMonth,
int *pnDay,
int *pnHour,
1036 int *pnMinute,
float *pfSecond,
int *pnTZFlag)
const;
1039 operator int()
const
1041 return GetAsInteger();
1048 return GetAsInteger64();
1052 operator double()
const
1054 return GetAsDouble();
1058 operator const char *()
const
1060 return GetAsString();
1064 operator const std::vector<int> &()
const
1066 return GetAsIntegerList();
1071 operator const std::vector<GIntBig> &()
const
1073 return GetAsInteger64List();
1077 operator const std::vector<double> &()
const
1079 return GetAsDoubleList();
1083 operator const std::vector<std::string> &()
const
1085 return GetAsStringList();
1092 int GetAsInteger()
const;
1095 GIntBig GetAsInteger64()
const;
1097 double GetAsDouble()
const;
1099 const char *GetAsString()
const;
1101 const std::vector<int> &GetAsIntegerList()
const;
1104 const std::vector<GIntBig> &GetAsInteger64List()
const;
1106 const std::vector<double> &GetAsDoubleList()
const;
1108 const std::vector<std::string> &GetAsStringList()
const;
1116 std::unique_ptr<Private> m_poPrivate;
1153 const FieldValue operator[](
int iField)
const;
1162 const FieldValue operator[](
const char *pszFieldName)
const;
1163 FieldValue operator[](
const char *pszFieldName);
1185 int GetGeomFieldCount()
const
1206 const OGRGeometry *GetGeomFieldRef(
int iField)
const;
1208 OGRGeometry *GetGeomFieldRef(
const char *pszFName);
1209 const OGRGeometry *GetGeomFieldRef(
const char *pszFName)
const;
1218 int GetFieldCount()
const
1238 int IsFieldSet(
int iField)
const;
1240 void UnsetField(
int iField);
1242 bool IsFieldNull(
int iField)
const;
1244 void SetFieldNull(
int iField);
1246 bool IsFieldSetAndNotNull(
int iField)
const;
1250 return pauFields + i;
1255 return pauFields + i;
1258 int GetFieldAsInteger(
int i)
const;
1259 GIntBig GetFieldAsInteger64(
int i)
const;
1260 double GetFieldAsDouble(
int i)
const;
1261 const char *GetFieldAsString(
int i)
const;
1262 const char *GetFieldAsISO8601DateTime(
int i,
1264 const int *GetFieldAsIntegerList(
int i,
int *pnCount)
const;
1265 const GIntBig *GetFieldAsInteger64List(
int i,
int *pnCount)
const;
1266 const double *GetFieldAsDoubleList(
int i,
int *pnCount)
const;
1267 char **GetFieldAsStringList(
int i)
const;
1268 GByte *GetFieldAsBinary(
int i,
int *pnCount)
const;
1269 int GetFieldAsDateTime(
int i,
int *pnYear,
int *pnMonth,
int *pnDay,
1270 int *pnHour,
int *pnMinute,
int *pnSecond,
1271 int *pnTZFlag)
const;
1272 int GetFieldAsDateTime(
int i,
int *pnYear,
int *pnMonth,
int *pnDay,
1273 int *pnHour,
int *pnMinute,
float *pfSecond,
1274 int *pnTZFlag)
const;
1275 char *GetFieldAsSerializedJSon(
int i)
const;
1278 bool IsFieldSetUnsafe(
int i)
const
1285 bool IsFieldNullUnsafe(
int i)
const
1292 bool IsFieldSetAndNotNullUnsafe(
int i)
const
1294 return IsFieldSetUnsafe(i) && !IsFieldNullUnsafe(i);
1299 int GetFieldAsIntegerUnsafe(
int i)
const
1301 return pauFields[i].Integer;
1304 GIntBig GetFieldAsInteger64Unsafe(
int i)
const
1306 return pauFields[i].Integer64;
1309 double GetFieldAsDoubleUnsafe(
int i)
const
1311 return pauFields[i].Real;
1314 const char *GetFieldAsStringUnsafe(
int i)
const
1316 return pauFields[i].String;
1323 return GetFieldAsInteger(GetFieldIndex(pszFName));
1328 return GetFieldAsInteger64(GetFieldIndex(pszFName));
1333 return GetFieldAsDouble(GetFieldIndex(pszFName));
1338 return GetFieldAsString(GetFieldIndex(pszFName));
1344 return GetFieldAsISO8601DateTime(GetFieldIndex(pszFName), papszOptions);
1349 return GetFieldAsIntegerList(GetFieldIndex(pszFName), pnCount);
1355 return GetFieldAsInteger64List(GetFieldIndex(pszFName), pnCount);
1360 return GetFieldAsDoubleList(GetFieldIndex(pszFName), pnCount);
1365 return GetFieldAsStringList(GetFieldIndex(pszFName));
1368 void SetField(
int i,
int nValue);
1369 void SetField(
int i,
GIntBig nValue);
1370 void SetField(
int i,
double dfValue);
1371 void SetField(
int i,
const char *pszValue);
1372 void SetField(
int i,
int nCount,
const int *panValues);
1373 void SetField(
int i,
int nCount,
const GIntBig *panValues);
1374 void SetField(
int i,
int nCount,
const double *padfValues);
1375 void SetField(
int i,
const char *
const *papszValues);
1376 void SetField(
int i,
const OGRField *puValue);
1377 void SetField(
int i,
int nCount,
const void *pabyBinary);
1378 void SetField(
int i,
int nYear,
int nMonth,
int nDay,
int nHour = 0,
1379 int nMinute = 0,
float fSecond = 0.f,
int nTZFlag = 0);
1384 void SetFieldSameTypeUnsafe(
int i,
int nValue)
1386 pauFields[i].Integer = nValue;
1387 pauFields[i].Set.nMarker2 = 0;
1388 pauFields[i].Set.nMarker3 = 0;
1391 void SetFieldSameTypeUnsafe(
int i,
GIntBig nValue)
1393 pauFields[i].Integer64 = nValue;
1396 void SetFieldSameTypeUnsafe(
int i,
double dfValue)
1398 pauFields[i].Real = dfValue;
1401 void SetFieldSameTypeUnsafe(
int i,
char *pszValueTransferred)
1403 pauFields[i].String = pszValueTransferred;
1410 SetField(GetFieldIndex(pszFName), nValue);
1415 SetField(GetFieldIndex(pszFName), nValue);
1420 SetField(GetFieldIndex(pszFName), dfValue);
1423 void SetField(
const char *pszFName,
const char *pszValue)
1425 SetField(GetFieldIndex(pszFName), pszValue);
1428 void SetField(
const char *pszFName,
int nCount,
const int *panValues)
1430 SetField(GetFieldIndex(pszFName), nCount, panValues);
1435 SetField(GetFieldIndex(pszFName), nCount, panValues);
1438 void SetField(
const char *pszFName,
int nCount,
const double *padfValues)
1440 SetField(GetFieldIndex(pszFName), nCount, padfValues);
1443 void SetField(
const char *pszFName,
const char *
const *papszValues)
1445 SetField(GetFieldIndex(pszFName), papszValues);
1450 SetField(GetFieldIndex(pszFName), puValue);
1453 void SetField(
const char *pszFName,
int nYear,
int nMonth,
int nDay,
1454 int nHour = 0,
int nMinute = 0,
float fSecond = 0.f,
1457 SetField(GetFieldIndex(pszFName), nYear, nMonth, nDay, nHour, nMinute,
1468 void DumpReadable(FILE *,
CSLConstList papszOptions =
nullptr)
const;
1469 std::string DumpReadableAsString(
CSLConstList papszOptions =
nullptr)
const;
1472 OGRErr SetFrom(
const OGRFeature *,
const int *panMap,
int bForgiving = TRUE,
1473 bool bUseISO8601ForDateTimeAsString =
false);
1475 int bForgiving = TRUE,
1476 bool bUseISO8601ForDateTimeAsString =
false);
1482 const int *panRemapSource);
1485 int Validate(
int nValidateFlags,
int bEmitError)
const;
1486 void FillUnsetWithDefault(
int bNotNullableOnly,
char **papszOptions);
1488 bool SerializeToBinary(std::vector<GByte> &abyBuffer)
const;
1489 bool DeserializeFromBinary(
const GByte *pabyBuffer,
size_t nSize);
1491 virtual const char *GetStyleString()
const;
1492 virtual void SetStyleString(
const char *);
1493 virtual void SetStyleStringDirectly(
char *);
1500 return m_poStyleTable;
1504 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable);
1508 return m_pszNativeData;
1513 return m_pszNativeMediaType;
1516 void SetNativeData(
const char *pszNativeData);
1517 void SetNativeMediaType(
const char *pszNativeMediaType);
1535 return reinterpret_cast<OGRFeature *
>(hFeature);
1543struct CPL_DLL OGRFeatureUniquePtrDeleter
1553typedef std::unique_ptr<OGRFeature, OGRFeatureUniquePtrDeleter>
1560 return poFeature->
begin();
1566 return poFeature->
end();
1573 return poFeature->begin();
1579 return poFeature->end();
1614 std::string m_osName;
1615 std::string m_osDescription;
1622 OGRFieldDomain(
const std::string &osName,
const std::string &osDescription,
1656 return m_osDescription;
1665 return m_eDomainType;
1674 return m_eFieldType;
1683 return m_eFieldSubType;
1704 return m_eSplitPolicy;
1713 m_eSplitPolicy = policy;
1722 return m_eMergePolicy;
1731 m_eMergePolicy = policy;
1744 std::vector<OGRCodedValue> m_asValues{};
1766 const std::string &osDescription,
1768 std::vector<OGRCodedValue> &&asValues);
1781 return m_asValues.data();
1792 bool m_bMinIsInclusive;
1793 bool m_bMaxIsInclusive;
1827 const std::string &osDescription,
1829 const OGRField &sMin,
bool bMinIsInclusive,
1830 const OGRField &sMax,
bool bMaxIsInclusive);
1835 m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_sMin,
1836 m_bMinIsInclusive, m_sMax, m_bMaxIsInclusive);
1837 poDomain->SetMergePolicy(m_eMergePolicy);
1838 poDomain->SetSplitPolicy(m_eSplitPolicy);
1857 bIsInclusiveOut = m_bMinIsInclusive;
1876 bIsInclusiveOut = m_bMaxIsInclusive;
1888 std::string m_osGlob;
1905 const std::string &osDescription,
1907 const std::string &osBlob);
1912 m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_osGlob);
1913 poDomain->SetMergePolicy(m_eMergePolicy);
1914 poDomain->SetSplitPolicy(m_eSplitPolicy);
1935class swq_custom_func_registrar;
1936struct swq_evaluation_context;
1938class CPL_DLL OGRFeatureQuery
1943 swq_evaluation_context *m_psContext =
nullptr;
1945 char **FieldCollector(
void *,
char **);
1947 static GIntBig *EvaluateAgainstIndices(
const swq_expr_node *,
OGRLayer *,
1950 static int CanUseIndex(
const swq_expr_node *,
OGRLayer *);
1953 swq_custom_func_registrar *poCustomFuncRegistrar);
1962 swq_custom_func_registrar *poCustomFuncRegistrar =
nullptr);
1964 swq_custom_func_registrar *poCustomFuncRegistrar =
nullptr);
1971 char **GetUsedFields();
Definition of a coded / enumerated field domain.
Definition ogr_feature.h:1742
const OGRCodedValue * GetEnumeration() const
Get the enumeration as (code, value) pairs.
Definition ogr_feature.h:1779
Definition of a feature class or feature layer.
Definition ogr_feature.h:501
int Reference()
Increments the reference count by one.
Definition ogr_feature.h:748
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:734
virtual bool IsStyleIgnored() const
Determine whether the style can be omitted when fetching features.
Definition ogr_feature.h:768
Fields GetFields()
Return an object that can be used to iterate over non-geometry fields.
Definition ogr_feature.h:613
int Dereference()
Decrements the reference count by one.
Definition ogr_feature.h:753
static OGRFeatureDefnH ToHandle(OGRFeatureDefn *poFeatureDefn)
Convert a OGRFeatureDefn* to a OGRFeatureDefnH.
Definition ogr_feature.h:793
static OGRFeatureDefn * FromHandle(OGRFeatureDefnH hFeatureDefn)
Convert a OGRFeatureDefnH to a OGRFeatureDefn*.
Definition ogr_feature.h:801
virtual OGRGeomFieldDefn * GetGeomFieldDefn(int i)
Fetch geometry field definition.
Definition ogrfeaturedefn.cpp:656
virtual int GetGeomFieldCount() const
Fetch number of geometry fields on this feature.
Definition ogrfeaturedefn.cpp:607
virtual int GetFieldIndex(const char *) const
Find field by name.
Definition ogrfeaturedefn.cpp:1215
int GetReferenceCount() const
Fetch current reference count.
Definition ogr_feature.h:758
virtual int GetGeomFieldIndex(const char *) const
Find geometry field by name.
Definition ogrfeaturedefn.cpp:906
virtual void SetStyleIgnored(bool bIgnore)
Set whether the style can be omitted when fetching features.
Definition ogr_feature.h:773
Field value iterator class.
Definition ogr_feature.h:1113
Exception raised by operator[](const char*) when a field is not found.
Definition ogr_feature.h:1159
Field value.
Definition ogr_feature.h:903
bool empty() const
Return whether the field value is unset/empty.
Definition ogr_feature.h:982
int GetInteger() const
Return the integer value.
Definition ogr_feature.h:1002
OGRFieldType GetType() const
Return field type.
Definition ogr_feature.h:969
void Unset()
Unset the field.
Definition ogr_feature.h:948
double GetDouble() const
Return the double value.
Definition ogr_feature.h:1020
const char * GetName() const
Return field name.
Definition ogr_feature.h:963
GIntBig GetInteger64() const
Return the 64-bit integer value.
Definition ogr_feature.h:1011
OGRFieldSubType GetSubType() const
Return field subtype.
Definition ogr_feature.h:975
const char * GetString() const
Return the string value.
Definition ogr_feature.h:1029
A simple feature, including geometry and attributes.
Definition ogr_feature.h:877
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition ogr_feature.h:1165
const char * GetFieldAsISO8601DateTime(const char *pszFName, CSLConstList papszOptions) const
Fetch OFTDateTime field value as a ISO8601 representation.
Definition ogr_feature.h:1341
static OGRFeatureH ToHandle(OGRFeature *poFeature)
Convert a OGRFeature* to a OGRFeatureH.
Definition ogr_feature.h:1525
char ** GetFieldAsStringList(const char *pszFName) const
Fetch field value as a list of strings.
Definition ogr_feature.h:1363
ConstFieldIterator end() const
Return end of field value iterator.
Definition ogrfeature.cpp:8361
ConstFieldIterator begin() const
Return begin of field value iterator.
Definition ogrfeature.cpp:8356
void SetField(const char *pszFName, int nCount, const GIntBig *panValues)
Set field to list of 64 bit integers value.
Definition ogr_feature.h:1433
const OGRFeatureDefn * GetDefnRef() const
Fetch feature definition.
Definition ogr_feature.h:1170
OGRFieldDefn * GetFieldDefnRef(int iField)
Fetch definition for this field.
Definition ogr_feature.h:1228
const double * GetFieldAsDoubleList(const char *pszFName, int *pnCount) const
Fetch field value as a list of doubles.
Definition ogr_feature.h:1358
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:1428
void SetField(const char *pszFName, GIntBig nValue)
Set field to 64 bit integer value.
Definition ogr_feature.h:1413
void SetField(const char *pszFName, const char *pszValue)
Set field to string value.
Definition ogr_feature.h:1423
void SetField(const char *pszFName, int nValue)
Set field to integer value.
Definition ogr_feature.h:1408
const OGRFieldDefn * GetFieldDefnRef(int iField) const
Fetch definition for this field.
Definition ogr_feature.h:1223
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:1453
const OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField) const
Fetch definition for this geometry field.
Definition ogr_feature.h:1195
const char * GetNativeData() const
Returns the native data for the feature.
Definition ogr_feature.h:1506
int GetFieldIndex(const char *pszName) const
Fetch the field index given field name.
Definition ogr_feature.h:1233
int GetGeomFieldIndex(const char *pszName) const
Fetch the geometry field index given geometry field name.
Definition ogr_feature.h:1200
OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField)
Fetch definition for this geometry field.
Definition ogr_feature.h:1190
GIntBig GetFieldAsInteger64(const char *pszFName) const
Fetch field value as integer 64 bit.
Definition ogr_feature.h:1326
const int * GetFieldAsIntegerList(const char *pszFName, int *pnCount) const
Fetch field value as a list of integers.
Definition ogr_feature.h:1347
void SetField(const char *pszFName, double dfValue)
Set field to double value.
Definition ogr_feature.h:1418
const char * GetFieldAsString(const char *pszFName) const
Fetch field value as a string.
Definition ogr_feature.h:1336
void SetField(const char *pszFName, const char *const *papszValues)
This method currently on has an effect of OFTStringList fields.
Definition ogr_feature.h:1443
const OGRField * GetRawFieldRef(int i) const
Fetch a pointer to the internal field value given the index.
Definition ogr_feature.h:1253
int GetFieldAsInteger(const char *pszFName) const
Fetch field value as integer.
Definition ogr_feature.h:1321
const char * GetNativeMediaType() const
Returns the native media type for the feature.
Definition ogr_feature.h:1511
void SetField(const char *pszFName, const OGRField *puValue)
Set field.
Definition ogr_feature.h:1448
GIntBig GetFID() const
Get feature identifier.
Definition ogr_feature.h:1461
OGRField * GetRawFieldRef(int i)
Fetch a pointer to the internal field value given the index.
Definition ogr_feature.h:1248
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:1438
virtual OGRStyleTable * GetStyleTable() const
Return style table.
Definition ogr_feature.h:1498
double GetFieldAsDouble(const char *pszFName) const
Fetch field value as a double.
Definition ogr_feature.h:1331
static OGRFeature * FromHandle(OGRFeatureH hFeature)
Convert a OGRFeatureH to a OGRFeature*.
Definition ogr_feature.h:1533
const GIntBig * GetFieldAsInteger64List(const char *pszFName, int *pnCount) const
Fetch field value as a list of 64 bit integers.
Definition ogr_feature.h:1352
Definition of an attribute of an OGRFeatureDefn.
Definition ogr_feature.h:95
const char * GetNameRef() const
Fetch name of this field.
Definition ogr_feature.h:125
void Unseal()
Unseal a OGRFieldDefn.
Definition ogrfielddefn.cpp:2104
int IsNullable() const
Return whether this field can receive null values.
Definition ogr_feature.h:201
void Seal()
Seal a OGRFieldDefn.
Definition ogrfielddefn.cpp:2085
int IsUnique() const
Return whether this field has a unique constraint.
Definition ogr_feature.h:208
OGRFieldSubType GetSubType() const
Fetch subtype of this field.
Definition ogr_feature.h:145
OGRJustification GetJustify() const
Get the justification for this field.
Definition ogr_feature.h:153
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition ogr_feature.h:196
int GetPrecision() const
Get the formatting precision for this field.
Definition ogr_feature.h:170
OGRFieldType GetType() const
Fetch type of this field.
Definition ogr_feature.h:137
int GetWidth() const
Get the formatting width for this field.
Definition ogr_feature.h:163
const std::string & GetComment() const
Return the (optional) comment for this field.
Definition ogr_feature.h:222
int GetTZFlag() const
Get the time zone flag.
Definition ogr_feature.h:177
void SetJustify(OGRJustification eJustifyIn)
Set the justification for this field.
Definition ogr_feature.h:158
const char * GetAlternativeNameRef() const
Fetch the alternative name (or "alias") for this field.
Definition ogr_feature.h:132
static OGRFieldDefnH ToHandle(OGRFieldDefn *poFieldDefn)
Convert a OGRFieldDefn* to a OGRFieldDefnH.
Definition ogr_feature.h:234
const std::string & GetDomainName() const
Return the name of the field domain for this field.
Definition ogr_feature.h:215
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition ogr_feature.h:191
static OGRFieldDefn * FromHandle(OGRFieldDefnH hFieldDefn)
Convert a OGRFieldDefnH to a OGRFieldDefn*.
Definition ogr_feature.h:242
Definition of a field domain.
Definition ogr_feature.h:1611
OGRFieldDomainMergePolicy GetMergePolicy() const
Get the merge policy.
Definition ogr_feature.h:1720
void SetMergePolicy(OGRFieldDomainMergePolicy policy)
Set the merge policy.
Definition ogr_feature.h:1729
static OGRFieldDomain * FromHandle(OGRFieldDomainH hFieldDomain)
Convert a OGRFieldDomainH to a OGRFieldDomain*.
Definition ogr_feature.h:1693
virtual OGRFieldDomain * Clone() const =0
Clone.
OGRFieldSubType GetFieldSubType() const
Get the field subtype.
Definition ogr_feature.h:1681
const std::string & GetName() const
Get the name of the field domain.
Definition ogr_feature.h:1644
virtual ~OGRFieldDomain()=0
Destructor.
const std::string & GetDescription() const
Get the description of the field domain.
Definition ogr_feature.h:1654
OGRFieldDomainSplitPolicy GetSplitPolicy() const
Get the split policy.
Definition ogr_feature.h:1702
static OGRFieldDomainH ToHandle(OGRFieldDomain *poFieldDomain)
Convert a OGRFieldDomain* to a OGRFieldDomainH.
Definition ogr_feature.h:1687
OGRFieldType GetFieldType() const
Get the field type.
Definition ogr_feature.h:1672
OGRFieldDomainType GetDomainType() const
Get the type of the field domain.
Definition ogr_feature.h:1663
void SetSplitPolicy(OGRFieldDomainSplitPolicy policy)
Set the split policy.
Definition ogr_feature.h:1711
Definition of a geometry field of an OGRFeatureDefn.
Definition ogr_feature.h:330
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition ogr_feature.h:373
void Seal()
Seal a OGRGeomFieldDefn.
Definition ogrgeomfielddefn.cpp:825
void Unseal()
Unseal a OGRGeomFieldDefn.
Definition ogrgeomfielddefn.cpp:844
static OGRGeomFieldDefn * FromHandle(OGRGeomFieldDefnH hGeomFieldDefn)
Convert a OGRGeomFieldDefnH to a OGRGeomFieldDefn*.
Definition ogr_feature.h:405
int IsNullable() const
Return whether this geometry field can receive null values.
Definition ogr_feature.h:378
OGRwkbGeometryType GetType() const
Fetch geometry type of this field.
Definition ogr_feature.h:358
const OGRGeomCoordinatePrecision & GetCoordinatePrecision() const
Return the coordinate precision associated to this geometry field.
Definition ogr_feature.h:385
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition ogr_feature.h:368
static OGRGeomFieldDefnH ToHandle(OGRGeomFieldDefn *poGeomFieldDefn)
Convert a OGRGeomFieldDefn* to a OGRGeomFieldDefnH.
Definition ogr_feature.h:397
const char * GetNameRef() const
Fetch name of this field.
Definition ogr_feature.h:353
Abstract base class for all geometry classes.
Definition ogr_geometry.h:361
Definition of a field domain for field content validated by a glob.
Definition ogr_feature.h:1886
OGRGlobFieldDomain * Clone() const override
Clone.
Definition ogr_feature.h:1909
const std::string & GetGlob() const
Get the glob expression.
Definition ogr_feature.h:1922
This class represents a layer of simple features, with access methods.
Definition ogrsf_frmts.h:58
Definition of a numeric field domain with a range of validity for values.
Definition ogr_feature.h:1788
OGRRangeFieldDomain * Clone() const override
Clone.
Definition ogr_feature.h:1832
const OGRField & GetMax(bool &bIsInclusiveOut) const
Get the maximum value.
Definition ogr_feature.h:1874
const OGRField & GetMin(bool &bIsInclusiveOut) const
Get the minimum value.
Definition ogr_feature.h:1855
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:153
This class represents a style table.
Definition ogr_featurestyle.h:70
#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:1030
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1179
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:964
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:169
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:199
#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:388
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:407
@ wkbUnknown
unknown type, non-standard
Definition ogr_core.h:408
int OGRErr
Type for a OGR error.
Definition ogr_core.h:371
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:1554
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition ogr_feature.h:47
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition ogr_feature.h:49
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition ogr_feature.h:51
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition ogr_feature.h:59
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition ogr_feature.h:56
void * OGRStyleTableH
Opaque type for a style table (OGRStyleTable)
Definition ogr_feature.h:53
Simple feature style classes.
Simple feature geometry classes.
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:421
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:429
Associates a code and a value.
Definition ogr_core.h:1223
Geometry coordinate precision.
Definition ogr_geomcoordinateprecision.h:34
OGRFeature field attribute value union.
Definition ogr_core.h:905