OGR
ogrlayerdecorator.h
1 /******************************************************************************
2  * $Id: ogrlayerdecorator.h 24633 2012-07-01 14:37:25Z rouault $
3  *
4  * Project: OpenGIS Simple Features Reference Implementation
5  * Purpose: Defines OGRLayerDecorator class
6  * Author: Even Rouault, even dot rouault at mines dash paris dot org
7  *
8  ******************************************************************************
9  * Copyright (c) 2012, Even Rouault <even dot rouault at mines dash paris dot org>
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a
12  * copy of this software and associated documentation files (the "Software"),
13  * to deal in the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15  * and/or sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included
19  * in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  ****************************************************************************/
29 
30 #ifndef _OGRLAYERDECORATOR_H_INCLUDED
31 #define _OGRLAYERDECORATOR_H_INCLUDED
32 
33 #include "ogrsf_frmts.h"
34 
36 {
37  protected:
38  OGRLayer *m_poDecoratedLayer;
39  int m_bHasOwnership;
40 
41  public:
42 
43  OGRLayerDecorator(OGRLayer* poDecoratedLayer,
44  int bTakeOwnership);
45  virtual ~OGRLayerDecorator();
46 
47  virtual OGRGeometry *GetSpatialFilter();
48  virtual void SetSpatialFilter( OGRGeometry * );
49  virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
50  double dfMaxX, double dfMaxY );
51 
52  virtual OGRErr SetAttributeFilter( const char * );
53 
54  virtual void ResetReading();
55  virtual OGRFeature *GetNextFeature();
56  virtual OGRErr SetNextByIndex( long nIndex );
57  virtual OGRFeature *GetFeature( long nFID );
58  virtual OGRErr SetFeature( OGRFeature *poFeature );
59  virtual OGRErr CreateFeature( OGRFeature *poFeature );
60  virtual OGRErr DeleteFeature( long nFID );
61 
62  virtual const char *GetName();
64  virtual OGRFeatureDefn *GetLayerDefn();
65 
67 
68  virtual int GetFeatureCount( int bForce = TRUE );
69  virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE);
70 
71  virtual int TestCapability( const char * );
72 
73  /* Deprecated (and un-implemented method) --> we won't decorate it ! */
74  /* virtual const char *GetInfo( const char * ); */
75 
76  virtual OGRErr CreateField( OGRFieldDefn *poField,
77  int bApproxOK = TRUE );
78  virtual OGRErr DeleteField( int iField );
79  virtual OGRErr ReorderFields( int* panMap );
80  virtual OGRErr AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn, int nFlags );
81 
82  virtual OGRErr SyncToDisk();
83 
84  virtual OGRStyleTable *GetStyleTable();
85  virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
86 
87  virtual void SetStyleTable(OGRStyleTable *poStyleTable);
88 
89  virtual OGRErr StartTransaction();
90  virtual OGRErr CommitTransaction();
91  virtual OGRErr RollbackTransaction();
92 
93  virtual const char *GetFIDColumn();
94  virtual const char *GetGeometryColumn();
95 
96  virtual OGRErr SetIgnoredFields( const char **papszFields );
97 };
98 
99 #endif // _OGRLAYERDECORATOR_H_INCLUDED
virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
Set a new rectangular spatial filter.
Definition: ogrlayerdecorator.cpp:59
virtual void ResetReading()
Reset feature reading to start on the first feature.
Definition: ogrlayerdecorator.cpp:70
virtual OGRErr CreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition: ogrlayerdecorator.cpp:95
virtual int TestCapability(const char *)
Test if this layer supported the named capability.
Definition: ogrlayerdecorator.cpp:135
virtual OGRSpatialReference * GetSpatialRef()
Fetch the spatial reference system for this layer.
Definition: ogrlayerdecorator.cpp:120
virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce=TRUE)
Fetch the extent of this layer.
Definition: ogrlayerdecorator.cpp:130
virtual OGRErr CreateField(OGRFieldDefn *poField, int bApproxOK=TRUE)
Create a new field on a layer.
Definition: ogrlayerdecorator.cpp:140
Definition: ogrlayerdecorator.h:35
virtual OGRFeature * GetFeature(long nFID)
Fetch a feature by its identifier.
Definition: ogrlayerdecorator.cpp:85
Definition: ogr_feature.h:120
virtual OGRErr SetFeature(OGRFeature *poFeature)
Rewrite an existing feature.
Definition: ogrlayerdecorator.cpp:90
Definition: ogr_feature.h:51
virtual OGRErr DeleteField(int iField)
Delete an existing field on a layer.
Definition: ogrlayerdecorator.cpp:146
virtual OGRFeatureDefn * GetLayerDefn()
Fetch the schema information for this layer.
Definition: ogrlayerdecorator.cpp:115
OGRwkbGeometryType
Definition: ogr_core.h:297
virtual OGRErr DeleteFeature(long nFID)
Delete feature from layer.
Definition: ogrlayerdecorator.cpp:100
virtual OGRStyleTable * GetStyleTable()
Returns layer style table.
Definition: ogrlayerdecorator.cpp:166
virtual OGRErr SetNextByIndex(long nIndex)
Move read cursor to the nIndex'th feature in the current resultset.
Definition: ogrlayerdecorator.cpp:80
Definition: ogr_geometry.h:77
virtual OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn, int nFlags)
Alter the definition of an existing field on a layer.
Definition: ogrlayerdecorator.cpp:156
virtual void SetStyleTable(OGRStyleTable *poStyleTable)
Set layer style table.
Definition: ogrlayerdecorator.cpp:176
virtual const char * GetGeometryColumn()
This method returns the name of the underlying database column being used as the geometry column...
Definition: ogrlayerdecorator.cpp:201
virtual OGRErr ReorderFields(int *panMap)
Reorder all the fields of a layer.
Definition: ogrlayerdecorator.cpp:151
Definition: ogr_spatialref.h:128
virtual OGRFeature * GetNextFeature()
Fetch the next available feature from this layer.
Definition: ogrlayerdecorator.cpp:75
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable)
Set layer style table.
Definition: ogrlayerdecorator.cpp:171
Definition: ogr_core.h:47
Definition: ogrsf_frmts.h:58
Definition: ogr_feature.h:178
Definition: ogr_featurestyle.h:81
virtual OGRwkbGeometryType GetGeomType()
Return the layer geometry type.
Definition: ogrlayerdecorator.cpp:110
virtual OGRErr SetAttributeFilter(const char *)
Set a new attribute query.
Definition: ogrlayerdecorator.cpp:65
virtual int GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition: ogrlayerdecorator.cpp:125
virtual OGRGeometry * GetSpatialFilter()
This method returns the current spatial filter for this layer.
Definition: ogrlayerdecorator.cpp:49
virtual OGRErr SyncToDisk()
Flush pending changes to disk.
Definition: ogrlayerdecorator.cpp:161
virtual const char * GetFIDColumn()
This method returns the name of the underlying database column being used as the FID column...
Definition: ogrlayerdecorator.cpp:196
virtual void SetSpatialFilter(OGRGeometry *)
Set a new spatial filter.
Definition: ogrlayerdecorator.cpp:54
virtual const char * GetName()
Return the layer name.
Definition: ogrlayerdecorator.cpp:105
virtual OGRErr SetIgnoredFields(const char **papszFields)
Set which fields can be omitted when retrieving features from the layer.
Definition: ogrlayerdecorator.cpp:206

Generated for GDAL by doxygen 1.8.7.