00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _OGRWARPEDLAYER_H_INCLUDED
00031 #define _OGRWARPEDLAYER_H_INCLUDED
00032
00033 #include "ogrlayerdecorator.h"
00034
00035
00036
00037
00038
00039 class OGRWarpedLayer : public OGRLayerDecorator
00040 {
00041 protected:
00042 OGRFeatureDefn *m_poFeatureDefn;
00043 int m_iGeomField;
00044
00045 OGRCoordinateTransformation *m_poCT;
00046 OGRCoordinateTransformation *m_poReversedCT;
00047 OGRSpatialReference *m_poSRS;
00048
00049 OGREnvelope sStaticEnvelope;
00050
00051 static int ReprojectEnvelope( OGREnvelope* psEnvelope,
00052 OGRCoordinateTransformation* poCT );
00053
00054 OGRFeature * SrcFeatureToWarpedFeature(OGRFeature* poFeature);
00055 OGRFeature * WarpedFeatureToSrcFeature(OGRFeature* poFeature);
00056
00057 public:
00058
00059 OGRWarpedLayer(OGRLayer* poDecoratedLayer,
00060 int iGeomField,
00061 int bTakeOwnership,
00062 OGRCoordinateTransformation* poCT,
00063 OGRCoordinateTransformation* poReversedCT );
00064 virtual ~OGRWarpedLayer();
00065
00066 void SetExtent(double dfXMin, double dfYMin, double dfXMax, double dfYMax);
00067
00068 virtual void SetSpatialFilter( OGRGeometry * );
00069 virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
00070 double dfMaxX, double dfMaxY );
00071 virtual void SetSpatialFilter( int iGeomField, OGRGeometry * );
00072 virtual void SetSpatialFilterRect( int iGeomField, double dfMinX, double dfMinY,
00073 double dfMaxX, double dfMaxY );
00074
00075 virtual OGRFeature *GetNextFeature();
00076 virtual OGRFeature *GetFeature( long nFID );
00077 virtual OGRErr SetFeature( OGRFeature *poFeature );
00078 virtual OGRErr CreateFeature( OGRFeature *poFeature );
00079
00080 virtual OGRFeatureDefn *GetLayerDefn();
00081
00082 virtual OGRSpatialReference *GetSpatialRef();
00083
00084 virtual int GetFeatureCount( int bForce = TRUE );
00085 virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce = TRUE);
00086 virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE);
00087
00088 virtual int TestCapability( const char * );
00089 };
00090
00091 #endif // _OGRWARPEDLAYER_H_INCLUDED