GDAL

ogr_feature.h
Go to the documentation of this file.
1 /******************************************************************************
2 * $Id$
3 *
4 * Project: OpenGIS Simple Features Reference Implementation
5 * Purpose: Class for representing a whole feature, and layer schemas.
6 * Author: Frank Warmerdam, warmerdam@pobox.com
7 *
8 ******************************************************************************
9 * Copyright (c) 1999, Les Technologies SoftMap Inc.
10 * Copyright (c) 2008-2013, Even Rouault <even dot rouault at spatialys.com>
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 * DEALINGS IN THE SOFTWARE.
29 ****************************************************************************/
30
31 #ifndef OGR_FEATURE_H_INCLUDED
32 #define OGR_FEATURE_H_INCLUDED
33
34 #include "cpl_atomic_ops.h"
35 #include "ogr_featurestyle.h"
36 #include "ogr_geometry.h"
37
38 #include <exception>
39 #include <memory>
40 #include <string>
41 #include <vector>
42
49 #ifndef DEFINE_OGRFeatureH
51 #define DEFINE_OGRFeatureH
53 #ifdef DEBUG
54 typedef struct OGRFieldDefnHS *OGRFieldDefnH;
55 typedef struct OGRFeatureDefnHS *OGRFeatureDefnH;
56 typedef struct OGRFeatureHS *OGRFeatureH;
57 typedef struct OGRStyleTableHS *OGRStyleTableH;
58 #else
60 typedef void *OGRFieldDefnH;
62 typedef void *OGRFeatureDefnH;
64 typedef void *OGRFeatureH;
66 typedef void *OGRStyleTableH;
67 #endif
69 typedef struct OGRGeomFieldDefnHS *OGRGeomFieldDefnH;
70
72 typedef struct OGRFieldDomainHS *OGRFieldDomainH;
73 #endif /* DEFINE_OGRFeatureH */
74
75 class OGRStyleTable;
76
77 /************************************************************************/
78 /* OGRFieldDefn */
79 /************************************************************************/
80
98 class CPL_DLL OGRFieldDefn
99 {
100 private:
101 char *pszName;
102 char *pszAlternativeName;
103 OGRFieldType eType;
104 OGRJustification eJustify;
105 int nWidth; // Zero is variable.
106 int nPrecision;
107 char *pszDefault;
108
109 int bIgnore;
110 OGRFieldSubType eSubType;
111
112 int bNullable;
113 int bUnique;
114
115 std::string m_osDomainName{}; // field domain name. Might be empty
116
117 public:
118 OGRFieldDefn( const char *, OGRFieldType );
119 explicit OGRFieldDefn( const OGRFieldDefn * );
120 ~OGRFieldDefn();
121
122 void SetName( const char * );
123 const char *GetNameRef() const { return pszName; }
124
125 void SetAlternativeName( const char * );
126 const char *GetAlternativeNameRef() const { return pszAlternativeName; }
127
128 OGRFieldType GetType() const { return eType; }
129 void SetType( OGRFieldType eTypeIn );
130 static const char *GetFieldTypeName( OGRFieldType );
131
132 OGRFieldSubType GetSubType() const { return eSubType; }
133 void SetSubType( OGRFieldSubType eSubTypeIn );
134 static const char *GetFieldSubTypeName( OGRFieldSubType );
135
136 OGRJustification GetJustify() const { return eJustify; }
137 void SetJustify( OGRJustification eJustifyIn )
138 { eJustify = eJustifyIn; }
139
140 int GetWidth() const { return nWidth; }
141 void SetWidth( int nWidthIn ) { nWidth = MAX(0,nWidthIn); }
142
143 int GetPrecision() const { return nPrecision; }
144 void SetPrecision( int nPrecisionIn )
145 { nPrecision = nPrecisionIn; }
146
147 void Set( const char *, OGRFieldType, int = 0, int = 0,
148 OGRJustification = OJUndefined );
149
150 void SetDefault( const char* );
151 const char *GetDefault() const;
152 int IsDefaultDriverSpecific() const;
153
154 int IsIgnored() const { return bIgnore; }
155 void SetIgnored( int bIgnoreIn ) { bIgnore = bIgnoreIn; }
156
157 int IsNullable() const { return bNullable; }
158 void SetNullable( int bNullableIn ) { bNullable = bNullableIn; }
159
160 int IsUnique() const { return bUnique; }
161 void SetUnique( int bUniqueIn ) { bUnique = bUniqueIn; }
162
163 const std::string& GetDomainName() const { return m_osDomainName; }
164 void SetDomainName(const std::string& osDomainName) { m_osDomainName = osDomainName; }
165
166 int IsSame( const OGRFieldDefn * ) const;
167
171 static inline OGRFieldDefnH ToHandle(OGRFieldDefn* poFieldDefn)
172 { return reinterpret_cast<OGRFieldDefnH>(poFieldDefn); }
173
177 static inline OGRFieldDefn* FromHandle(OGRFieldDefnH hFieldDefn)
178 { return reinterpret_cast<OGRFieldDefn*>(hFieldDefn); }
179 private:
180 CPL_DISALLOW_COPY_ASSIGN(OGRFieldDefn)
181 };
182
183 /************************************************************************/
184 /* OGRGeomFieldDefn */
185 /************************************************************************/
186
201 class CPL_DLL OGRGeomFieldDefn
202 {
203 protected:
205 char *pszName = nullptr;
206 OGRwkbGeometryType eGeomType = wkbUnknown; /* all values possible except wkbNone */
207 mutable OGRSpatialReference* poSRS = nullptr;
208
209 int bIgnore = false;
210 mutable int bNullable = true;
211
212 void Initialize( const char *, OGRwkbGeometryType );
214
215 public:
216 OGRGeomFieldDefn( const char *pszNameIn,
217 OGRwkbGeometryType eGeomTypeIn );
218 explicit OGRGeomFieldDefn( const OGRGeomFieldDefn * );
219 virtual ~OGRGeomFieldDefn();
220
221 void SetName( const char * );
222 const char *GetNameRef() const { return pszName; }
223
224 OGRwkbGeometryType GetType() const { return eGeomType; }
225 void SetType( OGRwkbGeometryType eTypeIn );
226
227 virtual OGRSpatialReference* GetSpatialRef() const;
228 void SetSpatialRef( OGRSpatialReference* poSRSIn );
229
230 int IsIgnored() const { return bIgnore; }
231 void SetIgnored( int bIgnoreIn ) { bIgnore = bIgnoreIn; }
232
233 int IsNullable() const { return bNullable; }
234 void SetNullable( int bNullableIn )
235 { bNullable = bNullableIn; }
236
237 int IsSame( const OGRGeomFieldDefn * ) const;
238
242 static inline OGRGeomFieldDefnH ToHandle(OGRGeomFieldDefn* poGeomFieldDefn)
243 { return reinterpret_cast<OGRGeomFieldDefnH>(poGeomFieldDefn); }
244
248 static inline OGRGeomFieldDefn* FromHandle(OGRGeomFieldDefnH hGeomFieldDefn)
249 { return reinterpret_cast<OGRGeomFieldDefn*>(hGeomFieldDefn); }
250 private:
251 CPL_DISALLOW_COPY_ASSIGN(OGRGeomFieldDefn)
252 };
253
254 /************************************************************************/
255 /* OGRFeatureDefn */
256 /************************************************************************/
257
278 class CPL_DLL OGRFeatureDefn
279 {
280 protected:
282 volatile int nRefCount;
283
284 mutable int nFieldCount;
285 mutable OGRFieldDefn **papoFieldDefn;
286
287 mutable int nGeomFieldCount;
288 mutable OGRGeomFieldDefn **papoGeomFieldDefn;
289
290 char *pszFeatureClassName;
291
292 int bIgnoreStyle;
294
295 public:
296 explicit OGRFeatureDefn( const char * pszName = nullptr );
297 virtual ~OGRFeatureDefn();
298
299 void SetName( const char* pszName );
300 virtual const char *GetName() const;
301
302 virtual int GetFieldCount() const;
303 virtual OGRFieldDefn *GetFieldDefn( int i );
304 virtual const OGRFieldDefn *GetFieldDefn( int i ) const;
305 virtual int GetFieldIndex( const char * ) const;
306 int GetFieldIndexCaseSensitive( const char * ) const;
307
308 virtual void AddFieldDefn( OGRFieldDefn * );
309 virtual OGRErr DeleteFieldDefn( int iField );
310 virtual OGRErr ReorderFieldDefns( int* panMap );
311
312 virtual int GetGeomFieldCount() const;
313 virtual OGRGeomFieldDefn *GetGeomFieldDefn( int i );
314 virtual const OGRGeomFieldDefn *GetGeomFieldDefn( int i ) const;
315 virtual int GetGeomFieldIndex( const char * ) const;
316
317 virtual void AddGeomFieldDefn( OGRGeomFieldDefn *,
318 int bCopy = TRUE );
319 virtual OGRErr DeleteGeomFieldDefn( int iGeomField );
320
321 virtual OGRwkbGeometryType GetGeomType() const;
322 virtual void SetGeomType( OGRwkbGeometryType );
323
324 virtual OGRFeatureDefn *Clone() const;
325
326 int Reference() { return CPLAtomicInc(&nRefCount); }
327 int Dereference() { return CPLAtomicDec(&nRefCount); }
328 int GetReferenceCount() const { return nRefCount; }
329 void Release();
330
331 virtual int IsGeometryIgnored() const;
332 virtual void SetGeometryIgnored( int bIgnore );
333 virtual int IsStyleIgnored() const { return bIgnoreStyle; }
334 virtual void SetStyleIgnored( int bIgnore )
335 { bIgnoreStyle = bIgnore; }
336
337 virtual int IsSame( const OGRFeatureDefn * poOtherFeatureDefn ) const;
338
340 void ReserveSpaceForFields(int nFieldCountIn);
342
343 std::vector<int> ComputeMapForSetFrom( const OGRFeatureDefn* poSrcFDefn,
344 bool bForgiving = true ) const;
345
346 static OGRFeatureDefn *CreateFeatureDefn( const char *pszName = nullptr );
347 static void DestroyFeatureDefn( OGRFeatureDefn * );
348
352 static inline OGRFeatureDefnH ToHandle(OGRFeatureDefn* poFeatureDefn)
353 { return reinterpret_cast<OGRFeatureDefnH>(poFeatureDefn); }
354
358 static inline OGRFeatureDefn* FromHandle(OGRFeatureDefnH hFeatureDefn)
359 { return reinterpret_cast<OGRFeatureDefn*>(hFeatureDefn); }
360
361 private:
362 CPL_DISALLOW_COPY_ASSIGN(OGRFeatureDefn)
363 };
364
365 /************************************************************************/
366 /* OGRFeature */
367 /************************************************************************/
368
373 class CPL_DLL OGRFeature
374 {
375 private:
376
377 GIntBig nFID;
378 OGRFeatureDefn *poDefn;
379 OGRGeometry **papoGeometries;
380 OGRField *pauFields;
381 char *m_pszNativeData;
382 char *m_pszNativeMediaType;
383
384 bool SetFieldInternal( int i, OGRField * puValue );
385
386 protected:
388 mutable char *m_pszStyleString;
389 mutable OGRStyleTable *m_poStyleTable;
390 mutable char *m_pszTmpFieldValue;
392
393 bool CopySelfTo( OGRFeature *poNew ) const;
394
395 public:
396 explicit OGRFeature( OGRFeatureDefn * );
397 virtual ~OGRFeature();
398
400 class CPL_DLL FieldValue
401 {
402 friend class OGRFeature;
403 struct Private;
404 std::unique_ptr<Private> m_poPrivate;
405
406 FieldValue(OGRFeature* poFeature, int iFieldIndex);
407 FieldValue(const OGRFeature* poFeature, int iFieldIndex);
408 FieldValue(const FieldValue& oOther) = delete;
409
410 public:
412 ~FieldValue();
414
416 FieldValue& operator= (const FieldValue& oOther);
418 FieldValue& operator= (int nVal);
420 FieldValue& operator= (GIntBig nVal);
422 FieldValue& operator= (double dfVal);
424 FieldValue& operator= (const char *pszVal);
426 FieldValue& operator= (const std::string& osVal);
428 FieldValue& operator= (const std::vector<int>& oArray);
430 FieldValue& operator= (const std::vector<GIntBig>& oArray);
432 FieldValue& operator= (const std::vector<double>& oArray);
434 FieldValue& operator= (const std::vector<std::string>& oArray);
436 FieldValue& operator= (CSLConstList papszValues);
438 void SetNull();
440 void clear();
442 void Unset() { clear(); }
444 void SetDateTime(int nYear, int nMonth, int nDay,
445 int nHour=0, int nMinute=0, float fSecond=0.f,
446 int nTZFlag = 0 );
447
449 int GetIndex() const;
451 const OGRFieldDefn* GetDefn() const;
453 const char* GetName() const { return GetDefn()->GetNameRef(); }
455 OGRFieldType GetType() const { return GetDefn()->GetType(); }
457 OGRFieldSubType GetSubType() const { return GetDefn()->GetSubType(); }
458
460 // cppcheck-suppress functionStatic
461 bool empty() const { return IsUnset(); }
462
464 // cppcheck-suppress functionStatic
465 bool IsUnset() const;
466
468 // cppcheck-suppress functionStatic
469 bool IsNull() const;
470
472 const OGRField *GetRawValue() const;
473
477 // cppcheck-suppress functionStatic
478 int GetInteger() const { return GetRawValue()->Integer; }
479
483 // cppcheck-suppress functionStatic
484 GIntBig GetInteger64() const { return GetRawValue()->Integer64; }
485
489 // cppcheck-suppress functionStatic
490 double GetDouble() const { return GetRawValue()->Real; }
491
495 // cppcheck-suppress functionStatic
496 const char* GetString() const { return GetRawValue()->String; }
497
499 bool GetDateTime( int *pnYear, int *pnMonth,
500 int *pnDay,
501 int *pnHour, int *pnMinute,
502 float *pfSecond,
503 int *pnTZFlag ) const;
504
506 operator int () const { return GetAsInteger(); }
508 operator GIntBig() const { return GetAsInteger64(); }
510 operator double () const { return GetAsDouble(); }
512 operator const char*() const { return GetAsString(); }
514 operator const std::vector<int>& () const { return GetAsIntegerList(); }
516 operator const std::vector<GIntBig>& () const { return GetAsInteger64List(); }
518 operator const std::vector<double>& () const { return GetAsDoubleList(); }
520 operator const std::vector<std::string>& () const { return GetAsStringList(); }
522 operator CSLConstList () const;
523
525 int GetAsInteger() const;
527 GIntBig GetAsInteger64() const;
529 double GetAsDouble() const;
531 const char* GetAsString() const;
533 const std::vector<int>& GetAsIntegerList() const;
535 const std::vector<GIntBig>& GetAsInteger64List() const;
537 const std::vector<double>& GetAsDoubleList() const;
539 const std::vector<std::string>& GetAsStringList() const;
540 };
541
543 class CPL_DLL ConstFieldIterator
544 {
545 friend class OGRFeature;
546 struct Private;
547 std::unique_ptr<Private> m_poPrivate;
548
549 ConstFieldIterator(const OGRFeature* poSelf, int nPos);
550
551 public:
553 ConstFieldIterator(ConstFieldIterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
554 ~ConstFieldIterator();
555 const FieldValue& operator*() const;
556 ConstFieldIterator& operator++();
557 bool operator!=(const ConstFieldIterator& it) const;
559 };
560
577 ConstFieldIterator begin() const;
579 ConstFieldIterator end() const;
580
581 const FieldValue operator[](int iField) const;
582 FieldValue operator[](int iField);
583
585 class FieldNotFoundException: public std::exception {};
586
587 const FieldValue operator[](const char* pszFieldName) const;
588 FieldValue operator[](const char* pszFieldName);
589
590 OGRFeatureDefn *GetDefnRef() { return poDefn; }
591 const OGRFeatureDefn *GetDefnRef() const { return poDefn; }
592
593 OGRErr SetGeometryDirectly( OGRGeometry * );
594 OGRErr SetGeometry( const OGRGeometry * );
595 OGRGeometry *GetGeometryRef();
596 const OGRGeometry *GetGeometryRef() const;
597 OGRGeometry *StealGeometry() CPL_WARN_UNUSED_RESULT;
598
599 int GetGeomFieldCount() const
600 { return poDefn->GetGeomFieldCount(); }
601 OGRGeomFieldDefn *GetGeomFieldDefnRef( int iField )
602 { return poDefn->GetGeomFieldDefn(iField); }
603 const OGRGeomFieldDefn *GetGeomFieldDefnRef( int iField ) const
604 { return poDefn->GetGeomFieldDefn(iField); }
605 int GetGeomFieldIndex( const char * pszName ) const
606 { return poDefn->GetGeomFieldIndex(pszName); }
607
608 OGRGeometry* GetGeomFieldRef( int iField );
609 const OGRGeometry* GetGeomFieldRef( int iField ) const;
610 OGRGeometry* StealGeometry( int iField );
611 OGRGeometry* GetGeomFieldRef( const char* pszFName );
612 const OGRGeometry* GetGeomFieldRef( const char* pszFName ) const;
613 OGRErr SetGeomFieldDirectly( int iField, OGRGeometry * );
614 OGRErr SetGeomField( int iField, const OGRGeometry * );
615
616 OGRFeature *Clone() const CPL_WARN_UNUSED_RESULT;
617 virtual OGRBoolean Equal( const OGRFeature * poFeature ) const;
618
619 int GetFieldCount() const
620 { return poDefn->GetFieldCount(); }
621 const OGRFieldDefn *GetFieldDefnRef( int iField ) const
622 { return poDefn->GetFieldDefn(iField); }
623 OGRFieldDefn *GetFieldDefnRef( int iField )
624 { return poDefn->GetFieldDefn(iField); }
625 int GetFieldIndex( const char * pszName ) const
626 { return poDefn->GetFieldIndex(pszName); }
627
628 int IsFieldSet( int iField ) const;
629
630 void UnsetField( int iField );
631
632 bool IsFieldNull( int iField ) const;
633
634 void SetFieldNull( int iField );
635
636 bool IsFieldSetAndNotNull( int iField ) const;
637
638 OGRField *GetRawFieldRef( int i ) { return pauFields + i; }
639 const OGRField *GetRawFieldRef( int i ) const { return pauFields + i; }
640
641 int GetFieldAsInteger( int i ) const;
642 GIntBig GetFieldAsInteger64( int i ) const;
643 double GetFieldAsDouble( int i ) const;
644 const char *GetFieldAsString( int i ) const;
645 const int *GetFieldAsIntegerList( int i, int *pnCount ) const;
646 const GIntBig *GetFieldAsInteger64List( int i, int *pnCount ) const;
647 const double *GetFieldAsDoubleList( int i, int *pnCount ) const;
648 char **GetFieldAsStringList( int i ) const;
649 GByte *GetFieldAsBinary( int i, int *pnCount ) const;
650 int GetFieldAsDateTime( int i,
651 int *pnYear, int *pnMonth,
652 int *pnDay,
653 int *pnHour, int *pnMinute,
654 int *pnSecond,
655 int *pnTZFlag ) const;
656 int GetFieldAsDateTime( int i,
657 int *pnYear, int *pnMonth,
658 int *pnDay,
659 int *pnHour, int *pnMinute,
660 float *pfSecond,
661 int *pnTZFlag ) const;
662 char *GetFieldAsSerializedJSon( int i ) const;
663
664 int GetFieldAsInteger( const char *pszFName ) const
665 { return GetFieldAsInteger( GetFieldIndex(pszFName) ); }
666 GIntBig GetFieldAsInteger64( const char *pszFName ) const
667 { return GetFieldAsInteger64( GetFieldIndex(pszFName) ); }
668 double GetFieldAsDouble( const char *pszFName ) const
669 { return GetFieldAsDouble( GetFieldIndex(pszFName) ); }
670 const char *GetFieldAsString( const char *pszFName ) const
671 { return GetFieldAsString( GetFieldIndex(pszFName) ); }
672 const int *GetFieldAsIntegerList( const char *pszFName,
673 int *pnCount ) const
674 { return GetFieldAsIntegerList( GetFieldIndex(pszFName),
675 pnCount ); }
676 const GIntBig *GetFieldAsInteger64List( const char *pszFName,
677 int *pnCount ) const
678 { return GetFieldAsInteger64List( GetFieldIndex(pszFName),
679 pnCount ); }
680 const double *GetFieldAsDoubleList( const char *pszFName,
681 int *pnCount ) const
682 { return GetFieldAsDoubleList( GetFieldIndex(pszFName),
683 pnCount ); }
684 char **GetFieldAsStringList( const char *pszFName ) const
685 { return GetFieldAsStringList(GetFieldIndex(pszFName)); }
686
687 void SetField( int i, int nValue );
688 void SetField( int i, GIntBig nValue );
689 void SetField( int i, double dfValue );
690 void SetField( int i, const char * pszValue );
691 void SetField( int i, int nCount, const int * panValues );
692 void SetField( int i, int nCount,
693 const GIntBig * panValues );
694 void SetField( int i, int nCount, const double * padfValues );
695 void SetField( int i, const char * const * papszValues );
696 void SetField( int i, OGRField * puValue );
697 void SetField( int i, int nCount, const void * pabyBinary );
698 void SetField( int i, int nYear, int nMonth, int nDay,
699 int nHour=0, int nMinute=0, float fSecond=0.f,
700 int nTZFlag = 0 );
701
702 void SetField( const char *pszFName, int nValue )
703 { SetField( GetFieldIndex(pszFName), nValue ); }
704 void SetField( const char *pszFName, GIntBig nValue )
705 { SetField( GetFieldIndex(pszFName), nValue ); }
706 void SetField( const char *pszFName, double dfValue )
707 { SetField( GetFieldIndex(pszFName), dfValue ); }
708 void SetField( const char *pszFName, const char * pszValue )
709 { SetField( GetFieldIndex(pszFName), pszValue ); }
710 void SetField( const char *pszFName, int nCount,
711 const int * panValues )
712 { SetField(GetFieldIndex(pszFName),nCount,panValues); }
713 void SetField( const char *pszFName, int nCount,
714 const GIntBig * panValues )
715 { SetField(GetFieldIndex(pszFName),nCount,panValues); }
716 void SetField( const char *pszFName, int nCount,
717 const double * padfValues )
718 {SetField(GetFieldIndex(pszFName),nCount,padfValues); }
719 void SetField( const char *pszFName, const char * const * papszValues )
720 { SetField( GetFieldIndex(pszFName), papszValues); }
721 void SetField( const char *pszFName, OGRField * puValue )
722 { SetField( GetFieldIndex(pszFName), puValue ); }
723 void SetField( const char *pszFName,
724 int nYear, int nMonth, int nDay,
725 int nHour=0, int nMinute=0, float fSecond=0.f,
726 int nTZFlag = 0 )
727 { SetField( GetFieldIndex(pszFName),
728 nYear, nMonth, nDay,
729 nHour, nMinute, fSecond, nTZFlag ); }
730
731 GIntBig GetFID() const { return nFID; }
732 virtual OGRErr SetFID( GIntBig nFIDIn );
733
734 void DumpReadable( FILE *, char** papszOptions = nullptr ) const;
735
736 OGRErr SetFrom( const OGRFeature *, int = TRUE );
737 OGRErr SetFrom( const OGRFeature *, const int *, int = TRUE );
738 OGRErr SetFieldsFrom( const OGRFeature *, const int *, int = TRUE );
739
741 OGRErr RemapFields( OGRFeatureDefn *poNewDefn,
742 const int *panRemapSource );
743 void AppendField();
744 OGRErr RemapGeomFields( OGRFeatureDefn *poNewDefn,
745 const int *panRemapSource );
747
748 int Validate( int nValidateFlags,
749 int bEmitError ) const;
750 void FillUnsetWithDefault( int bNotNullableOnly,
751 char** papszOptions );
752
753 virtual const char *GetStyleString() const;
754 virtual void SetStyleString( const char * );
755 virtual void SetStyleStringDirectly( char * );
756
760 virtual OGRStyleTable *GetStyleTable() const { return m_poStyleTable; } /* f.i.x.m.e: add a const qualifier for return type */
761 virtual void SetStyleTable( OGRStyleTable *poStyleTable );
762 virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
763
764 const char *GetNativeData() const { return m_pszNativeData; }
765 const char *GetNativeMediaType() const
766 { return m_pszNativeMediaType; }
767 void SetNativeData( const char* pszNativeData );
768 void SetNativeMediaType( const char* pszNativeMediaType );
769
770 static OGRFeature *CreateFeature( OGRFeatureDefn * );
771 static void DestroyFeature( OGRFeature * );
772
776 static inline OGRFeatureH ToHandle(OGRFeature* poFeature)
777 { return reinterpret_cast<OGRFeatureH>(poFeature); }
778
782 static inline OGRFeature* FromHandle(OGRFeatureH hFeature)
783 { return reinterpret_cast<OGRFeature*>(hFeature); }
784
785 private:
786 CPL_DISALLOW_COPY_ASSIGN(OGRFeature)
787 };
788
790 struct CPL_DLL OGRFeatureUniquePtrDeleter
791 {
792 void operator()(OGRFeature*) const;
793 };
795
799 typedef std::unique_ptr<OGRFeature, OGRFeatureUniquePtrDeleter> OGRFeatureUniquePtr;
800
802
803 inline OGRFeature::ConstFieldIterator begin(const OGRFeature* poFeature) { return poFeature->begin(); }
805 inline OGRFeature::ConstFieldIterator end(const OGRFeature* poFeature) { return poFeature->end(); }
806
808 inline OGRFeature::ConstFieldIterator begin(const OGRFeatureUniquePtr& poFeature) { return poFeature->begin(); }
810 inline OGRFeature::ConstFieldIterator end(const OGRFeatureUniquePtr& poFeature) { return poFeature->end(); }
811
813
814 /************************************************************************/
815 /* OGRFieldDomain */
816 /************************************************************************/
817
838 class CPL_DLL OGRFieldDomain
839 {
840 protected:
842 std::string m_osName;
843 std::string m_osDescription;
844 OGRFieldDomainType m_eDomainType;
845 OGRFieldType m_eFieldType;
846 OGRFieldSubType m_eFieldSubType;
847 OGRFieldDomainSplitPolicy m_eSplitPolicy = OFDSP_DEFAULT_VALUE;
848 OGRFieldDomainMergePolicy m_eMergePolicy = OFDMP_DEFAULT_VALUE;
849
850 OGRFieldDomain(const std::string& osName,
851 const std::string& osDescription,
852 OGRFieldDomainType eDomainType,
853 OGRFieldType eFieldType,
854 OGRFieldSubType eFieldSubType);
857 public:
862 virtual ~OGRFieldDomain() = 0;
863
868 virtual OGRFieldDomain* Clone() const = 0;
869
874 const std::string& GetName() const { return m_osName; }
875
881 const std::string& GetDescription() const { return m_osDescription; }
882
887 OGRFieldDomainType GetDomainType() const { return m_eDomainType; }
888
893 OGRFieldType GetFieldType() const { return m_eFieldType; }
894
899 OGRFieldSubType GetFieldSubType() const { return m_eFieldSubType; }
900
902 static inline OGRFieldDomainH ToHandle(OGRFieldDomain* poFieldDomain)
903 { return reinterpret_cast<OGRFieldDomainH>(poFieldDomain); }
904
906 static inline OGRFieldDomain* FromHandle(OGRFieldDomainH hFieldDomain)
907 { return reinterpret_cast<OGRFieldDomain*>(hFieldDomain); }
908
913 OGRFieldDomainSplitPolicy GetSplitPolicy() const { return m_eSplitPolicy; }
914
919 void SetSplitPolicy(OGRFieldDomainSplitPolicy policy) { m_eSplitPolicy = policy; }
920
925 OGRFieldDomainMergePolicy GetMergePolicy() const { return m_eMergePolicy; }
926
931 void SetMergePolicy(OGRFieldDomainMergePolicy policy) { m_eMergePolicy = policy; }
932 };
933
940 class CPL_DLL OGRCodedFieldDomain final: public OGRFieldDomain
941 {
942 private:
943 std::vector<OGRCodedValue> m_asValues{};
944
945 OGRCodedFieldDomain(const OGRCodedFieldDomain&) = delete;
946 OGRCodedFieldDomain& operator= (const OGRCodedFieldDomain&) = delete;
947
948 public:
963 OGRCodedFieldDomain(const std::string& osName,
964 const std::string& osDescription,
965 OGRFieldType eFieldType,
966 OGRFieldSubType eFieldSubType,
967 std::vector<OGRCodedValue>&& asValues);
968
969 ~OGRCodedFieldDomain() override;
970
971 OGRCodedFieldDomain* Clone() const override;
972
978 const OGRCodedValue* GetEnumeration() const { return m_asValues.data(); }
979 };
980
983 class CPL_DLL OGRRangeFieldDomain final: public OGRFieldDomain
984 {
985 private:
986 OGRField m_sMin;
987 OGRField m_sMax;
988 bool m_bMinIsInclusive;
989 bool m_bMaxIsInclusive;
990
991 OGRRangeFieldDomain(const OGRRangeFieldDomain&) = delete;
992 OGRRangeFieldDomain& operator= (const OGRRangeFieldDomain&) = delete;
993
994 public:
1019 OGRRangeFieldDomain(const std::string& osName,
1020 const std::string& osDescription,
1021 OGRFieldType eFieldType,
1022 OGRFieldSubType eFieldSubType,
1023 const OGRField& sMin,
1024 bool bMinIsInclusive,
1025 const OGRField& sMax,
1026 bool bMaxIsInclusive);
1027
1028 OGRRangeFieldDomain* Clone() const override {
1029 return new OGRRangeFieldDomain(m_osName, m_osDescription,
1030 m_eFieldType, m_eFieldSubType,
1031 m_sMin, m_bMinIsInclusive,
1032 m_sMax, m_bMaxIsInclusive);
1033 }
1034
1046 const OGRField& GetMin(bool& bIsInclusiveOut) const {
1047 bIsInclusiveOut = m_bMinIsInclusive;
1048 return m_sMin;
1049 }
1050
1062 const OGRField& GetMax(bool& bIsInclusiveOut) const {
1063 bIsInclusiveOut = m_bMaxIsInclusive;
1064 return m_sMax;
1065 }
1066 };
1067
1072 class CPL_DLL OGRGlobFieldDomain final: public OGRFieldDomain
1073 {
1074 private:
1075 std::string m_osGlob;
1076
1077 OGRGlobFieldDomain(const OGRGlobFieldDomain&) = delete;
1078 OGRGlobFieldDomain& operator= (const OGRGlobFieldDomain&) = delete;
1079
1080 public:
1091 OGRGlobFieldDomain(const std::string& osName,
1092 const std::string& osDescription,
1093 OGRFieldType eFieldType,
1094 OGRFieldSubType eFieldSubType,
1095 const std::string& osBlob);
1096
1097 OGRGlobFieldDomain* Clone() const override {
1098 return new OGRGlobFieldDomain(m_osName, m_osDescription,
1099 m_eFieldType, m_eFieldSubType,
1100 m_osGlob);
1101 }
1102
1107 const std::string& GetGlob() const { return m_osGlob; }
1108 };
1109
1110 /************************************************************************/
1111 /* OGRFeatureQuery */
1112 /************************************************************************/
1113
1115 class OGRLayer;
1116 class swq_expr_node;
1117 class swq_custom_func_registrar;
1118
1119 class CPL_DLL OGRFeatureQuery
1120 {
1121 private:
1122 OGRFeatureDefn *poTargetDefn;
1123 void *pSWQExpr;
1124
1125 char **FieldCollector( void *, char ** );
1126
1127 GIntBig *EvaluateAgainstIndices( swq_expr_node*, OGRLayer *,
1128 GIntBig& nFIDCount );
1129
1130 int CanUseIndex( swq_expr_node*, OGRLayer * );
1131
1132 OGRErr Compile( OGRLayer *, OGRFeatureDefn*, const char *,
1133 int bCheck,
1134 swq_custom_func_registrar* poCustomFuncRegistrar );
1135
1136 CPL_DISALLOW_COPY_ASSIGN(OGRFeatureQuery)
1137
1138 public:
1139 OGRFeatureQuery();
1140 ~OGRFeatureQuery();
1141
1142 OGRErr Compile( OGRLayer *, const char *,
1143 int bCheck = TRUE,
1144 swq_custom_func_registrar*
1145 poCustomFuncRegistrar = nullptr );
1146 OGRErr Compile( OGRFeatureDefn *, const char *,
1147 int bCheck = TRUE,
1148 swq_custom_func_registrar*
1149 poCustomFuncRegistrar = nullptr );
1150 int Evaluate( OGRFeature * );
1151
1152 GIntBig *EvaluateAgainstIndices( OGRLayer *, OGRErr * );
1153
1154 int CanUseIndex( OGRLayer * );
1155
1156 char **GetUsedFields();
1157
1158 void *GetSWQExpr() { return pSWQExpr; }
1159 };
1161
1162 #endif /* ndef OGR_FEATURE_H_INCLUDED */
OGRCodedFieldDomain
Definition of a coded / enumerated field domain.
Definition: ogr_feature.h:941
OGRCodedFieldDomain::GetEnumeration
const OGRCodedValue * GetEnumeration() const
Get the enumeration as (code, value) pairs.
Definition: ogr_feature.h:978
OGRFeatureDefn
Definition of a feature class or feature layer.
Definition: ogr_feature.h:279
OGRFeatureDefn::SetStyleIgnored
virtual void SetStyleIgnored(int bIgnore)
Set whether the style can be omitted when fetching features.
Definition: ogr_feature.h:334
OGRFeatureDefn::Reference
int Reference()
Increments the reference count by one.
Definition: ogr_feature.h:326
OGRFeatureDefn::GetFieldCount
virtual int GetFieldCount() const
Fetch number of fields on this feature.
Definition: ogrfeaturedefn.cpp:286
OGRFeatureDefn::GetFieldDefn
virtual OGRFieldDefn * GetFieldDefn(int i)
Fetch field definition.
Definition: ogrfeaturedefn.cpp:330
OGRFeatureDefn::FromHandle
static OGRFeatureDefn * FromHandle(OGRFeatureDefnH hFeatureDefn)
Convert a OGRFeatureDefnH to a OGRFeatureDefn*.
Definition: ogr_feature.h:358
OGRFeatureDefn::IsStyleIgnored
virtual int IsStyleIgnored() const
Determine whether the style can be omitted when fetching features.
Definition: ogr_feature.h:333
OGRFeatureDefn::Dereference
int Dereference()
Decrements the reference count by one.
Definition: ogr_feature.h:327
OGRFeatureDefn::ToHandle
static OGRFeatureDefnH ToHandle(OGRFeatureDefn *poFeatureDefn)
Convert a OGRFeatureDefn* to a OGRFeatureDefnH.
Definition: ogr_feature.h:352
OGRFeatureDefn::GetGeomFieldDefn
virtual OGRGeomFieldDefn * GetGeomFieldDefn(int i)
Fetch geometry field definition.
Definition: ogrfeaturedefn.cpp:681
OGRFeatureDefn::GetGeomFieldCount
virtual int GetGeomFieldCount() const
Fetch number of geometry fields on this feature.
Definition: ogrfeaturedefn.cpp:632
OGRFeatureDefn::GetFieldIndex
virtual int GetFieldIndex(const char *) const
Find field by name.
Definition: ogrfeaturedefn.cpp:1218
OGRFeatureDefn::GetReferenceCount
int GetReferenceCount() const
Fetch current reference count.
Definition: ogr_feature.h:328
OGRFeatureDefn::GetGeomFieldIndex
virtual int GetGeomFieldIndex(const char *) const
Find geometry field by name.
Definition: ogrfeaturedefn.cpp:916
OGRFeature::ConstFieldIterator
Field value iterator class.
Definition: ogr_feature.h:544
OGRFeature::FieldNotFoundException
Exception raised by operator[](const char*) when a field is not found.
Definition: ogr_feature.h:585
OGRFeature::FieldValue
Field value.
Definition: ogr_feature.h:401
OGRFeature::FieldValue::empty
bool empty() const
Return whether the field value is unset/empty.
Definition: ogr_feature.h:461
OGRFeature::FieldValue::GetInteger
int GetInteger() const
Return the integer value.
Definition: ogr_feature.h:478
OGRFeature::FieldValue::GetType
OGRFieldType GetType() const
Return field type.
Definition: ogr_feature.h:455
OGRFeature::FieldValue::Unset
void Unset()
Unset the field.
Definition: ogr_feature.h:442
OGRFeature::FieldValue::GetString
const char * GetString() const
Return the string value.
Definition: ogr_feature.h:496
OGRFeature::FieldValue::GetDouble
double GetDouble() const
Return the double value.
Definition: ogr_feature.h:490
OGRFeature::FieldValue::GetName
const char * GetName() const
Return field name.
Definition: ogr_feature.h:453
OGRFeature::FieldValue::GetInteger64
GIntBig GetInteger64() const
Return the 64-bit integer value.
Definition: ogr_feature.h:484
OGRFeature::FieldValue::GetSubType
OGRFieldSubType GetSubType() const
Return field subtype.
Definition: ogr_feature.h:457
OGRFeature
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:374
OGRFeature::GetDefnRef
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition: ogr_feature.h:590
OGRFeature::ToHandle
static OGRFeatureH ToHandle(OGRFeature *poFeature)
Convert a OGRFeature* to a OGRFeatureH.
Definition: ogr_feature.h:776
OGRFeature::GetFieldAsStringList
char ** GetFieldAsStringList(const char *pszFName) const
Fetch field value as a list of strings.
Definition: ogr_feature.h:684
OGRFeature::GetStyleTable
virtual OGRStyleTable * GetStyleTable() const
Return style table.
Definition: ogr_feature.h:760
OGRFeature::end
ConstFieldIterator end() const
Return end of field value iterator.
Definition: ogrfeature.cpp:7070
OGRFeature::begin
ConstFieldIterator begin() const
Return begin of field value iterator.
Definition: ogrfeature.cpp:7065
OGRFeature::SetField
void SetField(const char *pszFName, int nCount, const GIntBig *panValues)
Set field to list of 64 bit integers value.
Definition: ogr_feature.h:713
OGRFeature::GetDefnRef
const OGRFeatureDefn * GetDefnRef() const
Fetch feature definition.
Definition: ogr_feature.h:591
OGRFeature::GetFieldDefnRef
OGRFieldDefn * GetFieldDefnRef(int iField)
Fetch definition for this field.
Definition: ogr_feature.h:623
OGRFeature::GetFieldAsDoubleList
const double * GetFieldAsDoubleList(const char *pszFName, int *pnCount) const
Fetch field value as a list of doubles.
Definition: ogr_feature.h:680
OGRFeature::SetField
void SetField(const char *pszFName, int nCount, const int *panValues)
Set field to list of integers value.
Definition: ogr_feature.h:710
OGRFeature::SetField
void SetField(const char *pszFName, GIntBig nValue)
Set field to 64 bit integer value.
Definition: ogr_feature.h:704
OGRFeature::SetField
void SetField(const char *pszFName, const char *pszValue)
Set field to string value.
Definition: ogr_feature.h:708
OGRFeature::SetField
void SetField(const char *pszFName, int nValue)
Set field to integer value.
Definition: ogr_feature.h:702
OGRFeature::GetFieldDefnRef
const OGRFieldDefn * GetFieldDefnRef(int iField) const
Fetch definition for this field.
Definition: ogr_feature.h:621
OGRFeature::SetField
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:723
OGRFeature::GetGeomFieldDefnRef
const OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField) const
Fetch definition for this geometry field.
Definition: ogr_feature.h:603
OGRFeature::GetNativeData
const char * GetNativeData() const
Returns the native data for the feature.
Definition: ogr_feature.h:764
OGRFeature::GetFieldIndex
int GetFieldIndex(const char *pszName) const
Fetch the field index given field name.
Definition: ogr_feature.h:625
OGRFeature::FromHandle
static OGRFeature * FromHandle(OGRFeatureH hFeature)
Convert a OGRFeatureH to a OGRFeature*.
Definition: ogr_feature.h:782
OGRFeature::GetGeomFieldIndex
int GetGeomFieldIndex(const char *pszName) const
Fetch the geometry field index given geometry field name.
Definition: ogr_feature.h:605
OGRFeature::GetGeomFieldDefnRef
OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField)
Fetch definition for this geometry field.
Definition: ogr_feature.h:601
OGRFeature::SetField
void SetField(const char *pszFName, OGRField *puValue)
Set field.
Definition: ogr_feature.h:721
OGRFeature::GetFieldAsInteger64
GIntBig GetFieldAsInteger64(const char *pszFName) const
Fetch field value as integer 64 bit.
Definition: ogr_feature.h:666
OGRFeature::GetFieldAsIntegerList
const int * GetFieldAsIntegerList(const char *pszFName, int *pnCount) const
Fetch field value as a list of integers.
Definition: ogr_feature.h:672
OGRFeature::SetField
void SetField(const char *pszFName, double dfValue)
Set field to double value.
Definition: ogr_feature.h:706
OGRFeature::GetFieldAsString
const char * GetFieldAsString(const char *pszFName) const
Fetch field value as a string.
Definition: ogr_feature.h:670
OGRFeature::SetField
void SetField(const char *pszFName, const char *const *papszValues)
Set field to list of strings value.
Definition: ogr_feature.h:719
OGRFeature::GetRawFieldRef
const OGRField * GetRawFieldRef(int i) const
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:639
OGRFeature::GetFieldAsInteger
int GetFieldAsInteger(const char *pszFName) const
Fetch field value as integer.
Definition: ogr_feature.h:664
OGRFeature::GetNativeMediaType
const char * GetNativeMediaType() const
Returns the native media type for the feature.
Definition: ogr_feature.h:765
OGRFeature::GetFID
GIntBig GetFID() const
Get feature identifier.
Definition: ogr_feature.h:731
OGRFeature::GetRawFieldRef
OGRField * GetRawFieldRef(int i)
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:638
OGRFeature::SetField
void SetField(const char *pszFName, int nCount, const double *padfValues)
Set field to list of doubles value.
Definition: ogr_feature.h:716
OGRFeature::GetFieldAsDouble
double GetFieldAsDouble(const char *pszFName) const
Fetch field value as a double.
Definition: ogr_feature.h:668
OGRFeature::GetFieldAsInteger64List
const GIntBig * GetFieldAsInteger64List(const char *pszFName, int *pnCount) const
Fetch field value as a list of 64 bit integers.
Definition: ogr_feature.h:676
OGRFieldDefn
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:99
OGRFieldDefn::GetNameRef
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:123
OGRFieldDefn::IsNullable
int IsNullable() const
Return whether this field can receive null values.
Definition: ogr_feature.h:157
OGRFieldDefn::FromHandle
static OGRFieldDefn * FromHandle(OGRFieldDefnH hFieldDefn)
Convert a OGRFieldDefnH to a OGRFieldDefn*.
Definition: ogr_feature.h:177
OGRFieldDefn::IsUnique
int IsUnique() const
Return whether this field has a unique constraint.
Definition: ogr_feature.h:160
OGRFieldDefn::SetUnique
void SetUnique(int bUniqueIn)
Set whether this field has a unique constraint.
Definition: ogr_feature.h:161
OGRFieldDefn::GetSubType
OGRFieldSubType GetSubType() const
Fetch subtype of this field.
Definition: ogr_feature.h:132
OGRFieldDefn::GetJustify
OGRJustification GetJustify() const
Get the justification for this field.
Definition: ogr_feature.h:136
OGRFieldDefn::SetIgnored
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:155
OGRFieldDefn::SetDomainName
void SetDomainName(const std::string &osDomainName)
Set the name of the field domain for this field.
Definition: ogr_feature.h:164
OGRFieldDefn::GetPrecision
int GetPrecision() const
Get the formatting precision for this field.
Definition: ogr_feature.h:143
OGRFieldDefn::GetType
OGRFieldType GetType() const
Fetch type of this field.
Definition: ogr_feature.h:128
OGRFieldDefn::SetWidth
void SetWidth(int nWidthIn)
Set the formatting width for this field in characters.
Definition: ogr_feature.h:141
OGRFieldDefn::GetWidth
int GetWidth() const
Get the formatting width for this field.
Definition: ogr_feature.h:140
OGRFieldDefn::SetPrecision
void SetPrecision(int nPrecisionIn)
Set the formatting precision for this field in characters.
Definition: ogr_feature.h:144
OGRFieldDefn::SetNullable
void SetNullable(int bNullableIn)
Set whether this field can receive null values.
Definition: ogr_feature.h:158
OGRFieldDefn::SetJustify
void SetJustify(OGRJustification eJustifyIn)
Set the justification for this field.
Definition: ogr_feature.h:137
OGRFieldDefn::GetAlternativeNameRef
const char * GetAlternativeNameRef() const
Fetch the alternative name (or "alias") for this field.
Definition: ogr_feature.h:126
OGRFieldDefn::ToHandle
static OGRFieldDefnH ToHandle(OGRFieldDefn *poFieldDefn)
Convert a OGRFieldDefn* to a OGRFieldDefnH.
Definition: ogr_feature.h:171
OGRFieldDefn::GetDomainName
const std::string & GetDomainName() const
Return the name of the field domain for this field.
Definition: ogr_feature.h:163
OGRFieldDefn::IsIgnored
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:154
OGRFieldDomain
Definition of a field domain.
Definition: ogr_feature.h:839
OGRFieldDomain::GetMergePolicy
OGRFieldDomainMergePolicy GetMergePolicy() const
Get the merge policy.
Definition: ogr_feature.h:925
OGRFieldDomain::SetMergePolicy
void SetMergePolicy(OGRFieldDomainMergePolicy policy)
Set the merge policy.
Definition: ogr_feature.h:931
OGRFieldDomain::FromHandle
static OGRFieldDomain * FromHandle(OGRFieldDomainH hFieldDomain)
Convert a OGRFieldDomainH to a OGRFieldDomain*.
Definition: ogr_feature.h:906
OGRFieldDomain::GetFieldSubType
OGRFieldSubType GetFieldSubType() const
Get the field subtype.
Definition: ogr_feature.h:899
OGRFieldDomain::~OGRFieldDomain
virtual ~OGRFieldDomain()=0
Destructor.
OGRFieldDomain::Clone
virtual OGRFieldDomain * Clone() const =0
Clone.
OGRFieldDomain::GetSplitPolicy
OGRFieldDomainSplitPolicy GetSplitPolicy() const
Get the split policy.
Definition: ogr_feature.h:913
OGRFieldDomain::ToHandle
static OGRFieldDomainH ToHandle(OGRFieldDomain *poFieldDomain)
Convert a OGRFieldDomain* to a OGRFieldDomainH.
Definition: ogr_feature.h:902
OGRFieldDomain::GetDescription
const std::string & GetDescription() const
Get the description of the field domain.
Definition: ogr_feature.h:881
OGRFieldDomain::GetFieldType
OGRFieldType GetFieldType() const
Get the field type.
Definition: ogr_feature.h:893
OGRFieldDomain::GetDomainType
OGRFieldDomainType GetDomainType() const
Get the type of the field domain.
Definition: ogr_feature.h:887
OGRFieldDomain::GetName
const std::string & GetName() const
Get the name of the field domain.
Definition: ogr_feature.h:874
OGRFieldDomain::SetSplitPolicy
void SetSplitPolicy(OGRFieldDomainSplitPolicy policy)
Set the split policy.
Definition: ogr_feature.h:919
OGRGeomFieldDefn
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:202
OGRGeomFieldDefn::SetIgnored
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:231
OGRGeomFieldDefn::IsNullable
int IsNullable() const
Return whether this geometry field can receive null values.
Definition: ogr_feature.h:233
OGRGeomFieldDefn::FromHandle
static OGRGeomFieldDefn * FromHandle(OGRGeomFieldDefnH hGeomFieldDefn)
Convert a OGRGeomFieldDefnH to a OGRGeomFieldDefn*.
Definition: ogr_feature.h:248
OGRGeomFieldDefn::SetNullable
void SetNullable(int bNullableIn)
Set whether this geometry field can receive null values.
Definition: ogr_feature.h:234
OGRGeomFieldDefn::GetType
OGRwkbGeometryType GetType() const
Fetch geometry type of this field.
Definition: ogr_feature.h:224
OGRGeomFieldDefn::IsIgnored
int IsIgnored() const
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:230
OGRGeomFieldDefn::ToHandle
static OGRGeomFieldDefnH ToHandle(OGRGeomFieldDefn *poGeomFieldDefn)
Convert a OGRGeomFieldDefn* to a OGRGeomFieldDefnH.
Definition: ogr_feature.h:242
OGRGeomFieldDefn::GetNameRef
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:222
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:327
OGRGlobFieldDomain
Definition of a field domain for field content validated by a glob.
Definition: ogr_feature.h:1073
OGRGlobFieldDomain::Clone
OGRGlobFieldDomain * Clone() const override
Clone.
Definition: ogr_feature.h:1097
OGRGlobFieldDomain::GetGlob
const std::string & GetGlob() const
Get the glob expression.
Definition: ogr_feature.h:1107
OGRLayer
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:71
OGRRangeFieldDomain
Definition of a numeric field domain with a range of validity for values.
Definition: ogr_feature.h:984
OGRRangeFieldDomain::Clone
OGRRangeFieldDomain * Clone() const override
Clone.
Definition: ogr_feature.h:1028
OGRRangeFieldDomain::GetMin
const OGRField & GetMin(bool &bIsInclusiveOut) const
Get the minimum value.
Definition: ogr_feature.h:1046
OGRRangeFieldDomain::GetMax
const OGRField & GetMax(bool &bIsInclusiveOut) const
Get the maximum value.
Definition: ogr_feature.h:1062
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:158
OGRStyleTable
This class represents a style table.
Definition: ogr_featurestyle.h:85
CPL_DISALLOW_COPY_ASSIGN
#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:1007
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1216
CPL_WARN_UNUSED_RESULT
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:946
GByte
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:215
GIntBig
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:248
MAX
#define MAX(a, b)
Macro to compute the maximum of 2 values.
Definition: cpl_port.h:414
OGRFieldDefnH
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition: ogr_api.h:328
OGRFeatureDefnH
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition: ogr_api.h:330
OGRFeatureH
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition: ogr_api.h:332
OGRFieldDomainH
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition: ogr_api.h:340
OGRGeomFieldDefnH
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition: ogr_api.h:337
OGRBoolean
int OGRBoolean
Type for a OGR boolean.
Definition: ogr_core.h:334
OGRFieldSubType
OGRFieldSubType
List of field subtypes.
Definition: ogr_core.h:674
OGRFieldDomainMergePolicy
OGRFieldDomainMergePolicy
Merge policy for field domains.
Definition: ogr_core.h:1027
OFDMP_DEFAULT_VALUE
@ OFDMP_DEFAULT_VALUE
Default value.
Definition: ogr_core.h:1029
OGRFieldDomainType
OGRFieldDomainType
Type of field domain.
Definition: ogr_core.h:993
OGRJustification
OGRJustification
Display justification for field values.
Definition: ogr_core.h:698
OGRFieldType
OGRFieldType
List of feature field types.
Definition: ogr_core.h:646
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:346
wkbUnknown
@ wkbUnknown
unknown type, non-standard
Definition: ogr_core.h:347
OGRErr
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:318
OGRFieldDomainSplitPolicy
OGRFieldDomainSplitPolicy
Split policy for field domains.
Definition: ogr_core.h:1010
OFDSP_DEFAULT_VALUE
@ OFDSP_DEFAULT_VALUE
Default value.
Definition: ogr_core.h:1012
OGRFeatureUniquePtr
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition: ogr_feature.h:799
OGRFieldDefnH
void * OGRFieldDefnH
Opaque type for a field definition (OGRFieldDefn)
Definition: ogr_feature.h:60
OGRFeatureDefnH
void * OGRFeatureDefnH
Opaque type for a feature definition (OGRFeatureDefn)
Definition: ogr_feature.h:62
OGRFeatureH
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition: ogr_feature.h:64
OGRFieldDomainH
struct OGRFieldDomainHS * OGRFieldDomainH
Opaque type for a field domain definition (OGRFieldDomain)
Definition: ogr_feature.h:72
OGRGeomFieldDefnH
struct OGRGeomFieldDefnHS * OGRGeomFieldDefnH
Opaque type for a geometry field definition (OGRGeomFieldDefn)
Definition: ogr_feature.h:69
OGRStyleTableH
void * OGRStyleTableH
Opaque type for a style table (OGRStyleTable)
Definition: ogr_feature.h:66
ogr_featurestyle.h
Simple feature style classes.
ogr_geometry.h
Simple feature geometry classes.
begin
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:287
end
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:292
OGRCodedValue
Associates a code and a value.
Definition: ogr_core.h:980
OGRField
OGRFeature field attribute value union.
Definition: ogr_core.h:738