30#ifndef OGRUNIONLAYER_H_INCLUDED
31#define OGRUNIONLAYER_H_INCLUDED
45 int bGeomTypeSet =
false;
47 OGREnvelope sStaticEnvelope{};
50 explicit OGRUnionLayerGeomFieldDefn(
const OGRGeomFieldDefn* poSrc);
51 explicit OGRUnionLayerGeomFieldDefn(
const OGRUnionLayerGeomFieldDefn* poSrc);
52 ~OGRUnionLayerGeomFieldDefn();
61 FIELD_FROM_FIRST_LAYER,
62 FIELD_UNION_ALL_LAYERS,
63 FIELD_INTERSECTION_ALL_LAYERS,
67class CPL_DLL OGRUnionLayer final:
public OGRLayer
74 OGRLayer **papoSrcLayers;
75 int bHasLayerOwnership;
77 OGRFeatureDefn *poFeatureDefn;
79 OGRFieldDefn **papoFields;
81 OGRUnionLayerGeomFieldDefn **papoGeomFields;
82 FieldUnionStrategy eFieldStrategy;
83 CPLString osSourceLayerFieldName{};
90 char *pszAttributeFilter;
93 char **papszIgnoredFields;
94 int bAttrFilterPassThroughValue;
95 int *pabModifiedLayers;
96 int *pabCheckIfAutoWrap;
97 OGRSpatialReference *poGlobalSRS;
99 void AutoWarpLayerIfNecessary(
int iSubLayer);
100 OGRFeature *TranslateFromSrcLayer(OGRFeature* poSrcFeature);
101 void ApplyAttributeFilterToSrcLayer(
int iSubLayer);
102 int GetAttrFilterPassThroughValue();
103 void ConfigureActiveLayer();
104 void SetSpatialFilterToSourceLayer(OGRLayer* poSrcLayer);
107 OGRUnionLayer(
const char* pszName,
109 OGRLayer** papoSrcLayers,
110 int bTakeLayerOwnership);
112 virtual ~OGRUnionLayer();
116 void SetFields(FieldUnionStrategy eFieldStrategy,
118 OGRFieldDefn** papoFields,
120 OGRUnionLayerGeomFieldDefn** papoGeomFields );
121 void SetSourceLayerFieldName(
const char* pszSourceLayerFieldName);
122 void SetPreserveSrcFID(
int bPreserveSrcFID);
123 void SetFeatureCount(
int nFeatureCount);
124 virtual const char *GetName()
override {
return osName.c_str(); }
127 virtual void ResetReading()
override;
128 virtual OGRFeature *GetNextFeature()
override;
130 virtual OGRFeature *GetFeature(
GIntBig nFeatureId )
override;
132 virtual OGRErr ICreateFeature( OGRFeature* poFeature )
override;
134 virtual OGRErr ISetFeature( OGRFeature* poFeature )
override;
136 virtual OGRFeatureDefn *GetLayerDefn()
override;
140 virtual GIntBig GetFeatureCount(
int )
override;
142 virtual OGRErr SetAttributeFilter(
const char * )
override;
144 virtual int TestCapability(
const char * )
override;
146 virtual OGRErr GetExtent(
int iGeomField, OGREnvelope *psExtent,
int bForce = TRUE)
override;
147 virtual OGRErr GetExtent( OGREnvelope *psExtent,
int bForce )
override;
149 virtual void SetSpatialFilter( OGRGeometry * poGeomIn )
override;
150 virtual void SetSpatialFilter(
int iGeomField, OGRGeometry * )
override;
152 virtual OGRErr SetIgnoredFields(
const char **papszFields )
override;
154 virtual OGRErr SyncToDisk()
override;
Definition of a geometry field of an OGRFeatureDefn.
Definition ogr_feature.h:202
virtual OGRSpatialReference * GetSpatialRef() const
Fetch spatial reference system of this field.
Definition ogrgeomfielddefn.cpp:438
This class represents a layer of simple features, with access methods.
Definition ogrsf_frmts.h:71
#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:955
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:244
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:369
int OGRErr
Type for a OGR error.
Definition ogr_core.h:341
Classes related to registration of format support, and opening datasets.