30 #ifndef _OGR_FEATURE_H_INCLUDED
31 #define _OGR_FEATURE_H_INCLUDED
35 #include "cpl_atomic_ops.h"
70 void SetName(
const char * );
79 { eJustify = eJustifyIn; }
82 void SetWidth(
int nWidthIn ) { nWidth = MAX(0,nWidthIn); }
86 { nPrecision = nPrecisionIn; }
92 const OGRField *GetDefaultRef() {
return &uDefault; }
95 void SetIgnored(
int bIgnore ) { this->bIgnore = bIgnore; }
123 volatile int nRefCount;
130 char *pszFeatureClassName;
139 const char *
GetName() {
return pszFeatureClassName; }
143 int GetFieldIndex(
const char * );
146 OGRErr DeleteFieldDefn(
int iField );
147 OGRErr ReorderFieldDefns(
int* panMap );
166 static OGRFeatureDefn *CreateFeatureDefn(
const char *pszName = NULL );
188 char * m_pszStyleString;
190 char * m_pszTmpFieldValue;
204 virtual OGRBoolean Equal(
OGRFeature * poFeature );
208 {
return poDefn->GetFieldDefn(iField); }
210 {
return poDefn->GetFieldIndex(pszName);}
212 int IsFieldSet(
int iField )
const;
214 void UnsetField(
int iField );
218 int GetFieldAsInteger(
int i );
219 double GetFieldAsDouble(
int i );
220 const char *GetFieldAsString(
int i );
221 const int *GetFieldAsIntegerList(
int i,
int *pnCount );
222 const double *GetFieldAsDoubleList(
int i,
int *pnCount );
223 char **GetFieldAsStringList(
int i )
const;
224 GByte *GetFieldAsBinary(
int i,
int *pnCount );
225 int GetFieldAsDateTime(
int i,
226 int *pnYear,
int *pnMonth,
int *pnDay,
227 int *pnHour,
int *pnMinute,
int *pnSecond,
230 int GetFieldAsInteger(
const char *pszFName )
231 {
return GetFieldAsInteger( GetFieldIndex(pszFName) ); }
232 double GetFieldAsDouble(
const char *pszFName )
233 {
return GetFieldAsDouble( GetFieldIndex(pszFName) ); }
234 const char *GetFieldAsString(
const char *pszFName )
235 {
return GetFieldAsString( GetFieldIndex(pszFName) ); }
236 const int *GetFieldAsIntegerList(
const char *pszFName,
238 {
return GetFieldAsIntegerList( GetFieldIndex(pszFName),
240 const double *GetFieldAsDoubleList(
const char *pszFName,
242 {
return GetFieldAsDoubleList( GetFieldIndex(pszFName),
244 char **GetFieldAsStringList(
const char *pszFName )
245 {
return GetFieldAsStringList(GetFieldIndex(pszFName)); }
247 void SetField(
int i,
int nValue );
248 void SetField(
int i,
double dfValue );
249 void SetField(
int i,
const char * pszValue );
250 void SetField(
int i,
int nCount,
int * panValues );
251 void SetField(
int i,
int nCount,
double * padfValues );
252 void SetField(
int i,
char ** papszValues );
253 void SetField(
int i,
OGRField * puValue );
254 void SetField(
int i,
int nCount, GByte * pabyBinary );
255 void SetField(
int i,
int nYear,
int nMonth,
int nDay,
256 int nHour=0,
int nMinute=0,
int nSecond=0,
259 void SetField(
const char *pszFName,
int nValue )
260 { SetField( GetFieldIndex(pszFName), nValue ); }
261 void SetField(
const char *pszFName,
double dfValue )
262 { SetField( GetFieldIndex(pszFName), dfValue ); }
263 void SetField(
const char *pszFName,
const char * pszValue)
264 { SetField( GetFieldIndex(pszFName), pszValue ); }
265 void SetField(
const char *pszFName,
int nCount,
267 { SetField(GetFieldIndex(pszFName),nCount,panValues);}
268 void SetField(
const char *pszFName,
int nCount,
269 double * padfValues )
270 {SetField(GetFieldIndex(pszFName),nCount,padfValues);}
271 void SetField(
const char *pszFName,
char ** papszValues )
272 { SetField( GetFieldIndex(pszFName), papszValues); }
273 void SetField(
const char *pszFName,
OGRField * puValue )
274 { SetField( GetFieldIndex(pszFName), puValue ); }
275 void SetField(
const char *pszFName,
276 int nYear,
int nMonth,
int nDay,
277 int nHour=0,
int nMinute=0,
int nSecond=0,
279 { SetField( GetFieldIndex(pszFName),
281 nHour, nMinute, nSecond, nTZFlag ); }
284 virtual OGRErr SetFID(
long nFID );
286 void DumpReadable( FILE *,
char** papszOptions = NULL );
289 OGRErr SetFrom(
OGRFeature *,
int *,
int = TRUE );
290 OGRErr SetFieldsFrom(
OGRFeature *,
int *,
int = TRUE );
293 int *panRemapSource );
295 virtual const char *GetStyleString();
296 virtual void SetStyleString(
const char * );
297 virtual void SetStyleStringDirectly(
char * );
298 virtual OGRStyleTable *GetStyleTable() {
return m_poStyleTable; }
300 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable)
301 {
if ( m_poStyleTable )
delete m_poStyleTable;
302 m_poStyleTable = poStyleTable; }
321 char **FieldCollector(
void *,
char ** );
334 long *EvaluateAgainstIndices(
OGRLayer *, OGRErr * );
338 char **GetUsedFields();
340 void *GetSWGExpr() {
return pSWQExpr; }
int GetReferenceCount()
Fetch current reference count.
Definition: ogr_feature.h:156
OGRField * GetRawFieldRef(int i)
Fetch a pointer to the internal field value given the index.
Definition: ogr_feature.h:216
int GetPrecision()
Get the formatting precision for this field. This should normally be zero for fields of types other t...
Definition: ogr_feature.h:84
long GetFID()
Get feature identifier.
Definition: ogr_feature.h:283
void SetStyleIgnored(int bIgnore)
Set whether the style can be omitted when fetching features.
Definition: ogr_feature.h:162
void SetGeometryIgnored(int bIgnore)
Set whether the geometry can be omitted when fetching features.
Definition: ogr_feature.h:160
int GetWidth()
Get the formatting width for this field.
Definition: ogr_feature.h:81
int GetFieldIndex(const char *pszName)
Fetch the field index given field name.
Definition: ogr_feature.h:209
Definition: ogr_feature.h:120
void SetType(OGRFieldType eTypeIn)
Set the type of this field. This should never be done to an OGRFieldDefn that is already part of an O...
Definition: ogr_feature.h:74
Definition: ogr_feature.h:51
OGRFieldType GetType()
Fetch type of this field.
Definition: ogr_feature.h:73
const char * GetNameRef()
Fetch name of this field.
Definition: ogr_feature.h:71
OGRwkbGeometryType
Definition: ogr_core.h:297
const char * GetName()
Get name of this OGRFeatureDefn.
Definition: ogr_feature.h:139
OGRFieldDefn * GetFieldDefnRef(int iField)
Fetch definition for this field.
Definition: ogr_feature.h:207
void SetPrecision(int nPrecisionIn)
Set the formatting precision for this field in characters.
Definition: ogr_feature.h:85
Definition: ogr_geometry.h:77
Definition: ogr_feature.h:315
void SetWidth(int nWidthIn)
Set the formatting width for this field in characters.
Definition: ogr_feature.h:82
OGRJustification
Definition: ogr_core.h:385
OGRJustification GetJustify()
Get the justification for this field.
Definition: ogr_feature.h:77
int Reference()
Increments the reference count by one.
Definition: ogr_feature.h:154
OGRFieldType
Definition: ogr_core.h:364
int IsIgnored()
Return whether this field should be omitted when fetching features.
Definition: ogr_feature.h:94
int GetFieldCount()
Fetch number of fields on this feature. This will always be the same as the field count for the OGRFe...
Definition: ogr_feature.h:206
int IsGeometryIgnored()
Determine whether the geometry can be omitted when fetching features.
Definition: ogr_feature.h:159
void SetIgnored(int bIgnore)
Set whether this field should be omitted when fetching features.
Definition: ogr_feature.h:95
OGRwkbGeometryType GetGeomType()
Fetch the geometry base type.
Definition: ogr_feature.h:149
int Dereference()
Decrements the reference count by one.
Definition: ogr_feature.h:155
Definition: ogr_core.h:403
Definition: ogrsf_frmts.h:58
OGRGeometry * GetGeometryRef()
Fetch pointer to feature geometry.
Definition: ogr_feature.h:200
Definition: ogr_feature.h:178
int GetFieldCount()
Fetch number of fields on this feature.
Definition: ogr_feature.h:141
Definition: ogr_featurestyle.h:81
int IsStyleIgnored()
Determine whether the style can be omitted when fetching features.
Definition: ogr_feature.h:161
void SetJustify(OGRJustification eJustifyIn)
Set the justification for this field.
Definition: ogr_feature.h:78
OGRFeatureDefn * GetDefnRef()
Fetch feature definition.
Definition: ogr_feature.h:196