OGR
ogrwarpedlayer.h
1 /******************************************************************************
2  * $Id: ogrwarpedlayer.h 36501 2016-11-25 14:09:24Z 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 #ifndef DOXYGEN_SKIP
34 
35 #include "ogrlayerdecorator.h"
36 
37 /************************************************************************/
38 /* OGRWarpedLayer */
39 /************************************************************************/
40 
41 class OGRWarpedLayer : public OGRLayerDecorator
42 {
43  protected:
44  OGRFeatureDefn *m_poFeatureDefn;
45  int m_iGeomField;
46 
48  OGRCoordinateTransformation *m_poReversedCT; /* may be NULL */
49  OGRSpatialReference *m_poSRS;
50 
51  OGREnvelope sStaticEnvelope;
52 
53  static int ReprojectEnvelope( OGREnvelope* psEnvelope,
55 
56  OGRFeature * SrcFeatureToWarpedFeature(OGRFeature* poFeature);
57  OGRFeature * WarpedFeatureToSrcFeature(OGRFeature* poFeature);
58 
59  public:
60 
61  OGRWarpedLayer(OGRLayer* poDecoratedLayer,
62  int iGeomField,
63  int bTakeOwnership,
64  OGRCoordinateTransformation* poCT, /* must NOT be NULL, ownership acquired by OGRWarpedLayer */
65  OGRCoordinateTransformation* poReversedCT /* may be NULL, ownership acquired by OGRWarpedLayer */);
66  virtual ~OGRWarpedLayer();
67 
68  void SetExtent(double dfXMin, double dfYMin, double dfXMax, double dfYMax);
69 
70  virtual void SetSpatialFilter( OGRGeometry * ) override;
71  virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
72  double dfMaxX, double dfMaxY ) override;
73  virtual void SetSpatialFilter( int iGeomField, OGRGeometry * ) override;
74  virtual void SetSpatialFilterRect( int iGeomField, double dfMinX, double dfMinY,
75  double dfMaxX, double dfMaxY ) override;
76 
77  virtual OGRFeature *GetNextFeature() override;
78  virtual OGRFeature *GetFeature( GIntBig nFID ) override;
79  virtual OGRErr ISetFeature( OGRFeature *poFeature ) override;
80  virtual OGRErr ICreateFeature( OGRFeature *poFeature ) override;
81 
82  virtual OGRFeatureDefn *GetLayerDefn() override;
83 
84  virtual OGRSpatialReference *GetSpatialRef() override;
85 
86  virtual GIntBig GetFeatureCount( int bForce = TRUE ) override;
87  virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce = TRUE) override;
88  virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) override;
89 
90  virtual int TestCapability( const char * ) override;
91 };
92 
93 #endif /* #ifndef DOXYGEN_SKIP */
94 
95 #endif // OGRWARPEDLAYER_H_INCLUDED
OLCFastSpatialFilter
#define OLCFastSpatialFilter
Definition: ogr_core.h:725
wkbPointZM
@ wkbPointZM
Definition: ogr_core.h:376
wkbCurvePolygonZM
@ wkbCurvePolygonZM
Definition: ogr_core.h:385
GByte
unsigned char GByte
Definition: cpl_port.h:207
OGRFeature::SetFID
virtual OGRErr SetFID(GIntBig nFIDIn)
Set the feature identifier.
Definition: ogrfeature.cpp:5214
OGRERR_UNSUPPORTED_GEOMETRY_TYPE
#define OGRERR_UNSUPPORTED_GEOMETRY_TYPE
Definition: ogr_core.h:290
OGRFeature::StealGeometry
OGRGeometry * StealGeometry() CPL_WARN_UNUSED_RESULT
Take away ownership of geometry.
Definition: ogrfeature.cpp:485
GInt16
short GInt16
Definition: cpl_port.h:203
wkbMultiCurveZM
@ wkbMultiCurveZM
Definition: ogr_core.h:386
OGRFeature::SetFrom
OGRErr SetFrom(OGRFeature *, int=TRUE)
Set one feature from another.
Definition: ogrfeature.cpp:5511
cpl_error.h
wkbMultiLineStringZM
@ wkbMultiLineStringZM
Definition: ogr_core.h:380
CPLIsUTF8
int CPLIsUTF8(const char *pabyData, int nLen)
Definition: cpl_recode.cpp:251
CPLEscapeString
char * CPLEscapeString(const char *pszString, int nLength, int nScheme)
Definition: cpl_string.cpp:2018
wkbCurvePolygonZ
@ wkbCurvePolygonZ
Definition: ogr_core.h:349
wkbMultiSurfaceZM
@ wkbMultiSurfaceZM
Definition: ogr_core.h:387
wkbCompoundCurveZM
@ wkbCompoundCurveZM
Definition: ogr_core.h:384
wkbMultiSurfaceM
@ wkbMultiSurfaceM
Definition: ogr_core.h:369
CPLCalloc
void * CPLCalloc(size_t, size_t)
Definition: cpl_conv.cpp:128
wkbMultiPoint25D
@ wkbMultiPoint25D
Definition: ogr_core.h:397
OGRLayer::GetSpatialRef
virtual OGRSpatialReference * GetSpatialRef()
Fetch the spatial reference system for this layer.
Definition: ogrlayer.cpp:1032
wkbNDR
@ wkbNDR
Definition: ogr_core.h:482
cpl_vsi.h
OGRSpatialReference
Definition: ogr_spatialref.h:132
wkbCompoundCurve
@ wkbCompoundCurve
Definition: ogr_core.h:330
OGRLayer::GetFeatureCount
virtual GIntBig GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition: ogrlayer.cpp:166
CPLsnprintf
int CPLsnprintf(char *str, size_t size, const char *fmt,...)
Definition: cpl_string.cpp:1333
wkbPolygon25D
@ wkbPolygon25D
Definition: ogr_core.h:396
wkbPolygonZM
@ wkbPolygonZM
Definition: ogr_core.h:378
wkbVariantPostGIS1
@ wkbVariantPostGIS1
Definition: ogr_core.h:422
OGRCoordinateTransformation::TransformEx
virtual int TransformEx(int nCount, double *x, double *y, double *z=NULL, int *pabSuccess=NULL)=0
OLCSequentialWrite
#define OLCSequentialWrite
Definition: ogr_core.h:723
wkbPolygonM
@ wkbPolygonM
Definition: ogr_core.h:360
OGRGeometry
Definition: ogr_geometry.h:118
wkbCircularString
@ wkbCircularString
Definition: ogr_core.h:328
OGRLayer
Definition: ogrsf_frmts.h:68
wkbMultiPolygonZM
@ wkbMultiPolygonZM
Definition: ogr_core.h:381
ogr_geometry.h
CPLRealloc
void * CPLRealloc(void *, size_t)
Definition: cpl_conv.cpp:215
OLCFastFeatureCount
#define OLCFastFeatureCount
Definition: ogr_core.h:726
wkbPoint25D
@ wkbPoint25D
Definition: ogr_core.h:394
wkbCircularStringZM
@ wkbCircularStringZM
Definition: ogr_core.h:383
EQUAL
#define EQUAL(a, b)
Definition: cpl_port.h:622
wkbCircularStringZ
@ wkbCircularStringZ
Definition: ogr_core.h:347
OGRBoolean
int OGRBoolean
Definition: ogr_core.h:301
wkbMultiPointZM
@ wkbMultiPointZM
Definition: ogr_core.h:379
OGRRawPoint::x
double x
Definition: ogr_geometry.h:57
CPLES_XML
#define CPLES_XML
Definition: cpl_string.h:200
wkbLineStringZM
@ wkbLineStringZM
Definition: ogr_core.h:377
CPLAssert
#define CPLAssert(expr)
Definition: cpl_error.h:182
OGRRawPoint
Definition: ogr_geometry.h:47
CPLTestBool
bool CPLTestBool(const char *pszValue)
Definition: cpl_string.cpp:1522
OGRwkbByteOrder
OGRwkbByteOrder
Definition: ogr_core.h:479
OGRField
Definition: ogr_core.h:661
CSLCount
int CSLCount(const char *const *papszStrList)
Definition: cpl_string.cpp:147
wkbCurvePolygon
@ wkbCurvePolygon
Definition: ogr_core.h:331
wkbLineStringM
@ wkbLineStringM
Definition: ogr_core.h:359
OGR_GET_MS
#define OGR_GET_MS(floatingpoint_sec)
Definition: ogr_core.h:714
OGRERR_FAILURE
#define OGRERR_FAILURE
Definition: ogr_core.h:293
wkbMultiPolygon25D
@ wkbMultiPolygon25D
Definition: ogr_core.h:399
wkbCircularStringM
@ wkbCircularStringM
Definition: ogr_core.h:365
wkbMultiSurface
@ wkbMultiSurface
Definition: ogr_core.h:335
ogrsf_frmts.h
wkbCurvePolygonM
@ wkbCurvePolygonM
Definition: ogr_core.h:367
wkbMultiPointM
@ wkbMultiPointM
Definition: ogr_core.h:361
CPLDebug
void CPLDebug(const char *, const char *,...)
Definition: cpl_error.cpp:492
wkbGeometryCollectionM
@ wkbGeometryCollectionM
Definition: ogr_core.h:364
CPLMalloc
void * CPLMalloc(size_t)
Definition: cpl_conv.cpp:158
cpl_conv.h
cpl_string.h
wkbMultiCurveM
@ wkbMultiCurveM
Definition: ogr_core.h:368
wkbMultiLineString25D
@ wkbMultiLineString25D
Definition: ogr_core.h:398
OLCRandomWrite
#define OLCRandomWrite
Definition: ogr_core.h:724
wkbCompoundCurveM
@ wkbCompoundCurveM
Definition: ogr_core.h:366
CPLSPrintf
const char * CPLSPrintf(const char *fmt,...)
Definition: cpl_string.cpp:975
OGRLayer::SetSpatialFilterRect
virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
Set a new rectangular spatial filter.
Definition: ogrlayer.cpp:1175
CPLError
void CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...)
Definition: cpl_error.cpp:215
VSIFree
void VSIFree(void *)
Definition: cpl_vsisimple.cpp:817
CSLTokenizeStringComplex
char ** CSLTokenizeStringComplex(const char *pszString, const char *pszDelimiter, int bHonourStrings, int bAllowEmptyTokens)
Definition: cpl_string.cpp:767
CPLE_NotSupported
#define CPLE_NotSupported
Definition: cpl_error.h:110
OGRERR_CORRUPT_DATA
#define OGRERR_CORRUPT_DATA
Definition: ogr_core.h:292
OGRCoordinateTransformation
Definition: ogr_spatialref.h:591
CPL_ARRAYSIZE
#define CPL_ARRAYSIZE(array)
Definition: cpl_port.h:1134
OGRErr
int OGRErr
Definition: ogr_core.h:285
wkbCompoundCurveZ
@ wkbCompoundCurveZ
Definition: ogr_core.h:348
CSLDestroy
void CSLDestroy(char **papszStrList)
Definition: cpl_string.cpp:200
GIntBig
long long GIntBig
Definition: cpl_port.h:250
VSI_MALLOC_VERBOSE
#define VSI_MALLOC_VERBOSE(size)
Definition: cpl_vsi.h:254
CPL_SWAP32PTR
#define CPL_SWAP32PTR(x)
Definition: cpl_port.h:800
OGRwkbGeometryType
OGRwkbGeometryType
Definition: ogr_core.h:312
CPL_UNUSED
#define CPL_UNUSED
Definition: cpl_port.h:1008
OGRFeatureDefn::Reference
int Reference()
Increments the reference count by one.
Definition: ogr_feature.h:251
OGRFeature
Definition: ogr_feature.h:279
cpl_port.h
OLCFastGetExtent
#define OLCFastGetExtent
Definition: ogr_core.h:727
wkbXDR
@ wkbXDR
Definition: ogr_core.h:481
CPLForceToASCII
char * CPLForceToASCII(const char *pabyData, int nLen, char chReplacementChar)
Definition: cpl_recode.cpp:276
wkbGeometryCollection25D
@ wkbGeometryCollection25D
Definition: ogr_core.h:400
wkbMultiCurveZ
@ wkbMultiCurveZ
Definition: ogr_core.h:350
OGRFeatureDefn::Clone
virtual OGRFeatureDefn * Clone()
Create a copy of this feature definition.
Definition: ogrfeaturedefn.cpp:201
OGRGeometry::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT)=0
Apply arbitrary coordinate transformation to geometry.
wkbMultiCurve
@ wkbMultiCurve
Definition: ogr_core.h:334
wkbMultiPolygonM
@ wkbMultiPolygonM
Definition: ogr_core.h:363
wkbLineString25D
@ wkbLineString25D
Definition: ogr_core.h:395
wkbGeometryCollectionZM
@ wkbGeometryCollectionZM
Definition: ogr_core.h:382
OGRERR_NONE
#define OGRERR_NONE
Definition: ogr_core.h:287
CPLStrdup
char * CPLStrdup(const char *)
Definition: cpl_conv.cpp:284
OGRFeatureDefn
Definition: ogr_feature.h:207
CPLAtof
double CPLAtof(const char *)
Definition: cpl_strtod.cpp:117
wkbMultiSurfaceZ
@ wkbMultiSurfaceZ
Definition: ogr_core.h:351
CPLE_IllegalArg
#define CPLE_IllegalArg
Definition: cpl_error.h:108
OGRFeature::GetGeomFieldRef
OGRGeometry * GetGeomFieldRef(int iField)
Fetch pointer to feature geometry.
Definition: ogrfeature.cpp:630
OGRGeometry::getEnvelope
virtual void getEnvelope(OGREnvelope *psEnvelope) const =0
Computes and returns the bounding envelope for this geometry in the passed psEnvelope structure.
CPLScanLong
long CPLScanLong(const char *, int)
Definition: cpl_conv.cpp:863
ogr_core.h
wkbMultiLineStringM
@ wkbMultiLineStringM
Definition: ogr_core.h:362
CPLFree
#define CPLFree
Definition: cpl_conv.h:81
OGRwkbVariant
OGRwkbVariant
Definition: ogr_core.h:418
OGRFeature::GetFID
GIntBig GetFID() const
Get feature identifier.
Definition: ogr_feature.h:435
wkbPointM
@ wkbPointM
Definition: ogr_core.h:358
CPLGetConfigOption
const char * CPLGetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1625
CPLE_AppDefined
#define CPLE_AppDefined
Definition: cpl_error.h:100

Generated for GDAL by doxygen 1.8.17.