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); }
85 void SetPrecision(
int nPrecisionIn )
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); }
209 int GetFieldIndex(
const char * pszName)
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; }