OGR
ogrwarpedlayer.h
1 /******************************************************************************
2  * $Id: ogrwarpedlayer.h 27044 2014-03-16 23:41:27Z rouault $
3  *
4  * Project: OpenGIS Simple Features Reference Implementation
5  * Purpose: Defines OGRWarpedLayer class
6  * Author: Even Rouault, even dot rouault at mines dash paris dot org
7  *
8  ******************************************************************************
9  * Copyright (c) 2012-2014, Even Rouault <even dot rouault at mines-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 _OGRWARPEDLAYER_H_INCLUDED
31 #define _OGRWARPEDLAYER_H_INCLUDED
32 
33 #include "ogrlayerdecorator.h"
34 
35 /************************************************************************/
36 /* OGRWarpedLayer */
37 /************************************************************************/
38 
40 {
41  protected:
42  OGRFeatureDefn *m_poFeatureDefn;
43  int m_iGeomField;
44 
46  OGRCoordinateTransformation *m_poReversedCT; /* may be NULL */
47  OGRSpatialReference *m_poSRS;
48 
49  OGREnvelope sStaticEnvelope;
50 
51  static int ReprojectEnvelope( OGREnvelope* psEnvelope,
53 
54  OGRFeature * SrcFeatureToWarpedFeature(OGRFeature* poFeature);
55  OGRFeature * WarpedFeatureToSrcFeature(OGRFeature* poFeature);
56 
57  public:
58 
59  OGRWarpedLayer(OGRLayer* poDecoratedLayer,
60  int iGeomField,
61  int bTakeOwnership,
62  OGRCoordinateTransformation* poCT, /* must NOT be NULL, ownership acquired by OGRWarpedLayer */
63  OGRCoordinateTransformation* poReversedCT /* may be NULL, ownership acquired by OGRWarpedLayer */);
64  virtual ~OGRWarpedLayer();
65 
66  void SetExtent(double dfXMin, double dfYMin, double dfXMax, double dfYMax);
67 
68  virtual void SetSpatialFilter( OGRGeometry * );
69  virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
70  double dfMaxX, double dfMaxY );
71  virtual void SetSpatialFilter( int iGeomField, OGRGeometry * );
72  virtual void SetSpatialFilterRect( int iGeomField, double dfMinX, double dfMinY,
73  double dfMaxX, double dfMaxY );
74 
75  virtual OGRFeature *GetNextFeature();
76  virtual OGRFeature *GetFeature( long nFID );
77  virtual OGRErr SetFeature( OGRFeature *poFeature );
78  virtual OGRErr CreateFeature( OGRFeature *poFeature );
79 
80  virtual OGRFeatureDefn *GetLayerDefn();
81 
83 
84  virtual int GetFeatureCount( int bForce = TRUE );
85  virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce = TRUE);
86  virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE);
87 
88  virtual int TestCapability( const char * );
89 };
90 
91 #endif // _OGRWARPEDLAYER_H_INCLUDED
virtual OGRFeatureDefn * GetLayerDefn()
Fetch the schema information for this layer.
Definition: ogrwarpedlayer.cpp:302
virtual int GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition: ogrwarpedlayer.cpp:331
Definition: ogrwarpedlayer.h:39
Definition: ogrlayerdecorator.h:35
Definition: ogr_feature.h:167
virtual void SetSpatialFilter(OGRGeometry *)
Set a new spatial filter.
Definition: ogrwarpedlayer.cpp:80
Definition: ogr_geometry.h:79
virtual OGRFeature * GetFeature(long nFID)
Fetch a feature by its identifier.
Definition: ogrwarpedlayer.cpp:247
virtual OGRErr CreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition: ogrwarpedlayer.cpp:282
Definition: ogr_spatialref.h:129
virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
Set a new rectangular spatial filter.
Definition: ogrwarpedlayer.cpp:89
virtual OGRFeature * GetNextFeature()
Fetch the next available feature from this layer.
Definition: ogrwarpedlayer.cpp:221
Definition: ogr_core.h:48
Definition: ogrsf_frmts.h:59
virtual OGRErr SetFeature(OGRFeature *poFeature)
Rewrite an existing feature.
Definition: ogrwarpedlayer.cpp:263
Definition: ogr_spatialref.h:569
Definition: ogr_feature.h:232
virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce=TRUE)
Fetch the extent of this layer, on the specified geometry field.
Definition: ogrwarpedlayer.cpp:352
virtual OGRSpatialReference * GetSpatialRef()
Fetch the spatial reference system for this layer.
Definition: ogrwarpedlayer.cpp:319
virtual int TestCapability(const char *)
Test if this layer supported the named capability.
Definition: ogrwarpedlayer.cpp:536

Generated for GDAL by doxygen 1.8.11.