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;
161 void SetName(
const char * );
209 volatile int nRefCount;
217 char *pszFeatureClassName;
225 virtual const char *GetName();
227 virtual int GetFieldCount();
229 virtual int GetFieldIndex(
const char * );
232 virtual OGRErr DeleteFieldDefn(
int iField );
233 virtual OGRErr ReorderFieldDefns(
int* panMap );
235 virtual int GetGeomFieldCount();
237 virtual int GetGeomFieldIndex(
const char * );
240 virtual OGRErr DeleteGeomFieldDefn(
int iGeomField );
252 virtual int IsGeometryIgnored();
253 virtual void SetGeometryIgnored(
int bIgnore );
259 static OGRFeatureDefn *CreateFeatureDefn(
const char *pszName = NULL );
282 char *m_pszNativeData;
283 char *m_pszNativeMediaType;
285 bool SetFieldInternal(
int i,
OGRField * puValue );
288 char * m_pszStyleString;
290 char * m_pszTmpFieldValue;
301 OGRGeometry *StealGeometry() CPL_WARN_UNUSED_RESULT;
312 OGRGeometry* GetGeomFieldRef(
const char* pszFName);
313 OGRErr SetGeomFieldDirectly(
int iField,
OGRGeometry * );
317 virtual OGRBoolean Equal(
OGRFeature * poFeature );
325 int IsFieldSet(
int iField );
327 void UnsetField(
int iField );
331 int GetFieldAsInteger(
int i );
332 GIntBig GetFieldAsInteger64(
int i );
333 double GetFieldAsDouble(
int i );
334 const char *GetFieldAsString(
int i );
335 const int *GetFieldAsIntegerList(
int i,
int *pnCount );
336 const GIntBig *GetFieldAsInteger64List(
int i,
int *pnCount );
337 const double *GetFieldAsDoubleList(
int i,
int *pnCount );
338 char **GetFieldAsStringList(
int i );
339 GByte *GetFieldAsBinary(
int i,
int *pnCount );
340 int GetFieldAsDateTime(
int i,
341 int *pnYear,
int *pnMonth,
int *pnDay,
342 int *pnHour,
int *pnMinute,
int *pnSecond,
344 int GetFieldAsDateTime(
int i,
345 int *pnYear,
int *pnMonth,
int *pnDay,
346 int *pnHour,
int *pnMinute,
float *pfSecond,
349 int GetFieldAsInteger(
const char *pszFName )
350 {
return GetFieldAsInteger( GetFieldIndex(pszFName) ); }
351 GIntBig GetFieldAsInteger64(
const char *pszFName )
352 {
return GetFieldAsInteger64( GetFieldIndex(pszFName) ); }
353 double GetFieldAsDouble(
const char *pszFName )
354 {
return GetFieldAsDouble( GetFieldIndex(pszFName) ); }
355 const char *GetFieldAsString(
const char *pszFName )
356 {
return GetFieldAsString( GetFieldIndex(pszFName) ); }
357 const int *GetFieldAsIntegerList(
const char *pszFName,
359 {
return GetFieldAsIntegerList( GetFieldIndex(pszFName),
361 const GIntBig *GetFieldAsInteger64List(
const char *pszFName,
363 {
return GetFieldAsInteger64List( GetFieldIndex(pszFName),
365 const double *GetFieldAsDoubleList(
const char *pszFName,
367 {
return GetFieldAsDoubleList( GetFieldIndex(pszFName),
369 char **GetFieldAsStringList(
const char *pszFName )
370 {
return GetFieldAsStringList(GetFieldIndex(pszFName)); }
372 void SetField(
int i,
int nValue );
373 void SetField(
int i, GIntBig nValue );
374 void SetField(
int i,
double dfValue );
375 void SetField(
int i,
const char * pszValue );
376 void SetField(
int i,
int nCount,
int * panValues );
377 void SetField(
int i,
int nCount,
const GIntBig * panValues );
378 void SetField(
int i,
int nCount,
double * padfValues );
379 void SetField(
int i,
char ** papszValues );
380 void SetField(
int i,
OGRField * puValue );
381 void SetField(
int i,
int nCount, GByte * pabyBinary );
382 void SetField(
int i,
int nYear,
int nMonth,
int nDay,
383 int nHour=0,
int nMinute=0,
float fSecond=0.f,
386 void SetField(
const char *pszFName,
int nValue )
387 { SetField( GetFieldIndex(pszFName), nValue ); }
388 void SetField(
const char *pszFName, GIntBig nValue )
389 { SetField( GetFieldIndex(pszFName), nValue ); }
390 void SetField(
const char *pszFName,
double dfValue )
391 { SetField( GetFieldIndex(pszFName), dfValue ); }
392 void SetField(
const char *pszFName,
const char * pszValue)
393 { SetField( GetFieldIndex(pszFName), pszValue ); }
394 void SetField(
const char *pszFName,
int nCount,
396 { SetField(GetFieldIndex(pszFName),nCount,panValues);}
397 void SetField(
const char *pszFName,
int nCount,
398 const GIntBig * panValues )
399 { SetField(GetFieldIndex(pszFName),nCount,panValues);}
400 void SetField(
const char *pszFName,
int nCount,
401 double * padfValues )
402 {SetField(GetFieldIndex(pszFName),nCount,padfValues);}
403 void SetField(
const char *pszFName,
char ** papszValues )
404 { SetField( GetFieldIndex(pszFName), papszValues); }
405 void SetField(
const char *pszFName,
OGRField * puValue )
406 { SetField( GetFieldIndex(pszFName), puValue ); }
407 void SetField(
const char *pszFName,
408 int nYear,
int nMonth,
int nDay,
409 int nHour=0,
int nMinute=0,
float fSecond=0.f,
411 { SetField( GetFieldIndex(pszFName),
413 nHour, nMinute, fSecond, nTZFlag ); }
416 virtual OGRErr SetFID( GIntBig nFIDIn );
418 void DumpReadable( FILE *,
char** papszOptions = NULL );
421 OGRErr SetFrom(
OGRFeature *,
int *,
int = TRUE );
422 OGRErr SetFieldsFrom(
OGRFeature *,
int *,
int = TRUE );
425 int *panRemapSource );
427 int *panRemapSource );
429 int Validate(
int nValidateFlags,
431 void FillUnsetWithDefault(
int bNotNullableOnly,
432 char** papszOptions );
434 virtual const char *GetStyleString();
435 virtual void SetStyleString(
const char * );
436 virtual void SetStyleStringDirectly(
char * );
437 virtual OGRStyleTable *GetStyleTable() {
return m_poStyleTable; }
439 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable);
443 void SetNativeData(
const char* pszNativeData );
444 void SetNativeMediaType(
const char* pszNativeMediaType );
467 char **FieldCollector(
void *,
char ** );
481 GIntBig *EvaluateAgainstIndices(
OGRLayer *, OGRErr * );
485 char **GetUsedFields();
487 void *GetSWQExpr() {
return pSWQExpr; }
int IsIgnored()
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:170
int GetReferenceCount()
Fetch current reference count.
Definition: ogr_feature.h:249
OGRFieldSubType
List of field subtypes.
Definition: ogr_core.h:628
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:329
const char * GetNameRef()
Fetch name of this field.
Definition: ogr_feature.h:162
void SetNullable(int bNullableIn)
Set whether this geometry field can receive null values.
Definition: ogr_feature.h:174
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:143
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:575
virtual void SetStyleIgnored(int bIgnore)
Set whether the style can be omitted when fetching features.
Definition: ogr_feature.h:255
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:322
Definition of a feature class or feature layer.
Definition: ogr_feature.h:206
virtual int GetGeomFieldIndex(const char *)
Find geometry field by name.
Definition: ogrfeaturedefn.cpp:829
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:333
const char * GetNativeMediaType() const
Returns the native media type for the feature.
Definition: ogr_feature.h:442
OGRwkbGeometryType GetType()
Fetch geometry type of this field.
Definition: ogr_feature.h:164
virtual OGRGeomFieldDefn * GetGeomFieldDefn(int i)
Fetch geometry field definition.
Definition: ogrfeaturedefn.cpp:623
OGRFieldDefn * GetFieldDefnRef(int iField)
Fetch definition for this field.
Definition: ogr_feature.h:320
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:461
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:644
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:247
OGRFieldType
List of feature field types.
Definition: ogr_core.h:600
This class represents an 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:307
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:319
int Dereference()
Decrements the reference count by one.
Definition: ogr_feature.h:248
int GetGeomFieldCount()
Fetch number of geometry fields on this feature.
Definition: ogr_feature.h:303
OGRFeature field attribute value union.
Definition: ogr_core.h:662
void SetIgnored(int bIgnoreIn)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:171
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:305
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:274
virtual int GetFieldCount()
Fetch number of fields on this feature.
Definition: ogrfeaturedefn.cpp:265
virtual OGRFieldDefn * GetFieldDefn(int i)
Fetch field definition.
Definition: ogrfeaturedefn.cpp:312
This class represents a style table.
Definition: ogr_featurestyle.h:82
virtual int IsStyleIgnored()
Determine whether the style can be omitted when fetching features.
Definition: ogr_feature.h:254
const char * GetNativeData() const
Returns the native data for the feature.
Definition: ogr_feature.h:441
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:173
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition: ogr_feature.h:296
GIntBig GetFID()
Get feature identifier.
Definition: ogr_feature.h:415
virtual int GetFieldIndex(const char *)
Find field by name.
Definition: ogrfeaturedefn.cpp:1127
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