OGR
ogrwarpedlayer.h
1 /******************************************************************************
2  * $Id: ogrwarpedlayer.h 10e54d45fee8229428eb8ab22949aa46eb9da150 2018-05-06 11:07:25 +0200 Even 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  CPL_DISALLOW_COPY_ASSIGN(OGRWarpedLayer)
44 
45  protected:
46  OGRFeatureDefn *m_poFeatureDefn;
47  int m_iGeomField;
48 
50  OGRCoordinateTransformation *m_poReversedCT; /* may be NULL */
51  OGRSpatialReference *m_poSRS;
52 
53  OGREnvelope sStaticEnvelope{};
54 
55  static int ReprojectEnvelope( OGREnvelope* psEnvelope,
57 
58  OGRFeature * SrcFeatureToWarpedFeature(OGRFeature* poFeature);
59  OGRFeature * WarpedFeatureToSrcFeature(OGRFeature* poFeature);
60 
61  public:
62 
63  OGRWarpedLayer(OGRLayer* poDecoratedLayer,
64  int iGeomField,
65  int bTakeOwnership,
66  OGRCoordinateTransformation* poCT, /* must NOT be NULL, ownership acquired by OGRWarpedLayer */
67  OGRCoordinateTransformation* poReversedCT /* may be NULL, ownership acquired by OGRWarpedLayer */);
68  virtual ~OGRWarpedLayer();
69 
70  void SetExtent(double dfXMin, double dfYMin, double dfXMax, double dfYMax);
71 
72  virtual void SetSpatialFilter( OGRGeometry * ) override;
73  virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
74  double dfMaxX, double dfMaxY ) override;
75  virtual void SetSpatialFilter( int iGeomField, OGRGeometry * ) override;
76  virtual void SetSpatialFilterRect( int iGeomField, double dfMinX, double dfMinY,
77  double dfMaxX, double dfMaxY ) override;
78 
79  virtual OGRFeature *GetNextFeature() override;
80  virtual OGRFeature *GetFeature( GIntBig nFID ) override;
81  virtual OGRErr ISetFeature( OGRFeature *poFeature ) override;
82  virtual OGRErr ICreateFeature( OGRFeature *poFeature ) override;
83 
84  virtual OGRFeatureDefn *GetLayerDefn() override;
85 
86  virtual OGRSpatialReference *GetSpatialRef() override;
87 
88  virtual GIntBig GetFeatureCount( int bForce = TRUE ) override;
89  virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce = TRUE) override;
90  virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) override;
91 
92  virtual int TestCapability( const char * ) override;
93 };
94 
95 #endif /* #ifndef DOXYGEN_SKIP */
96 
97 #endif // OGRWARPEDLAYER_H_INCLUDED
OLCFastSpatialFilter
#define OLCFastSpatialFilter
Definition: ogr_core.h:755
wkbPointZM
@ wkbPointZM
Definition: ogr_core.h:381
wkbCurvePolygonZM
@ wkbCurvePolygonZM
Definition: ogr_core.h:390
GByte
unsigned char GByte
Definition: cpl_port.h:215
OGRFeature::SetFID
virtual OGRErr SetFID(GIntBig nFIDIn)
Set the feature identifier.
Definition: ogrfeature.cpp:5440
OGRERR_UNSUPPORTED_GEOMETRY_TYPE
#define OGRERR_UNSUPPORTED_GEOMETRY_TYPE
Definition: ogr_core.h:295
OGRFeature::StealGeometry
OGRGeometry * StealGeometry() CPL_WARN_UNUSED_RESULT
Take away ownership of geometry.
Definition: ogrfeature.cpp:498
GInt16
short GInt16
Definition: cpl_port.h:211
wkbMultiCurveZM
@ wkbMultiCurveZM
Definition: ogr_core.h:391
cpl_error.h
wkbMultiLineStringZM
@ wkbMultiLineStringZM
Definition: ogr_core.h:385
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:2036
wkbCurvePolygonZ
@ wkbCurvePolygonZ
Definition: ogr_core.h:354
wkbMultiSurfaceZM
@ wkbMultiSurfaceZM
Definition: ogr_core.h:392
wkbCompoundCurveZM
@ wkbCompoundCurveZM
Definition: ogr_core.h:389
wkbMultiSurfaceM
@ wkbMultiSurfaceM
Definition: ogr_core.h:374
CPLCalloc
void * CPLCalloc(size_t, size_t)
Definition: cpl_conv.cpp:138
wkbMultiPoint25D
@ wkbMultiPoint25D
Definition: ogr_core.h:402
OGRLayer::GetSpatialRef
virtual OGRSpatialReference * GetSpatialRef()
Fetch the spatial reference system for this layer.
Definition: ogrlayer.cpp:1037
wkbNDR
@ wkbNDR
Definition: ogr_core.h:492
cpl_vsi.h
OGRSpatialReference
Definition: ogr_spatialref.h:156
wkbCompoundCurve
@ wkbCompoundCurve
Definition: ogr_core.h:335
OGRLayer::GetFeatureCount
virtual GIntBig GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition: ogrlayer.cpp:173
CPLsnprintf
int CPLsnprintf(char *str, size_t size, const char *fmt,...)
Definition: cpl_string.cpp:1337
wkbPolygon25D
@ wkbPolygon25D
Definition: ogr_core.h:401
wkbPolygonZM
@ wkbPolygonZM
Definition: ogr_core.h:383
wkbVariantPostGIS1
@ wkbVariantPostGIS1
Definition: ogr_core.h:427
OLCSequentialWrite
#define OLCSequentialWrite
Definition: ogr_core.h:753
wkbPolygonM
@ wkbPolygonM
Definition: ogr_core.h:365
OGRGeometry
Definition: ogr_geometry.h:286
wkbCircularString
@ wkbCircularString
Definition: ogr_core.h:333
OGRLayer
Definition: ogrsf_frmts.h:70
wkbMultiPolygonZM
@ wkbMultiPolygonZM
Definition: ogr_core.h:386
ogr_geometry.h
CPLRealloc
void * CPLRealloc(void *, size_t)
Definition: cpl_conv.cpp:225
OLCFastFeatureCount
#define OLCFastFeatureCount
Definition: ogr_core.h:756
wkbPoint25D
@ wkbPoint25D
Definition: ogr_core.h:399
wkbCircularStringZM
@ wkbCircularStringZM
Definition: ogr_core.h:388
EQUAL
#define EQUAL(a, b)
Definition: cpl_port.h:569
wkbCircularStringZ
@ wkbCircularStringZ
Definition: ogr_core.h:352
OGRBoolean
int OGRBoolean
Definition: ogr_core.h:306
wkbMultiPointZM
@ wkbMultiPointZM
Definition: ogr_core.h:384
OGRRawPoint::x
double x
Definition: ogr_geometry.h:73
OGRCoordinateTransformation::Transform
int Transform(int nCount, double *x, double *y, double *z=nullptr, int *pabSuccess=nullptr)
Definition: ogrct.cpp:1414
CPLES_XML
#define CPLES_XML
Definition: cpl_string.h:169
wkbLineStringZM
@ wkbLineStringZM
Definition: ogr_core.h:382
OGRFeature::SetFrom
OGRErr SetFrom(const OGRFeature *, int=TRUE)
Set one feature from another.
Definition: ogrfeature.cpp:5737
CPLAssert
#define CPLAssert(expr)
Definition: cpl_error.h:186
OGRRawPoint
Definition: ogr_geometry.h:63
CPLTestBool
bool CPLTestBool(const char *pszValue)
Definition: cpl_string.cpp:1526
OGRwkbByteOrder
OGRwkbByteOrder
Definition: ogr_core.h:489
OGRField
Definition: ogr_core.h:683
wkbCurvePolygon
@ wkbCurvePolygon
Definition: ogr_core.h:336
wkbLineStringM
@ wkbLineStringM
Definition: ogr_core.h:364
OGRERR_FAILURE
#define OGRERR_FAILURE
Definition: ogr_core.h:298
OGRFeatureDefn::Clone
virtual OGRFeatureDefn * Clone() const
Create a copy of this feature definition.
Definition: ogrfeaturedefn.cpp:201
wkbMultiPolygon25D
@ wkbMultiPolygon25D
Definition: ogr_core.h:404
wkbCircularStringM
@ wkbCircularStringM
Definition: ogr_core.h:370
wkbMultiSurface
@ wkbMultiSurface
Definition: ogr_core.h:340
ogrsf_frmts.h
wkbCurvePolygonM
@ wkbCurvePolygonM
Definition: ogr_core.h:372
wkbMultiPointM
@ wkbMultiPointM
Definition: ogr_core.h:366
CPLDebug
void CPLDebug(const char *, const char *,...)
Definition: cpl_error.cpp:602
wkbGeometryCollectionM
@ wkbGeometryCollectionM
Definition: ogr_core.h:369
CPLMalloc
void * CPLMalloc(size_t)
Definition: cpl_conv.cpp:168
cpl_conv.h
cpl_string.h
wkbMultiCurveM
@ wkbMultiCurveM
Definition: ogr_core.h:373
wkbMultiLineString25D
@ wkbMultiLineString25D
Definition: ogr_core.h:403
OLCRandomWrite
#define OLCRandomWrite
Definition: ogr_core.h:754
wkbCompoundCurveM
@ wkbCompoundCurveM
Definition: ogr_core.h:371
CPLSPrintf
const char * CPLSPrintf(const char *fmt,...)
Definition: cpl_string.cpp:977
OGRLayer::SetSpatialFilterRect
virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
Set a new rectangular spatial filter.
Definition: ogrlayer.cpp:1184
CPLError
void CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...)
Definition: cpl_error.cpp:308
VSIFree
void VSIFree(void *)
Definition: cpl_vsisimple.cpp:827
CPLE_NotSupported
#define CPLE_NotSupported
Definition: cpl_error.h:109
OGRERR_CORRUPT_DATA
#define OGRERR_CORRUPT_DATA
Definition: ogr_core.h:297
OGRCoordinateTransformation
Definition: ogr_spatialref.h:684
CPL_ARRAYSIZE
#define CPL_ARRAYSIZE(array)
Definition: cpl_port.h:1045
OGRErr
int OGRErr
Definition: ogr_core.h:290
wkbCompoundCurveZ
@ wkbCompoundCurveZ
Definition: ogr_core.h:353
GIntBig
long long GIntBig
Definition: cpl_port.h:248
VSI_MALLOC_VERBOSE
#define VSI_MALLOC_VERBOSE(size)
Definition: cpl_vsi.h:268
CPL_SWAP32PTR
#define CPL_SWAP32PTR(x)
Definition: cpl_port.h:747
OGRwkbGeometryType
OGRwkbGeometryType
Definition: ogr_core.h:317
CPL_UNUSED
#define CPL_UNUSED
Definition: cpl_port.h:948
OGRFeatureDefn::Reference
int Reference()
Increments the reference count by one.
Definition: ogr_feature.h:307
OGRFeature
Definition: ogr_feature.h:354
cpl_port.h
OLCFastGetExtent
#define OLCFastGetExtent
Definition: ogr_core.h:757
wkbXDR
@ wkbXDR
Definition: ogr_core.h:491
CPLForceToASCII
char * CPLForceToASCII(const char *pabyData, int nLen, char chReplacementChar)
Definition: cpl_recode.cpp:276
wkbGeometryCollection25D
@ wkbGeometryCollection25D
Definition: ogr_core.h:405
wkbMultiCurveZ
@ wkbMultiCurveZ
Definition: ogr_core.h:355
OGRGeometry::transform
virtual OGRErr transform(OGRCoordinateTransformation *poCT)=0
Apply arbitrary coordinate transformation to geometry.
wkbMultiCurve
@ wkbMultiCurve
Definition: ogr_core.h:339
wkbMultiPolygonM
@ wkbMultiPolygonM
Definition: ogr_core.h:368
wkbLineString25D
@ wkbLineString25D
Definition: ogr_core.h:400
wkbGeometryCollectionZM
@ wkbGeometryCollectionZM
Definition: ogr_core.h:387
OGRERR_NONE
#define OGRERR_NONE
Definition: ogr_core.h:292
CPLStrdup
char * CPLStrdup(const char *)
Definition: cpl_conv.cpp:293
OGRFeatureDefn
Definition: ogr_feature.h:259
CPLAtof
double CPLAtof(const char *)
Definition: cpl_strtod.cpp:117
wkbMultiSurfaceZ
@ wkbMultiSurfaceZ
Definition: ogr_core.h:356
CPLE_IllegalArg
#define CPLE_IllegalArg
Definition: cpl_error.h:107
OGRFeature::GetGeomFieldRef
OGRGeometry * GetGeomFieldRef(int iField)
Fetch pointer to feature geometry.
Definition: ogrfeature.cpp:666
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:906
OGR_GET_MS
int OGR_GET_MS(float fSec)
Definition: ogr_core.h:737
ogr_core.h
wkbMultiLineStringM
@ wkbMultiLineStringM
Definition: ogr_core.h:367
CPLFree
#define CPLFree
Definition: cpl_conv.h:81
CPL_DISALLOW_COPY_ASSIGN
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Definition: cpl_port.h:997
OGRwkbVariant
OGRwkbVariant
Definition: ogr_core.h:423
OGRFeature::GetFID
GIntBig GetFID() const
Get feature identifier.
Definition: ogr_feature.h:712
wkbPointM
@ wkbPointM
Definition: ogr_core.h:363
CPLGetConfigOption
const char * CPLGetConfigOption(const char *, const char *)
Definition: cpl_conv.cpp:1692
CPLE_AppDefined
#define CPLE_AppDefined
Definition: cpl_error.h:99

Generated for GDAL by doxygen 1.8.17.