31 #ifndef _OGR_FEATURE_H_INCLUDED 32 #define _OGR_FEATURE_H_INCLUDED 36 #include "cpl_atomic_ops.h" 84 void SetName(
const char * );
97 { eJustify = eJustifyIn; }
100 void SetWidth(
int nWidthIn ) { nWidth = MAX(0,nWidthIn); }
104 { nPrecision = nPrecisionIn; }
109 void SetDefault(
const char* );
110 const char *GetDefault()
const;
111 int IsDefaultDriverSpecific()
const;
158 void SetName(
const char * );
203 volatile int nRefCount;
211 char *pszFeatureClassName;
219 virtual const char *GetName();
221 virtual int GetFieldCount();
223 virtual int GetFieldIndex(
const char * );
226 virtual OGRErr DeleteFieldDefn(
int iField );
227 virtual OGRErr ReorderFieldDefns(
int* panMap );
229 virtual int GetGeomFieldCount();
231 virtual int GetGeomFieldIndex(
const char * );
234 virtual OGRErr DeleteGeomFieldDefn(
int iGeomField );
246 virtual int IsGeometryIgnored();
247 virtual void SetGeometryIgnored(
int bIgnore );
253 static OGRFeatureDefn *CreateFeatureDefn(
const char *pszName = NULL );
275 char * m_pszStyleString;
277 char * m_pszTmpFieldValue;
299 OGRGeometry* GetGeomFieldRef(
const char* pszFName);
300 OGRErr SetGeomFieldDirectly(
int iField,
OGRGeometry * );
304 virtual OGRBoolean Equal(
OGRFeature * poFeature );
312 int IsFieldSet(
int iField );
314 void UnsetField(
int iField );
318 int GetFieldAsInteger(
int i );
319 GIntBig GetFieldAsInteger64(
int i );
320 double GetFieldAsDouble(
int i );
321 const char *GetFieldAsString(
int i );
322 const int *GetFieldAsIntegerList(
int i,
int *pnCount );
323 const GIntBig *GetFieldAsInteger64List(
int i,
int *pnCount );
324 const double *GetFieldAsDoubleList(
int i,
int *pnCount );
325 char **GetFieldAsStringList(
int i );
326 GByte *GetFieldAsBinary(
int i,
int *pnCount );
327 int GetFieldAsDateTime(
int i,
328 int *pnYear,
int *pnMonth,
int *pnDay,
329 int *pnHour,
int *pnMinute,
int *pnSecond,
331 int GetFieldAsDateTime(
int i,
332 int *pnYear,
int *pnMonth,
int *pnDay,
333 int *pnHour,
int *pnMinute,
float *pfSecond,
336 int GetFieldAsInteger(
const char *pszFName )
337 {
return GetFieldAsInteger( GetFieldIndex(pszFName) ); }
338 GIntBig GetFieldAsInteger64(
const char *pszFName )
339 {
return GetFieldAsInteger64( GetFieldIndex(pszFName) ); }
340 double GetFieldAsDouble(
const char *pszFName )
341 {
return GetFieldAsDouble( GetFieldIndex(pszFName) ); }
342 const char *GetFieldAsString(
const char *pszFName )
343 {
return GetFieldAsString( GetFieldIndex(pszFName) ); }
344 const int *GetFieldAsIntegerList(
const char *pszFName,
346 {
return GetFieldAsIntegerList( GetFieldIndex(pszFName),
348 const GIntBig *GetFieldAsInteger64List(
const char *pszFName,
350 {
return GetFieldAsInteger64List( GetFieldIndex(pszFName),
352 const double *GetFieldAsDoubleList(
const char *pszFName,
354 {
return GetFieldAsDoubleList( GetFieldIndex(pszFName),
356 char **GetFieldAsStringList(
const char *pszFName )
357 {
return GetFieldAsStringList(GetFieldIndex(pszFName)); }
359 void SetField(
int i,
int nValue );
360 void SetField(
int i, GIntBig nValue );
361 void SetField(
int i,
double dfValue );
362 void SetField(
int i,
const char * pszValue );
363 void SetField(
int i,
int nCount,
int * panValues );
364 void SetField(
int i,
int nCount,
const GIntBig * panValues );
365 void SetField(
int i,
int nCount,
double * padfValues );
366 void SetField(
int i,
char ** papszValues );
367 void SetField(
int i,
OGRField * puValue );
368 void SetField(
int i,
int nCount, GByte * pabyBinary );
369 void SetField(
int i,
int nYear,
int nMonth,
int nDay,
370 int nHour=0,
int nMinute=0,
float fSecond=0.f,
373 void SetField(
const char *pszFName,
int nValue )
374 { SetField( GetFieldIndex(pszFName), nValue ); }
375 void SetField(
const char *pszFName, GIntBig nValue )
376 { SetField( GetFieldIndex(pszFName), nValue ); }
377 void SetField(
const char *pszFName,
double dfValue )
378 { SetField( GetFieldIndex(pszFName), dfValue ); }
379 void SetField(
const char *pszFName,
const char * pszValue)
380 { SetField( GetFieldIndex(pszFName), pszValue ); }
381 void SetField(
const char *pszFName,
int nCount,
383 { SetField(GetFieldIndex(pszFName),nCount,panValues);}
384 void SetField(
const char *pszFName,
int nCount,
385 const GIntBig * panValues )
386 { SetField(GetFieldIndex(pszFName),nCount,panValues);}
387 void SetField(
const char *pszFName,
int nCount,
388 double * padfValues )
389 {SetField(GetFieldIndex(pszFName),nCount,padfValues);}
390 void SetField(
const char *pszFName,
char ** papszValues )
391 { SetField( GetFieldIndex(pszFName), papszValues); }
392 void SetField(
const char *pszFName,
OGRField * puValue )
393 { SetField( GetFieldIndex(pszFName), puValue ); }
394 void SetField(
const char *pszFName,
395 int nYear,
int nMonth,
int nDay,
396 int nHour=0,
int nMinute=0,
float fSecond=0.f,
398 { SetField( GetFieldIndex(pszFName),
400 nHour, nMinute, fSecond, nTZFlag ); }
403 virtual OGRErr SetFID( GIntBig nFIDIn );
405 void DumpReadable( FILE *,
char** papszOptions = NULL );
408 OGRErr SetFrom(
OGRFeature *,
int *,
int = TRUE );
409 OGRErr SetFieldsFrom(
OGRFeature *,
int *,
int = TRUE );
412 int *panRemapSource );
414 int *panRemapSource );
416 int Validate(
int nValidateFlags,
418 void FillUnsetWithDefault(
int bNotNullableOnly,
419 char** papszOptions );
421 virtual const char *GetStyleString();
422 virtual void SetStyleString(
const char * );
423 virtual void SetStyleStringDirectly(
char * );
424 virtual OGRStyleTable *GetStyleTable() {
return m_poStyleTable; }
426 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable);
446 char **FieldCollector(
void *,
char ** );
460 GIntBig *EvaluateAgainstIndices(
OGRLayer *, OGRErr * );
464 char **GetUsedFields();
466 void *GetSWQExpr() {
return pSWQExpr; }
int IsIgnored()
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:167
int GetReferenceCount()
Fetch current reference count.
Definition: ogr_feature.h:243
OGRFieldSubType
List of field subtypes.
Definition: ogr_core.h:540
OGRFieldSubType GetSubType()
Fetch subtype of this field.
Definition: ogr_feature.h:91
OGRField * GetRawFieldRef(int i)
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:316
const char * GetNameRef()
Fetch name of this field.
Definition: ogr_feature.h:159
void SetNullable(int bNullableIn)
Set whether this geometry field can receive null values.
Definition: ogr_feature.h:171
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:140
int GetPrecision()
Get the formatting precision for this field.
Definition: ogr_feature.h:102
virtual int GetGeomFieldCount()
Fetch number of geometry fields on this feature.
Definition: ogrfeaturedefn.cpp:573
virtual void SetStyleIgnored(int bIgnore)
Set whether the style can be omitted when fetching features.
Definition: ogr_feature.h:249
int GetWidth()
Get the formatting width for this field.
Definition: ogr_feature.h:99
int GetFieldIndex(const char *pszName)
Fetch the field index given field name.
Definition: ogr_feature.h:309
Definition of a feature class or feature layer.
Definition: ogr_feature.h:200
virtual int GetGeomFieldIndex(const char *)
Find geometry field by name.
Definition: ogrfeaturedefn.cpp:823
Simple feature style classes.
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:62
OGRFieldType GetType()
Fetch type of this field.
Definition: ogr_feature.h:87
const char * GetNameRef()
Fetch name of this field.
Definition: ogr_feature.h:85
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:309
OGRwkbGeometryType GetType()
Fetch geometry type of this field.
Definition: ogr_feature.h:161
virtual OGRGeomFieldDefn * GetGeomFieldDefn(int i)
Fetch geometry field definition.
Definition: ogrfeaturedefn.cpp:621
OGRFieldDefn * GetFieldDefnRef(int iField)
Fetch definition for this field.
Definition: ogr_feature.h:307
void SetPrecision(int nPrecisionIn)
Set the formatting precision for this field in characters.
Definition: ogr_feature.h:103
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:104
Definition: ogr_feature.h:440
int IsNullable() const
Return whether this field can receive null values.
Definition: ogr_feature.h:116
void SetWidth(int nWidthIn)
Set the formatting width for this field in characters.
Definition: ogr_feature.h:100
OGRJustification
Display justification for field values.
Definition: ogr_core.h:556
OGRJustification GetJustify()
Get the justification for this field.
Definition: ogr_feature.h:95
int Reference()
Increments the reference count by one.
Definition: ogr_feature.h:241
OGRFieldType
List of feature field types.
Definition: ogr_core.h:512
This class respresents a OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:129
int GetGeomFieldIndex(const char *pszName)
Fetch the geometry field index given geometry field name.
Definition: ogr_feature.h:294
int IsIgnored()
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:113
int GetFieldCount()
Fetch number of fields on this feature.
Definition: ogr_feature.h:306
int Dereference()
Decrements the reference count by one.
Definition: ogr_feature.h:242
int GetGeomFieldCount()
Fetch number of geometry fields on this feature.
Definition: ogr_feature.h:290
OGRFeature field attribute value union.
Definition: ogr_core.h:574
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:168
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:66
OGRGeomFieldDefn * GetGeomFieldDefnRef(int iField)
Fetch definition for this geometry field.
Definition: ogr_feature.h:292
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:265
virtual int GetFieldCount()
Fetch number of fields on this feature.
Definition: ogrfeaturedefn.cpp:264
virtual OGRFieldDefn * GetFieldDefn(int i)
Fetch field definition.
Definition: ogrfeaturedefn.cpp:311
This class represents a style table.
Definition: ogr_featurestyle.h:81
virtual int IsStyleIgnored()
Determine whether the style can be omitted when fetching features.
Definition: ogr_feature.h:248
Simple feature geometry classes.
void SetJustify(OGRJustification eJustifyIn)
Set the justification for this field.
Definition: ogr_feature.h:96
int IsNullable() const
Return whether this geometry field can receive null values.
Definition: ogr_feature.h:170
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition: ogr_feature.h:283
GIntBig GetFID()
Get feature identifier.
Definition: ogr_feature.h:402
virtual int GetFieldIndex(const char *)
Find field by name.
Definition: ogrfeaturedefn.cpp:1117
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:114
void SetNullable(int bNullableIn)
Set whether this field can receive null values.
Definition: ogr_feature.h:117