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; }
121 volatile int nRefCount;
128 char *pszFeatureClassName;
137 const char *
GetName() {
return pszFeatureClassName; }
141 int GetFieldIndex(
const char * );
144 OGRErr DeleteFieldDefn(
int iField );
145 OGRErr ReorderFieldDefns(
int* panMap );
162 static OGRFeatureDefn *CreateFeatureDefn(
const char *pszName = NULL );
184 char * m_pszStyleString;
186 char * m_pszTmpFieldValue;
200 virtual OGRBoolean Equal(
OGRFeature * poFeature );
204 {
return poDefn->GetFieldDefn(iField); }
205 int GetFieldIndex(
const char * pszName)
206 {
return poDefn->GetFieldIndex(pszName);}
208 int IsFieldSet(
int iField )
const;
210 void UnsetField(
int iField );
214 int GetFieldAsInteger(
int i );
215 double GetFieldAsDouble(
int i );
216 const char *GetFieldAsString(
int i );
217 const int *GetFieldAsIntegerList(
int i,
int *pnCount );
218 const double *GetFieldAsDoubleList(
int i,
int *pnCount );
219 char **GetFieldAsStringList(
int i )
const;
220 GByte *GetFieldAsBinary(
int i,
int *pnCount );
221 int GetFieldAsDateTime(
int i,
222 int *pnYear,
int *pnMonth,
int *pnDay,
223 int *pnHour,
int *pnMinute,
int *pnSecond,
226 int GetFieldAsInteger(
const char *pszFName )
227 {
return GetFieldAsInteger( GetFieldIndex(pszFName) ); }
228 double GetFieldAsDouble(
const char *pszFName )
229 {
return GetFieldAsDouble( GetFieldIndex(pszFName) ); }
230 const char *GetFieldAsString(
const char *pszFName )
231 {
return GetFieldAsString( GetFieldIndex(pszFName) ); }
232 const int *GetFieldAsIntegerList(
const char *pszFName,
234 {
return GetFieldAsIntegerList( GetFieldIndex(pszFName),
236 const double *GetFieldAsDoubleList(
const char *pszFName,
238 {
return GetFieldAsDoubleList( GetFieldIndex(pszFName),
240 char **GetFieldAsStringList(
const char *pszFName )
241 {
return GetFieldAsStringList(GetFieldIndex(pszFName)); }
243 void SetField(
int i,
int nValue );
244 void SetField(
int i,
double dfValue );
245 void SetField(
int i,
const char * pszValue );
246 void SetField(
int i,
int nCount,
int * panValues );
247 void SetField(
int i,
int nCount,
double * padfValues );
248 void SetField(
int i,
char ** papszValues );
249 void SetField(
int i,
OGRField * puValue );
250 void SetField(
int i,
int nCount, GByte * pabyBinary );
251 void SetField(
int i,
int nYear,
int nMonth,
int nDay,
252 int nHour=0,
int nMinute=0,
int nSecond=0,
255 void SetField(
const char *pszFName,
int nValue )
256 { SetField( GetFieldIndex(pszFName), nValue ); }
257 void SetField(
const char *pszFName,
double dfValue )
258 { SetField( GetFieldIndex(pszFName), dfValue ); }
259 void SetField(
const char *pszFName,
const char * pszValue)
260 { SetField( GetFieldIndex(pszFName), pszValue ); }
261 void SetField(
const char *pszFName,
int nCount,
263 { SetField(GetFieldIndex(pszFName),nCount,panValues);}
264 void SetField(
const char *pszFName,
int nCount,
265 double * padfValues )
266 {SetField(GetFieldIndex(pszFName),nCount,padfValues);}
267 void SetField(
const char *pszFName,
char ** papszValues )
268 { SetField( GetFieldIndex(pszFName), papszValues); }
269 void SetField(
const char *pszFName,
OGRField * puValue )
270 { SetField( GetFieldIndex(pszFName), puValue ); }
271 void SetField(
const char *pszFName,
272 int nYear,
int nMonth,
int nDay,
273 int nHour=0,
int nMinute=0,
int nSecond=0,
275 { SetField( GetFieldIndex(pszFName),
277 nHour, nMinute, nSecond, nTZFlag ); }
280 virtual OGRErr SetFID(
long nFID );
282 void DumpReadable( FILE *,
char** papszOptions = NULL );
285 OGRErr SetFrom(
OGRFeature *,
int *,
int = TRUE );
288 int *panRemapSource );
290 virtual const char *GetStyleString();
291 virtual void SetStyleString(
const char * );
292 virtual void SetStyleStringDirectly(
char * );
293 virtual OGRStyleTable *GetStyleTable() {
return m_poStyleTable; }
295 virtual void SetStyleTableDirectly(
OGRStyleTable *poStyleTable)
296 {
if ( m_poStyleTable )
delete m_poStyleTable;
297 m_poStyleTable = poStyleTable; }
315 char **FieldCollector(
void *,
char ** );
324 long *EvaluateAgainstIndices(
OGRLayer *, OGRErr * );
326 char **GetUsedFields();
328 void *GetSWGExpr() {
return pSWQExpr; }