|
GDAL
|
00001 /****************************************************************************** 00002 * $Id: ogrwarpedlayer.h 36501 2016-11-25 14:09:24Z rouault $ 00003 * 00004 * Project: OpenGIS Simple Features Reference Implementation 00005 * Purpose: Defines OGRWarpedLayer class 00006 * Author: Even Rouault, even dot rouault at mines dash paris dot org 00007 * 00008 ****************************************************************************** 00009 * Copyright (c) 2012-2014, Even Rouault <even dot rouault at mines-paris dot org> 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining a 00012 * copy of this software and associated documentation files (the "Software"), 00013 * to deal in the Software without restriction, including without limitation 00014 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00015 * and/or sell copies of the Software, and to permit persons to whom the 00016 * Software is furnished to do so, subject to the following conditions: 00017 * 00018 * The above copyright notice and this permission notice shall be included 00019 * in all copies or substantial portions of the Software. 00020 * 00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00022 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00024 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00026 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00027 * DEALINGS IN THE SOFTWARE. 00028 ****************************************************************************/ 00029 00030 #ifndef OGRWARPEDLAYER_H_INCLUDED 00031 #define OGRWARPEDLAYER_H_INCLUDED 00032 00033 #ifndef DOXYGEN_SKIP 00034 00035 #include "ogrlayerdecorator.h" 00036 00037 /************************************************************************/ 00038 /* OGRWarpedLayer */ 00039 /************************************************************************/ 00040 00041 class OGRWarpedLayer : public OGRLayerDecorator 00042 { 00043 protected: 00044 OGRFeatureDefn *m_poFeatureDefn; 00045 int m_iGeomField; 00046 00047 OGRCoordinateTransformation *m_poCT; 00048 OGRCoordinateTransformation *m_poReversedCT; /* may be NULL */ 00049 OGRSpatialReference *m_poSRS; 00050 00051 OGREnvelope sStaticEnvelope; 00052 00053 static int ReprojectEnvelope( OGREnvelope* psEnvelope, 00054 OGRCoordinateTransformation* poCT ); 00055 00056 OGRFeature * SrcFeatureToWarpedFeature(OGRFeature* poFeature); 00057 OGRFeature * WarpedFeatureToSrcFeature(OGRFeature* poFeature); 00058 00059 public: 00060 00061 OGRWarpedLayer(OGRLayer* poDecoratedLayer, 00062 int iGeomField, 00063 int bTakeOwnership, 00064 OGRCoordinateTransformation* poCT, /* must NOT be NULL, ownership acquired by OGRWarpedLayer */ 00065 OGRCoordinateTransformation* poReversedCT /* may be NULL, ownership acquired by OGRWarpedLayer */); 00066 virtual ~OGRWarpedLayer(); 00067 00068 void SetExtent(double dfXMin, double dfYMin, double dfXMax, double dfYMax); 00069 00070 virtual void SetSpatialFilter( OGRGeometry * ) override; 00071 virtual void SetSpatialFilterRect( double dfMinX, double dfMinY, 00072 double dfMaxX, double dfMaxY ) override; 00073 virtual void SetSpatialFilter( int iGeomField, OGRGeometry * ) override; 00074 virtual void SetSpatialFilterRect( int iGeomField, double dfMinX, double dfMinY, 00075 double dfMaxX, double dfMaxY ) override; 00076 00077 virtual OGRFeature *GetNextFeature() override; 00078 virtual OGRFeature *GetFeature( GIntBig nFID ) override; 00079 virtual OGRErr ISetFeature( OGRFeature *poFeature ) override; 00080 virtual OGRErr ICreateFeature( OGRFeature *poFeature ) override; 00081 00082 virtual OGRFeatureDefn *GetLayerDefn() override; 00083 00084 virtual OGRSpatialReference *GetSpatialRef() override; 00085 00086 virtual GIntBig GetFeatureCount( int bForce = TRUE ) override; 00087 virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce = TRUE) override; 00088 virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) override; 00089 00090 virtual int TestCapability( const char * ) override; 00091 }; 00092 00093 #endif /* #ifndef DOXYGEN_SKIP */ 00094 00095 #endif // OGRWARPEDLAYER_H_INCLUDED
1.7.6.1.