Go to the documentation of this file.
31 #ifndef OGR_FEATURE_H_INCLUDED
32 #define OGR_FEATURE_H_INCLUDED
34 #include "cpl_atomic_ops.h"
51 #ifndef DEFINE_OGRFeatureH
53 #define DEFINE_OGRFeatureH
104 char *pszAlternativeName;
117 std::string m_osDomainName{};
124 void SetName(
const char * );
127 void SetAlternativeName(
const char * );
140 { eJustify = eJustifyIn; }
147 { nPrecision = nPrecisionIn; }
152 void SetDefault(
const char* );
153 const char *GetDefault()
const;
154 int IsDefaultDriverSpecific()
const;
163 void SetUnique(
int bUniqueIn ) { bUnique = bUniqueIn; }
166 void SetDomainName(
const std::string& osDomainName) { m_osDomainName = osDomainName; }
207 char *pszName =
nullptr;
212 mutable int bNullable =
true;
223 void SetName(
const char * );
237 { bNullable = bNullableIn; }
284 volatile int nRefCount = 0;
286 mutable std::vector<std::unique_ptr<OGRFieldDefn>> apoFieldDefn{};
287 mutable std::vector<std::unique_ptr<OGRGeomFieldDefn>> apoGeomFieldDefn{};
289 char *pszFeatureClassName =
nullptr;
291 bool bIgnoreStyle =
false;
298 void SetName(
const char* pszName );
299 virtual const char *GetName()
const;
301 virtual int GetFieldCount()
const;
303 virtual const OGRFieldDefn *GetFieldDefn(
int i )
const;
304 virtual int GetFieldIndex(
const char * )
const;
305 int GetFieldIndexCaseSensitive(
const char * )
const;
309 int GetFieldCountUnsafe()
const {
return static_cast<int>(apoFieldDefn.size()); }
312 OGRFieldDefn *GetFieldDefnUnsafe(
int i ) {
if( apoFieldDefn.empty() ) GetFieldDefn(i);
return apoFieldDefn[
static_cast<std::size_t
>(i)].get(); }
313 const OGRFieldDefn *GetFieldDefnUnsafe(
int i )
const {
if( apoFieldDefn.empty() ) GetFieldDefn(i);
return apoFieldDefn[
static_cast<std::size_t
>(i)].get(); }
317 virtual OGRErr DeleteFieldDefn(
int iField );
318 virtual OGRErr ReorderFieldDefns(
const int* panMap );
320 virtual int GetGeomFieldCount()
const;
323 virtual int GetGeomFieldIndex(
const char * )
const;
326 virtual void AddGeomFieldDefn( std::unique_ptr<OGRGeomFieldDefn>&& );
327 virtual OGRErr DeleteGeomFieldDefn(
int iGeomField );
339 virtual int IsGeometryIgnored()
const;
340 virtual void SetGeometryIgnored(
int bIgnore );
343 { bIgnoreStyle = bIgnore; }
345 virtual int IsSame(
const OGRFeatureDefn * poOtherFeatureDefn )
const;
348 void ReserveSpaceForFields(
int nFieldCountIn);
351 std::vector<int> ComputeMapForSetFrom(
const OGRFeatureDefn* poSrcFDefn,
352 bool bForgiving =
true )
const;
354 static OGRFeatureDefn *CreateFeatureDefn(
const char *pszName =
nullptr );
389 char *m_pszNativeData;
390 char *m_pszNativeMediaType;
392 bool SetFieldInternal(
int i,
const OGRField * puValue );
396 mutable char *m_pszStyleString;
398 mutable char *m_pszTmpFieldValue;
412 std::unique_ptr<Private> m_poPrivate;
437 FieldValue& operator= (
const std::string& osVal);
439 FieldValue& operator= (
const std::vector<int>& oArray);
441 FieldValue& operator= (
const std::vector<GIntBig>& oArray);
443 FieldValue& operator= (
const std::vector<double>& oArray);
445 FieldValue& operator= (
const std::vector<std::string>& oArray);
455 void SetDateTime(
int nYear,
int nMonth,
int nDay,
456 int nHour=0,
int nMinute=0,
float fSecond=0.f,
460 int GetIndex()
const;
464 const char*
GetName()
const {
return GetDefn()->GetNameRef(); }
472 bool empty()
const {
return IsUnset(); }
476 bool IsUnset()
const;
483 const OGRField *GetRawValue()
const;
501 double GetDouble()
const {
return GetRawValue()->Real; }
507 const char*
GetString()
const {
return GetRawValue()->String; }
510 bool GetDateTime(
int *pnYear,
int *pnMonth,
512 int *pnHour,
int *pnMinute,
514 int *pnTZFlag )
const;
517 operator int ()
const {
return GetAsInteger(); }
519 operator GIntBig()
const {
return GetAsInteger64(); }
521 operator double ()
const {
return GetAsDouble(); }
523 operator const char*()
const {
return GetAsString(); }
525 operator const std::vector<int>& ()
const {
return GetAsIntegerList(); }
527 operator const std::vector<GIntBig>& ()
const {
return GetAsInteger64List(); }
529 operator const std::vector<double>& ()
const {
return GetAsDoubleList(); }
531 operator const std::vector<std::string>& ()
const {
return GetAsStringList(); }
536 int GetAsInteger()
const;
538 GIntBig GetAsInteger64()
const;
540 double GetAsDouble()
const;
542 const char* GetAsString()
const;
544 const std::vector<int>& GetAsIntegerList()
const;
546 const std::vector<GIntBig>& GetAsInteger64List()
const;
548 const std::vector<double>& GetAsDoubleList()
const;
550 const std::vector<std::string>& GetAsStringList()
const;
558 std::unique_ptr<Private> m_poPrivate;
592 const FieldValue operator[](
int iField)
const;
598 const FieldValue operator[](
const char* pszFieldName)
const;
599 FieldValue operator[](
const char* pszFieldName);
614 int GetGeomFieldCount()
const
624 const OGRGeometry* GetGeomFieldRef(
int iField )
const;
626 OGRGeometry* GetGeomFieldRef(
const char* pszFName );
627 const OGRGeometry* GetGeomFieldRef(
const char* pszFName )
const;
636 int GetFieldCount()
const
645 int IsFieldSet(
int iField )
const;
647 void UnsetField(
int iField );
649 bool IsFieldNull(
int iField )
const;
651 void SetFieldNull(
int iField );
653 bool IsFieldSetAndNotNull(
int iField )
const;
658 int GetFieldAsInteger(
int i )
const;
659 GIntBig GetFieldAsInteger64(
int i )
const;
660 double GetFieldAsDouble(
int i )
const;
661 const char *GetFieldAsString(
int i )
const;
662 const int *GetFieldAsIntegerList(
int i,
int *pnCount )
const;
663 const GIntBig *GetFieldAsInteger64List(
int i,
int *pnCount )
const;
664 const double *GetFieldAsDoubleList(
int i,
int *pnCount )
const;
665 char **GetFieldAsStringList(
int i )
const;
666 GByte *GetFieldAsBinary(
int i,
int *pnCount )
const;
667 int GetFieldAsDateTime(
int i,
668 int *pnYear,
int *pnMonth,
670 int *pnHour,
int *pnMinute,
672 int *pnTZFlag )
const;
673 int GetFieldAsDateTime(
int i,
674 int *pnYear,
int *pnMonth,
676 int *pnHour,
int *pnMinute,
678 int *pnTZFlag )
const;
679 char *GetFieldAsSerializedJSon(
int i )
const;
682 bool IsFieldSetUnsafe(
int i )
const {
return !(pauFields[i].Set.nMarker1 ==
OGRUnsetMarker &&
685 bool IsFieldNullUnsafe(
int i )
const {
return (pauFields[i].Set.nMarker1 ==
OGRNullMarker &&
688 bool IsFieldSetAndNotNullUnsafe(
int i )
const {
return IsFieldSetUnsafe(i) && !IsFieldNullUnsafe(i); }
691 int GetFieldAsIntegerUnsafe(
int i )
const {
return pauFields[i].Integer; }
692 GIntBig GetFieldAsInteger64Unsafe(
int i )
const {
return pauFields[i].Integer64; }
693 double GetFieldAsDoubleUnsafe(
int i )
const {
return pauFields[i].Real; }
694 const char* GetFieldAsStringUnsafe(
int i)
const {
return pauFields[i].String; }
698 {
return GetFieldAsInteger( GetFieldIndex(pszFName) ); }
700 {
return GetFieldAsInteger64( GetFieldIndex(pszFName) ); }
702 {
return GetFieldAsDouble( GetFieldIndex(pszFName) ); }
704 {
return GetFieldAsString( GetFieldIndex(pszFName) ); }
707 {
return GetFieldAsIntegerList( GetFieldIndex(pszFName),
711 {
return GetFieldAsInteger64List( GetFieldIndex(pszFName),
715 {
return GetFieldAsDoubleList( GetFieldIndex(pszFName),
718 {
return GetFieldAsStringList(GetFieldIndex(pszFName)); }
720 void SetField(
int i,
int nValue );
721 void SetField(
int i,
GIntBig nValue );
722 void SetField(
int i,
double dfValue );
723 void SetField(
int i,
const char * pszValue );
724 void SetField(
int i,
int nCount,
const int * panValues );
725 void SetField(
int i,
int nCount,
727 void SetField(
int i,
int nCount,
const double * padfValues );
728 void SetField(
int i,
const char *
const * papszValues );
729 void SetField(
int i,
const OGRField * puValue );
730 void SetField(
int i,
int nCount,
const void * pabyBinary );
731 void SetField(
int i,
int nYear,
int nMonth,
int nDay,
732 int nHour=0,
int nMinute=0,
float fSecond=0.f,
738 void SetFieldSameTypeUnsafe(
int i,
int nValue ) {
739 pauFields[i].Integer = nValue; pauFields[i].Set.nMarker2 = 0; pauFields[i].Set.nMarker3 = 0; }
740 void SetFieldSameTypeUnsafe(
int i,
GIntBig nValue ) { pauFields[i].Integer64 = nValue; }
741 void SetFieldSameTypeUnsafe(
int i,
double dfValue ) { pauFields[i].Real = dfValue; }
742 void SetFieldSameTypeUnsafe(
int i,
char* pszValueTransferred ) { pauFields[i].String = pszValueTransferred; }
746 { SetField( GetFieldIndex(pszFName), nValue ); }
748 { SetField( GetFieldIndex(pszFName), nValue ); }
749 void SetField(
const char *pszFName,
double dfValue )
750 { SetField( GetFieldIndex(pszFName), dfValue ); }
751 void SetField(
const char *pszFName,
const char * pszValue )
752 { SetField( GetFieldIndex(pszFName), pszValue ); }
754 const int * panValues )
755 { SetField(GetFieldIndex(pszFName),nCount,panValues); }
758 { SetField(GetFieldIndex(pszFName),nCount,panValues); }
760 const double * padfValues )
761 {SetField(GetFieldIndex(pszFName),nCount,padfValues); }
762 void SetField(
const char *pszFName,
const char *
const * papszValues )
763 { SetField( GetFieldIndex(pszFName), papszValues); }
765 { SetField( GetFieldIndex(pszFName), puValue ); }
767 int nYear,
int nMonth,
int nDay,
768 int nHour=0,
int nMinute=0,
float fSecond=0.f,
770 { SetField( GetFieldIndex(pszFName),
772 nHour, nMinute, fSecond, nTZFlag ); }
777 void DumpReadable( FILE *,
char** papszOptions =
nullptr )
const;
785 const int *panRemapSource );
788 const int *panRemapSource );
791 int Validate(
int nValidateFlags,
792 int bEmitError )
const;
793 void FillUnsetWithDefault(
int bNotNullableOnly,
794 char** papszOptions );
796 virtual const char *GetStyleString()
const;
797 virtual void SetStyleString(
const char * );
798 virtual void SetStyleStringDirectly(
char * );
805 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable );
809 {
return m_pszNativeMediaType; }
810 void SetNativeData(
const char* pszNativeData );
811 void SetNativeMediaType(
const char* pszNativeMediaType );
820 {
return reinterpret_cast<OGRFeatureH>(poFeature); }
826 {
return reinterpret_cast<OGRFeature*
>(hFeature); }
833 struct CPL_DLL OGRFeatureUniquePtrDeleter
885 std::string m_osName;
886 std::string m_osDescription;
894 const std::string& osDescription,
917 const std::string&
GetName()
const {
return m_osName; }
986 std::vector<OGRCodedValue> m_asValues{};
1007 const std::string& osDescription,
1010 std::vector<OGRCodedValue>&& asValues);
1031 bool m_bMinIsInclusive;
1032 bool m_bMaxIsInclusive;
1063 const std::string& osDescription,
1067 bool bMinIsInclusive,
1069 bool bMaxIsInclusive);
1073 m_eFieldType, m_eFieldSubType,
1074 m_sMin, m_bMinIsInclusive,
1075 m_sMax, m_bMaxIsInclusive);
1076 poDomain->SetMergePolicy(m_eMergePolicy);
1077 poDomain->SetSplitPolicy(m_eSplitPolicy);
1093 bIsInclusiveOut = m_bMinIsInclusive;
1109 bIsInclusiveOut = m_bMaxIsInclusive;
1121 std::string m_osGlob;
1138 const std::string& osDescription,
1141 const std::string& osBlob);
1145 m_eFieldType, m_eFieldSubType,
1147 poDomain->SetMergePolicy(m_eMergePolicy);
1148 poDomain->SetSplitPolicy(m_eSplitPolicy);
1156 const std::string&
GetGlob()
const {
return m_osGlob; }
1165 class swq_expr_node;
1166 class swq_custom_func_registrar;
1168 class CPL_DLL OGRFeatureQuery
1174 char **FieldCollector(
void *,
char ** );
1179 int CanUseIndex( swq_expr_node*,
OGRLayer * );
1183 swq_custom_func_registrar* poCustomFuncRegistrar );
1193 swq_custom_func_registrar*
1194 poCustomFuncRegistrar =
nullptr );
1197 swq_custom_func_registrar*
1198 poCustomFuncRegistrar =
nullptr );
1205 char **GetUsedFields();
1207 void *GetSWQExpr() {
return pSWQExpr; }
#define MAX(a, b)
Macro to compute the maximum of 2 values.
Definition: cpl_port.h:381
#define OGRNullMarker
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a null field.
Definition: ogr_core.h:792
const double * GetFieldAsDoubleList(const char *pszFName, int *pnCount) const
Fetch field value as a list of doubles.
Definition: ogr_feature.h:713
const char * GetString() const
Return the string value.
Definition: ogr_feature.h:507
static OGRFeatureDefn * FromHandle(OGRFeatureDefnH hFeatureDefn)
Convert a OGRFeatureDefnH to a OGRFeatureDefn*.
Definition: ogr_feature.h:366
OGRFieldSubType GetSubType() const
Return field subtype.
Definition: ogr_feature.h:468
OGRFieldDomainSplitPolicy GetSplitPolicy() const
Get the split policy.
Definition: ogr_feature.h:956
OGRFieldDomainMergePolicy
Merge policy for field domains.
Definition: ogr_core.h:1099
virtual bool IsStyleIgnored() const
Determine whether the style can be omitted when fetching features.
Definition: ogr_feature.h:341
@ OFDSP_DEFAULT_VALUE
Default value.
Definition: ogr_core.h:1085
OGRFieldDomainType
Type of field domain.
Definition: ogr_core.h:1065
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:203
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition: ogr_feature.h:62
Exception raised by operator[](const char*) when a field is not found.
Definition: ogr_feature.h:596
const OGRCodedValue * GetEnumeration() const
Get the enumeration as (code, value) pairs.
Definition: ogr_feature.h:1021
void SetField(const char *pszFName, GIntBig nValue)
Set field to 64 bit integer value. OFTInteger, OFTInteger64 and OFTReal fields will be set directly....
Definition: ogr_feature.h:747
char ** GetFieldAsStringList(const char *pszFName) const
Fetch field value as a list of strings.
Definition: ogr_feature.h:717
const std::string & GetDomainName() const
Return the name of the field domain for this field.
Definition: ogr_feature.h:165
Field value iterator class.
Definition: ogr_feature.h:554
void SetDomainName(const std::string &osDomainName)
Set the name of the field domain for this field.
Definition: ogr_feature.h:166
virtual OGRStyleTable * GetStyleTable() const
Return style table.
Definition: ogr_feature.h:803
void SetJustify(OGRJustification eJustifyIn)
Set the justification for this field.
Definition: ogr_feature.h:139
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:325
OGRFieldType GetType() const
Return field type.
Definition: ogr_feature.h:466
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:233
This class represents a style table.
Definition: ogr_featurestyle.h:84
void SetMergePolicy(OGRFieldDomainMergePolicy policy)
Set the merge policy.
Definition: ogr_feature.h:974
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:157
static OGRFeatureH ToHandle(OGRFeature *poFeature)
Convert a OGRFeature* to a OGRFeatureH.
Definition: ogr_feature.h:819
const char * GetName() const
Return field name.
Definition: ogr_feature.h:464
virtual int GetGeomFieldIndex(const char *) const
Find geometry field by name.
Definition: ogrfeaturedefn.cpp:878
OGRFieldDefn * GetFieldDefnRef(int iField)
Fetch definition for this field.
Definition: ogr_feature.h:640
int GetWidth() const
Get the formatting width for this field.
Definition: ogr_feature.h:142
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:157
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition: ogr_feature.h:71
void * OGRStyleTableH
Opaque type for a style table (OGRStyleTable)
Definition: ogr_feature.h:68
static OGRFieldDomain * FromHandle(OGRFieldDomainH hFieldDomain)
Convert a OGRFieldDomainH to a OGRFieldDomain*.
Definition: ogr_feature.h:949
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition: ogr_feature.h:66
void SetSplitPolicy(OGRFieldDomainSplitPolicy policy)
Set the split policy.
Definition: ogr_feature.h:962
void SetField(const char *pszFName, const OGRField *puValue)
Set field.
Definition: ogr_feature.h:764
const OGRField & GetMin(bool &bIsInclusiveOut) const
Get the minimum value.
Definition: ogr_feature.h:1092
double GetFieldAsDouble(const char *pszFName) const
Fetch field value as a double.
Definition: ogr_feature.h:701
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:326
const std::string & GetDescription() const
Get the description of the field domain.
Definition: ogr_feature.h:924
virtual OGRFieldDomain * Clone() const =0
Clone.
OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField)
Fetch definition for this geometry field.
Definition: ogr_feature.h:616
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:72
bool empty() const
Return whether the field value is unset/empty.
Definition: ogr_feature.h:472
@ OFDMP_DEFAULT_VALUE
Default value.
Definition: ogr_core.h:1102
static OGRGeomFieldDefnH ToHandle(OGRGeomFieldDefn *poGeomFieldDefn)
Convert a OGRGeomFieldDefn* to a OGRGeomFieldDefnH.
Definition: ogr_feature.h:244
int GetPrecision() const
Get the formatting precision for this field. This should normally be zero for fields of types other t...
Definition: ogr_feature.h:145
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:224
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:232
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition: ogr_feature.h:842
const OGRField & GetMax(bool &bIsInclusiveOut) const
Get the maximum value.
Definition: ogr_feature.h:1108
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition: ogr_api.h:337
int GetGeomFieldIndex(const char *pszName) const
Fetch the geometry field index given geometry field name.
Definition: ogr_feature.h:620
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:125
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:357
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition: ogr_api.h:335
void SetPrecision(int nPrecisionIn)
Set the formatting precision for this field in characters.
Definition: ogr_feature.h:146
virtual OGRFieldDefn * GetFieldDefn(int i)
Fetch field definition.
Definition: ogrfeaturedefn.cpp:312
Field value.
Definition: ogr_feature.h:408
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition: ogr_api.h:342
ConstFieldIterator begin() const
Return begin of field value iterator.
Definition: ogrfeature.cpp:7277
OGRFieldDomainMergePolicy GetMergePolicy() const
Get the merge policy.
Definition: ogr_feature.h:968
int IsUnique() const
Return whether this field has a unique constraint.
Definition: ogr_feature.h:162
Definition of a field domain for field content validated by a glob.
Definition: ogr_feature.h:1118
OGRFeature field attribute value union.
Definition: ogr_core.h:802
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition: ogr_feature.h:601
virtual OGRGeomFieldDefn * GetGeomFieldDefn(int i)
Fetch geometry field definition.
Definition: ogrfeaturedefn.cpp:641
void SetField(const char *pszFName, int nCount, const double *padfValues)
Set field to list of doubles value.
Definition: ogr_feature.h:759
Associates a code and a value.
Definition: ogr_core.h:1052
int GetFieldIndex(const char *pszName) const
Fetch the field index given field name.
Definition: ogr_feature.h:642
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1056
void Unset()
Unset the field.
Definition: ogr_feature.h:453
virtual int GetFieldCount() const
Fetch number of fields on this feature.
Definition: ogrfeaturedefn.cpp:268
void SetField(const char *pszFName, const char *pszValue)
Set field to string value.
Definition: ogr_feature.h:751
const std::string & GetName() const
Get the name of the field domain.
Definition: ogr_feature.h:917
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:766
static OGRFieldDefn * FromHandle(OGRFieldDefnH hFieldDefn)
Convert a OGRFieldDefnH to a OGRFieldDefn*.
Definition: ogr_feature.h:179
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition: ogr_api.h:345
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:100
int IsNullable() const
Return whether this geometry field can receive null values.
Definition: ogr_feature.h:235
void SetUnique(int bUniqueIn)
Set whether this field has a unique constraint.
Definition: ogr_feature.h:163
void SetField(const char *pszFName, int nCount, const int *panValues)
Set field to list of integers value.
Definition: ogr_feature.h:753
#define OGRUnsetMarker
Special value set in OGRField.Set.nMarker1, nMarker2 and nMarker3 for a unset field.
Definition: ogr_core.h:784
Definition of a numeric field domain with a range of validity for values.
Definition: ogr_feature.h:1026
OGRJustification
Display justification for field values.
Definition: ogr_core.h:761
virtual void SetStyleIgnored(bool bIgnore)
Set whether the style can be omitted when fetching features.
Definition: ogr_feature.h:342
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition: ogr_api.h:333
OGRFieldType GetFieldType() const
Get the field type.
Definition: ogr_feature.h:936
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:203
double GetDouble() const
Return the double value.
Definition: ogr_feature.h:501
const GIntBig * GetFieldAsInteger64List(const char *pszFName, int *pnCount) const
Fetch field value as a list of 64 bit integers.
Definition: ogr_feature.h:709
Definition of a field domain.
Definition: ogr_feature.h:881
static OGRFeature * FromHandle(OGRFeatureH hFeature)
Convert a OGRFeatureH to a OGRFeature*.
Definition: ogr_feature.h:825
int Dereference()
Decrements the reference count by one.
Definition: ogr_feature.h:335
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:330
OGRFieldType GetType() const
Fetch type of this field.
Definition: ogr_feature.h:130
virtual int GetFieldIndex(const char *) const
Find field by name.
Definition: ogrfeaturedefn.cpp:1181
OGRFieldSubType GetFieldSubType() const
Get the field subtype.
Definition: ogr_feature.h:942
const char * GetAlternativeNameRef() const
Fetch the alternative name (or "alias") for this field.
Definition: ogr_feature.h:128
OGRFieldDomainSplitPolicy
Split policy for field domains.
Definition: ogr_core.h:1082
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:341
static OGRFieldDomainH ToHandle(OGRFieldDomain *poFieldDomain)
Convert a OGRFieldDomain* to a OGRFieldDomainH.
Definition: ogr_feature.h:945
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:230
const OGRFieldDefn * GetFieldDefnRef(int iField) const
Fetch definition for this field.
Definition: ogr_feature.h:638
int GetInteger() const
Return the integer value.
Definition: ogr_feature.h:489
const OGRField * GetRawFieldRef(int i) const
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:656
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:368
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:156
void SetField(const char *pszFName, double dfValue)
Set field to double value.
Definition: ogr_feature.h:749
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:869
OGRField * GetRawFieldRef(int i)
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:655
int Reference()
Increments the reference count by one.
Definition: ogr_feature.h:334
Definition of a coded / enumerated field domain.
Definition: ogr_feature.h:983
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:381
ConstFieldIterator end() const
Return end of field value iterator.
Definition: ogrfeature.cpp:7282
const OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField) const
Fetch definition for this geometry field.
Definition: ogr_feature.h:618
OGRwkbGeometryType GetType() const
Fetch geometry type of this field.
Definition: ogr_feature.h:226
const char * GetNativeMediaType() const
Returns the native media type for the feature.
Definition: ogr_feature.h:808
OGRFieldSubType
List of field subtypes.
Definition: ogr_core.h:737
void SetNullable(int bNullableIn)
Set whether this field can receive null values.
Definition: ogr_feature.h:160
void SetNullable(int bNullableIn)
Set whether this geometry field can receive null values.
Definition: ogr_feature.h:236
OGRRangeFieldDomain * Clone() const override
Clone.
Definition: ogr_feature.h:1071
static OGRGeomFieldDefn * FromHandle(OGRGeomFieldDefnH hGeomFieldDefn)
Convert a OGRGeomFieldDefnH to a OGRGeomFieldDefn*.
Definition: ogr_feature.h:250
static OGRFeatureDefnH ToHandle(OGRFeatureDefn *poFeatureDefn)
Convert a OGRFeatureDefn* to a OGRFeatureDefnH.
Definition: ogr_feature.h:360
int IsNullable() const
Return whether this field can receive null values.
Definition: ogr_feature.h:159
OGRFieldType
List of feature field types.
Definition: ogr_core.h:709
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition: ogr_feature.h:64
virtual int GetGeomFieldCount() const
Fetch number of geometry fields on this feature.
Definition: ogrfeaturedefn.cpp:592
GIntBig GetFieldAsInteger64(const char *pszFName) const
Fetch field value as integer 64 bit.
Definition: ogr_feature.h:699
const char * GetFieldAsString(const char *pszFName) const
Fetch field value as a string.
Definition: ogr_feature.h:703
GIntBig GetInteger64() const
Return the 64-bit integer value.
Definition: ogr_feature.h:495
void SetField(const char *pszFName, const char *const *papszValues)
Set field to list of strings value.
Definition: ogr_feature.h:762
void SetWidth(int nWidthIn)
Set the formatting width for this field in characters.
Definition: ogr_feature.h:143
Definition of a feature class or feature layer.
Definition: ogr_feature.h:280
const std::string & GetGlob() const
Get the glob expression.
Definition: ogr_feature.h:1156
int GetFieldAsInteger(const char *pszFName) const
Fetch field value as integer.
Definition: ogr_feature.h:697
int GetReferenceCount() const
Fetch current reference count.
Definition: ogr_feature.h:336
OGRFieldSubType GetSubType() const
Fetch subtype of this field.
Definition: ogr_feature.h:134
void SetField(const char *pszFName, int nValue)
Set field to integer value. OFTInteger, OFTInteger64 and OFTReal fields will be set directly....
Definition: ogr_feature.h:745
const int * GetFieldAsIntegerList(const char *pszFName, int *pnCount) const
Fetch field value as a list of integers.
Definition: ogr_feature.h:705
@ wkbUnknown
unknown type, non-standard
Definition: ogr_core.h:370
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition: ogr_feature.h:74
OGRGlobFieldDomain * Clone() const override
Clone.
Definition: ogr_feature.h:1143
#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:930
OGRJustification GetJustify() const
Get the justification for this field.
Definition: ogr_feature.h:138
const char * GetNativeData() const
Returns the native data for the feature.
Definition: ogr_feature.h:807
OGRFieldDomainType GetDomainType() const
Get the type of the field domain.
Definition: ogr_feature.h:930
GIntBig GetFID() const
Get feature identifier.
Definition: ogr_feature.h:774
void SetField(const char *pszFName, int nCount, const GIntBig *panValues)
Set field to list of 64 bit integers value.
Definition: ogr_feature.h:756
static OGRFieldDefnH ToHandle(OGRFieldDefn *poFieldDefn)
Convert a OGRFieldDefn* to a OGRFieldDefnH.
Definition: ogr_feature.h:173