13#ifndef OGRWARPEDLAYER_H_INCLUDED
14#define OGRWARPEDLAYER_H_INCLUDED
18#include "ogrlayerdecorator.h"
19#include "ogrlayerwithtranslatefeature.h"
26#pragma warning(disable : 4250)
33class CPL_DLL OGRWarpedLayer final :
public OGRLayerDecorator,
34 public OGRLayerWithTranslateFeature
39 OGRFeatureDefn *m_poFeatureDefn =
nullptr;
42 OGRGeometryFactory::TransformWithOptionsCache m_transformCacheForward{};
43 OGRGeometryFactory::TransformWithOptionsCache m_transformCacheReverse{};
44 OGRCoordinateTransformation *m_poCT =
nullptr;
45 OGRCoordinateTransformation *m_poReversedCT =
nullptr;
46 OGRSpatialReference *m_poSRS =
nullptr;
48 OGREnvelope sStaticEnvelope{};
50 static int ReprojectEnvelope(OGREnvelope *psEnvelope,
51 OGRCoordinateTransformation *poCT);
53 std::unique_ptr<OGRFeature>
54 SrcFeatureToWarpedFeature(std::unique_ptr<OGRFeature> poFeature);
55 std::unique_ptr<OGRFeature>
56 WarpedFeatureToSrcFeature(std::unique_ptr<OGRFeature> poFeature);
60 OGRLayer *poDecoratedLayer,
int iGeomField,
int bTakeOwnership,
61 OGRCoordinateTransformation
63 OGRCoordinateTransformation *
65 ~OGRWarpedLayer()
override;
67 void TranslateFeature(
68 std::unique_ptr<OGRFeature> poSrcFeature,
69 std::vector<std::unique_ptr<OGRFeature>> &apoOutFeatures)
override;
71 void SetExtent(
double dfXMin,
double dfYMin,
double dfXMax,
double dfYMax);
73 virtual OGRErr ISetSpatialFilter(
int iGeomField,
74 const OGRGeometry *)
override;
76 OGRFeature *GetNextFeature()
override;
77 OGRFeature *GetFeature(
GIntBig nFID)
override;
78 OGRErr ISetFeature(OGRFeature *poFeature)
override;
79 OGRErr ICreateFeature(OGRFeature *poFeature)
override;
80 OGRErr IUpsertFeature(OGRFeature *poFeature)
override;
81 OGRErr IUpdateFeature(OGRFeature *poFeature,
int nUpdatedFieldsCount,
82 const int *panUpdatedFieldsIdx,
83 int nUpdatedGeomFieldsCount,
84 const int *panUpdatedGeomFieldsIdx,
85 bool bUpdateStyleString)
override;
87 const OGRFeatureDefn *GetLayerDefn()
const override;
89 const OGRSpatialReference *GetSpatialRef()
const override;
91 GIntBig GetFeatureCount(
int bForce = TRUE)
override;
92 OGRErr IGetExtent(
int iGeomField, OGREnvelope *psExtent,
93 bool bForce =
true)
override;
95 int TestCapability(
const char *)
const override;
97 virtual bool GetArrowStream(
struct ArrowArrayStream *out_stream,
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:936
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:205
int OGRErr
Type for a OGR error.
Definition ogr_core.h:370