14#ifndef OGRSF_FRMTS_H_INCLUDED
15#define OGRSF_FRMTS_H_INCLUDED
17#include "cpl_progress.h"
32#if !defined(GDAL_COMPILATION) && !defined(SUPPRESS_DEPRECATION_WARNINGS)
33#define OGR_DEPRECATED(x) CPL_WARN_DEPRECATED(x)
35#define OGR_DEPRECATED(x)
38#ifndef CPPCHECK_STATIC
39#define CPPCHECK_STATIC
43class OGRLayerAttrIndex;
46struct ArrowArrayStream;
64 std::unique_ptr<Private> m_poPrivate;
66 void ConvertGeomsIfNecessary(
OGRFeature *poFeature);
68 class CPL_DLL FeatureIterator
71 std::unique_ptr<Private> m_poPrivate;
74 FeatureIterator(OGRLayer *poLayer,
bool bStart);
76 FeatureIterator &&oOther)
noexcept;
80 FeatureIterator &operator++();
81 bool operator!=(
const FeatureIterator &it)
const;
84 friend inline FeatureIterator
begin(OGRLayer *poLayer);
85 friend inline FeatureIterator
end(OGRLayer *poLayer);
91 int m_bFilterIsEnvelope;
93 OGRPreparedGeometry *m_pPreparedFilterGeom;
96 int m_iGeomFieldFilter;
104 ValidateGeometryFieldIndexForSetSpatialFilter(
int iGeomField,
106 bool bIsSelectLayer =
false);
127 const int *panUpdatedFieldsIdx,
int nUpdatedGeomFieldsCount,
128 const int *panUpdatedGeomFieldsIdx,
134 friend struct OGRGenSQLResultsLayerArrowStreamPrivateData;
136 struct ArrowArrayStreamPrivateData
138 bool m_bArrowArrayStreamInProgress =
false;
140 OGRLayer *m_poLayer =
nullptr;
141 std::vector<GIntBig> m_anQueriedFIDs{};
142 size_t m_iQueriedFIDS = 0;
143 std::deque<std::unique_ptr<OGRFeature>> m_oFeatureQueue{};
146 std::shared_ptr<ArrowArrayStreamPrivateData>
147 m_poSharedArrowArrayStreamPrivateData{};
149 struct ArrowArrayStreamPrivateDataSharedDataWrapper
151 std::shared_ptr<ArrowArrayStreamPrivateData> poShared{};
155 friend class OGRArrowArrayHelper;
156 friend class OGRGenSQLResultsLayer;
161 struct ArrowSchema *out_schema);
163 struct ArrowArray *out_array);
165 struct ArrowSchema *out_schema);
167 struct ArrowArray *out_array);
170 static struct ArrowSchema *
172 const char *pszArrowFormat,
173 const char *pszExtensionName);
178 struct ArrowArray *array,
182 bool CreateFieldFromArrowSchemaInternal(
const struct ArrowSchema *schema,
183 const std::string &osFieldPrefix,
189 ~OGRLayer()
override;
200 FeatureIterator
begin();
203 FeatureIterator
end();
213 double dfMaxX,
double dfMaxY);
227 std::
string &osErrorMsg) const;
232 struct ArrowArray *array,
243 const
int *panUpdatedFieldsIdx,
244 int nUpdatedGeomFieldsCount,
245 const
int *panUpdatedGeomFieldsIdx,
250 virtual const
char *
GetName() const;
257 const_cast<const OGRLayer *
>(
this)->GetLayerDefn());
260 virtual int FindFieldIndex(
const char *pszFieldName,
int bExactMatch);
265 typedef std::vector<OGRSpatialReferenceRefCountedPtr>
298 int bApproxOK = TRUE);
313 virtual
void PrepareStartTransaction();
315 virtual
void FinishRollbackTransaction(const std::
string &osSavepointName);
325 GDALProgressFunc pfnProgress,
void *pProgressData);
329 GDALProgressFunc pfnProgress =
nullptr,
330 void *pProgressArg =
nullptr);
331 OGRErr Union(OGRLayer *pLayerMethod, OGRLayer *pLayerResult,
333 GDALProgressFunc pfnProgress =
nullptr,
334 void *pProgressArg =
nullptr);
337 GDALProgressFunc pfnProgress,
void *pProgressArg);
340 GDALProgressFunc pfnProgress =
nullptr,
341 void *pProgressArg =
nullptr);
342 OGRErr Update(OGRLayer *pLayerMethod, OGRLayer *pLayerResult,
344 GDALProgressFunc pfnProgress =
nullptr,
345 void *pProgressArg =
nullptr);
346 OGRErr Clip(OGRLayer *pLayerMethod, OGRLayer *pLayerResult,
348 GDALProgressFunc pfnProgress =
nullptr,
349 void *pProgressArg =
nullptr);
350 OGRErr Erase(OGRLayer *pLayerMethod, OGRLayer *pLayerResult,
352 GDALProgressFunc pfnProgress =
nullptr,
353 void *pProgressArg =
nullptr);
366 int AttributeFilterEvaluationNeedsGeometry();
369 OGRErr InitializeIndexSupport(const
char *);
371 OGRLayerAttrIndex *GetIndex()
373 return m_poAttrIndex;
376 int GetGeomFieldFilter()
const
378 return m_iGeomFieldFilter;
381 const char *GetAttrQueryString()
const
383 return m_pszAttrQueryString;
392 return reinterpret_cast<OGRLayerH>(poLayer);
399 return reinterpret_cast<OGRLayer *
>(hLayer);
403 bool FilterWKBGeometry(
const GByte *pabyWKB,
size_t nWKBSize,
404 bool bEnvelopeAlreadySet,
407 static bool FilterWKBGeometry(
const GByte *pabyWKB,
size_t nWKBSize,
408 bool bEnvelopeAlreadySet,
411 bool bFilterIsEnvelope,
413 OGRPreparedGeometry *&poPreparedFilterGeom);
429 enum class FieldChangeType :
char
437 template <
typename T>
struct FieldDefnChange
440 FieldDefnChange(std::unique_ptr<T> &&poFieldDefnIn,
int iFieldIn,
441 FieldChangeType eChangeTypeIn,
442 const std::string &osSavepointNameIn =
"")
443 : poFieldDefn(std::move(poFieldDefnIn)), iField(iFieldIn),
444 eChangeType(eChangeTypeIn), osSavepointName(osSavepointNameIn)
448 std::unique_ptr<T> poFieldDefn;
450 FieldChangeType eChangeType;
451 std::string osSavepointName;
454 std::vector<FieldDefnChange<OGRFieldDefn>> m_apoFieldDefnChanges{};
455 std::vector<FieldDefnChange<OGRGeomFieldDefn>> m_apoGeomFieldDefnChanges{};
457 OGRStyleTable *m_poStyleTable;
458 OGRFeatureQuery *m_poAttrQuery;
459 char *m_pszAttrQueryString;
460 OGRLayerAttrIndex *m_poAttrIndex;
478inline OGRLayer::FeatureIterator
begin(OGRLayer *poLayer)
480 return poLayer->
begin();
486inline OGRLayer::FeatureIterator
end(OGRLayer *poLayer)
488 return poLayer->
end();
518 const auto poThis =
static_cast<BaseLayer *
>(
this);
521 OGRFeature *poFeature = poThis->GetNextRawFeature();
522 if (poFeature ==
nullptr)
525 if ((poThis->m_poFilterGeom ==
nullptr ||
527 (poThis->m_poAttrQuery ==
nullptr ||
528 poThis->m_poAttrQuery->Evaluate(poFeature)))
539#define DEFINE_GET_NEXT_FEATURE_THROUGH_RAW(BaseLayer) \
541 friend class OGRGetNextFeatureThroughRaw<BaseLayer>; \
544 OGRFeature *GetNextFeature() override \
546 return OGRGetNextFeatureThroughRaw<BaseLayer>::GetNextFeature(); \
576 ~OGRDataSource()
override;
579 virtual const char *GetName()
580 OGR_DEPRECATED(
"Use GDALDataset class instead") = 0;
582 static void DestroyDataSource(OGRDataSource *)
583 OGR_DEPRECATED(
"Use GDALDataset class instead");
615 virtual const char *GetName()
616 OGR_DEPRECATED(
"Use GDALDriver class instead") = 0;
618 virtual OGRDataSource *Open(
const char *pszName,
int bUpdate = FALSE)
619 OGR_DEPRECATED(
"Use GDALDriver class instead") = 0;
621 virtual int TestCapability(
const char *pszCap)
622 OGR_DEPRECATED(
"Use GDALDriver class instead") = 0;
626 OGR_DEPRECATED(
"Use GDALDriver class instead");
627 virtual OGRErr DeleteDataSource(
const char *pszName)
628 OGR_DEPRECATED(
"Use GDALDriver class instead");
649class CPL_DLL OGRSFDriverRegistrar
652 OGRSFDriverRegistrar();
653 ~OGRSFDriverRegistrar();
664 static OGRSFDriverRegistrar *GetRegistrar()
665 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
667 CPPCHECK_STATIC
void RegisterDriver(
OGRSFDriver *poDriver)
668 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
670 CPPCHECK_STATIC
int GetDriverCount(
void)
671 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
673 CPPCHECK_STATIC
GDALDriver *GetDriver(
int iDriver)
674 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
676 CPPCHECK_STATIC
GDALDriver *GetDriverByName(
const char *)
677 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
679 CPPCHECK_STATIC
int GetOpenDSCount()
680 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
683 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
693void OGRRegisterAllInternal();
695void CPL_DLL RegisterOGRFileGDB();
696void DeclareDeferredOGRFileGDBPlugin();
697void CPL_DLL RegisterOGRShape();
698void CPL_DLL RegisterOGRNTF();
699void CPL_DLL RegisterOGRTiger();
700void CPL_DLL RegisterOGRS57();
701void CPL_DLL RegisterOGRTAB();
702void CPL_DLL RegisterOGRMIF();
703void CPL_DLL RegisterOGRODBC();
704void DeclareDeferredOGRODBCPlugin();
705void CPL_DLL RegisterOGRWAsP();
706void CPL_DLL RegisterOGRPG();
707void DeclareDeferredOGRPGPlugin();
708void CPL_DLL RegisterOGRMSSQLSpatial();
709void DeclareDeferredOGRMSSQLSpatialPlugin();
710void CPL_DLL RegisterOGRMySQL();
711void DeclareDeferredOGRMySQLPlugin();
712void CPL_DLL RegisterOGROCI();
713void DeclareDeferredOGROCIPlugin();
714void CPL_DLL RegisterOGRDGN();
715void CPL_DLL RegisterOGRGML();
716void CPL_DLL RegisterOGRLIBKML();
717void DeclareDeferredOGRLIBKMLPlugin();
718void CPL_DLL RegisterOGRKML();
719void CPL_DLL RegisterOGRFlatGeobuf();
720void CPL_DLL RegisterOGRGeoJSON();
721void CPL_DLL RegisterOGRGeoJSONSeq();
722void CPL_DLL RegisterOGRESRIJSON();
723void CPL_DLL RegisterOGRTopoJSON();
724void CPL_DLL RegisterOGRAVCBin();
725void CPL_DLL RegisterOGRAVCE00();
726void CPL_DLL RegisterOGRVRT();
727void CPL_DLL RegisterOGRSQLite();
728void CPL_DLL RegisterOGRCSV();
729void CPL_DLL RegisterOGRILI1();
730void CPL_DLL RegisterOGRILI2();
731void CPL_DLL RegisterOGRPGeo();
732void CPL_DLL RegisterOGRDXF();
733void CPL_DLL RegisterOGRCAD();
734void DeclareDeferredOGRCADPlugin();
735void CPL_DLL RegisterOGRDWG();
736void CPL_DLL RegisterOGRDGNV8();
737void DeclareDeferredOGRDWGPlugin();
738void DeclareDeferredOGRDGNV8Plugin();
739void CPL_DLL RegisterOGRIDB();
740void DeclareDeferredOGRIDBPlugin();
741void CPL_DLL RegisterOGRGMT();
742void CPL_DLL RegisterOGRGPX();
743void CPL_DLL RegisterOGRNAS();
744void CPL_DLL RegisterOGRGeoRSS();
745void CPL_DLL RegisterOGRVFK();
746void DeclareDeferredOGRVFKPlugin();
747void CPL_DLL RegisterOGRPGDump();
748void CPL_DLL RegisterOGROSM();
749void CPL_DLL RegisterOGRGPSBabel();
750void CPL_DLL RegisterOGRPDS();
751void CPL_DLL RegisterOGRWFS();
752void CPL_DLL RegisterOGROAPIF();
753void CPL_DLL RegisterOGRSOSI();
754void DeclareDeferredOGRSOSIPlugin();
755void CPL_DLL RegisterOGREDIGEO();
756void CPL_DLL RegisterOGRIdrisi();
757void CPL_DLL RegisterOGRXLS();
758void DeclareDeferredOGRXLSPlugin();
759void CPL_DLL RegisterOGRODS();
760void CPL_DLL RegisterOGRXLSX();
761void CPL_DLL RegisterOGRElastic();
762void DeclareDeferredOGRElasticPlugin();
763void CPL_DLL RegisterOGRGeoPackage();
764void CPL_DLL RegisterOGRCarto();
765void DeclareDeferredOGRCartoPlugin();
766void CPL_DLL RegisterOGRAmigoCloud();
767void CPL_DLL RegisterOGRSXF();
768void CPL_DLL RegisterOGROpenFileGDB();
769void DeclareDeferredOGROpenFileGDBPlugin();
770void CPL_DLL RegisterOGRSelafin();
771void CPL_DLL RegisterOGRJML();
772void CPL_DLL RegisterOGRPLSCENES();
773void DeclareDeferredOGRPLSCENESPlugin();
774void CPL_DLL RegisterOGRCSW();
775void CPL_DLL RegisterOGRMongoDBv3();
776void DeclareDeferredOGRMongoDBv3Plugin();
777void CPL_DLL RegisterOGRVDV();
778void CPL_DLL RegisterOGRGMLAS();
779void DeclareDeferredOGRGMLASPlugin();
780void CPL_DLL RegisterOGRMVT();
781void CPL_DLL RegisterOGRNGW();
782void CPL_DLL RegisterOGRMapML();
783void CPL_DLL RegisterOGRLVBAG();
784void CPL_DLL RegisterOGRHANA();
785void DeclareDeferredOGRHANAPlugin();
786void CPL_DLL RegisterOGRParquet();
787void DeclareDeferredOGRParquetPlugin();
788void CPL_DLL RegisterOGRArrow();
789void DeclareDeferredOGRArrowPlugin();
790void CPL_DLL RegisterOGRGTFS();
791void CPL_DLL RegisterOGRPMTiles();
792void CPL_DLL RegisterOGRJSONFG();
793void CPL_DLL RegisterOGRMiraMon();
794void CPL_DLL RegisterOGRXODR();
795void DeclareDeferredOGRXODRPlugin();
796void CPL_DLL RegisterOGRADBC();
797void DeclareDeferredOGRADBCPlugin();
798void CPL_DLL RegisterOGRAIVector();
String list class designed around our use of C "char**" string lists.
Definition cpl_string.h:476
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:77
Format specific driver.
Definition gdal_driver.h:63
GDALMajorObject(const GDALMajorObject &)=default
Copy constructor.
Class for dataset open functions.
Definition gdal_openinfo.h:30
LEGACY class.
Definition ogrsf_frmts.h:573
Simple container for a bounding region in 3D.
Definition ogr_core.h:217
Simple container for a bounding region (rectangle).
Definition ogr_core.h:44
Definition of a feature class or feature layer.
Definition ogr_feature.h:521
A simple feature, including geometry and attributes.
Definition ogr_feature.h:1041
OGRGeometry * GetGeometryRef()
Fetch pointer to feature geometry.
Definition ogrfeature.cpp:737
Definition of an attribute of an OGRFeatureDefn.
Definition ogr_feature.h:72
Definition of a geometry field of an OGRFeatureDefn.
Definition ogr_feature.h:335
Abstract base class for all geometry classes.
Definition ogr_geometry.h:357
Template class offering a GetNextFeature() implementation relying on GetNextRawFeature().
Definition ogrsf_frmts.h:509
OGRFeature * GetNextFeature()
Implement OGRLayer::GetNextFeature(), relying on BaseLayer::GetNextRawFeature().
Definition ogrsf_frmts.h:516
virtual OGRErr ISetSpatialFilter(int iGeomField, const OGRGeometry *)
Set a new spatial filter.
Definition ogrlayer.cpp:3579
OGRErr UpsertFeature(OGRFeature *poFeature)
Rewrite/replace an existing feature or create a new feature within a layer.
Definition ogrlayer.cpp:1714
friend FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:478
virtual OGRErr ICreateFeatureUniqPtr(std::unique_ptr< OGRFeature > poFeature, GIntBig *pnFID=nullptr)
Create and write a new feature within a layer, transferring ownership of the feature to the layer.
Definition ogrlayer.cpp:1680
virtual OGRErr IGetExtent3D(int iGeomField, OGREnvelope3D *psExtent3D, bool bForce)
Fetch the 3D extent of this layer, on the specified geometry field.
Definition ogrlayer.cpp:612
virtual OGRErr SetActiveSRS(int iGeomField, const OGRSpatialReference *poSRS)
Change the active SRS.
Definition ogrlayer.cpp:8468
int Dereference()
Decrement layer reference count.
Definition ogrlayer.cpp:129
OGRErr SymDifference(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, CSLConstList papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Symmetrical difference of two layers.
Definition ogrlayer.cpp:6341
virtual OGRErr DeleteFeature(GIntBig nFID)
Delete feature from layer.
Definition ogrlayer.cpp:4520
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable)
Set layer style table.
Definition ogrlayer.cpp:4718
virtual OGRErr StartTransaction()
For datasources which support transactions, StartTransaction creates a transaction.
Definition ogrlayer.cpp:2781
virtual const GetSupportedSRSListRetType & GetSupportedSRSList(int iGeomField)
Get the list of SRS supported.
Definition ogrlayer.cpp:8387
virtual GIntBig GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition ogrlayer.cpp:204
static struct ArrowSchema * CreateSchemaForWKBGeometryColumn(const OGRGeomFieldDefn *poFieldDefn, const char *pszArrowFormat, const char *pszExtensionName)
Return a ArrowSchema* corresponding to the WKB encoding of a geometry column.
Definition ogrlayerarrow.cpp:761
virtual void SetStyleTable(OGRStyleTable *poStyleTable)
Set layer style table.
Definition ogrlayer.cpp:4740
OGRErr Identity(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, CSLConstList papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Identify the features of this layer with the ones from the identity layer.
Definition ogrlayer.cpp:6771
virtual OGRErr IUpdateFeature(OGRFeature *poFeature, int nUpdatedFieldsCount, const int *panUpdatedFieldsIdx, int nUpdatedGeomFieldsCount, const int *panUpdatedGeomFieldsIdx, bool bUpdateStyleString)
Update (part of) an existing feature.
Definition ogrlayer.cpp:1929
virtual OGRErr IUpsertFeature(OGRFeature *poFeature)
Rewrite/replace an existing feature or create a new feature within a layer.
Definition ogrlayer.cpp:1743
virtual bool GetArrowStream(struct ArrowArrayStream *out_stream, CSLConstList papszOptions=nullptr)
Get a Arrow C stream.
Definition ogrlayerarrow.cpp:2746
OGRErr Erase(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, CSLConstList papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Remove areas that are covered by the method layer.
Definition ogrlayer.cpp:7847
virtual OGRErr ICreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition ogrlayer.cpp:1569
virtual OGRErr AlterGeomFieldDefn(int iGeomField, const OGRGeomFieldDefn *poNewGeomFieldDefn, int nFlagsIn)
Alter the definition of an existing geometry field on a layer.
Definition ogrlayer.cpp:2596
OGRErr Intersection(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, CSLConstList papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Intersection of two layers.
Definition ogrlayer.cpp:5386
virtual GDALDataset * GetDataset()
Return the dataset associated with this layer.
Definition ogrlayer.cpp:8535
virtual OGRErr ISetFeatureUniqPtr(std::unique_ptr< OGRFeature >)
Rewrite/replace an existing feature, transferring ownership of the feature to the layer.
Definition ogrlayer.cpp:1507
OGRErr GetExtent3D(int iGeomField, OGREnvelope3D *psExtent, bool bForce=true)
Fetch the 3D extent of this layer, on the specified geometry field.
Definition ogrlayer.cpp:559
std::vector< OGRSpatialReferenceRefCountedPtr > GetSupportedSRSListRetType
Return type of OGRLayer::GetSupportedSRSList().
Definition ogrsf_frmts.h:266
virtual OGRErr ISetFeature(OGRFeature *poFeature)
Rewrite/replace an existing feature.
Definition ogrlayer.cpp:1369
OGRErr Clip(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, CSLConstList papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Clip off areas that are not covered by the method layer.
Definition ogrlayer.cpp:7538
virtual const char * GetName() const
Return the layer name.
Definition ogrlayer.cpp:4807
static void ReleaseStream(struct ArrowArrayStream *stream)
Release a ArrowArrayStream.
Definition ogrlayerarrow.cpp:2567
virtual int GetNextArrowArray(struct ArrowArrayStream *, struct ArrowArray *out_array)
Default implementation of the ArrowArrayStream::get_next() callback.
Definition ogrlayerarrow.cpp:2067
OGRErr SetFeature(OGRFeature *poFeature)
Rewrite/replace an existing feature.
Definition ogrlayer.cpp:1341
virtual OGRErr CreateField(const OGRFieldDefn *poField, int bApproxOK=TRUE)
Create a new field on a layer.
Definition ogrlayer.cpp:2079
virtual const char * GetGeometryColumn() const
This method returns the name of the underlying database column being used as the geometry column,...
Definition ogrlayer.cpp:4645
virtual OGRErr CommitTransaction()
For datasources which support transactions, CommitTransaction commits a transaction.
Definition ogrlayer.cpp:2840
static OGRLayerH ToHandle(OGRLayer *poLayer)
Convert a OGRLayer* to a OGRLayerH.
Definition ogrsf_frmts.h:390
OGRErr Union(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, CSLConstList papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Union of two layers.
Definition ogrlayer.cpp:5804
virtual OGRErr IGetExtent(int iGeomField, OGREnvelope *psExtent, bool bForce)
Fetch the extent of this layer, on the specified geometry field.
Definition ogrlayer.cpp:376
virtual OGRGeometryTypeCounter * GetGeometryTypes(int iGeomField, int nFlagsGGT, int &nEntryCountOut, GDALProgressFunc pfnProgress, void *pProgressData)
Get actual geometry types found in features.
Definition ogrlayer.cpp:8231
friend FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:486
static void ReleaseArray(struct ArrowArray *array)
Release a ArrowArray.
Definition ogrlayerarrow.cpp:922
virtual OGRErr CreateGeomField(const OGRGeomFieldDefn *poField, int bApproxOK=TRUE)
Create a new geometry field on a layer.
Definition ogrlayer.cpp:2699
OGRErr GetExtent(OGREnvelope *psExtent, bool bForce=true)
Fetch the extent of this layer.
Definition ogrlayer.cpp:294
virtual bool CreateFieldFromArrowSchema(const struct ArrowSchema *schema, CSLConstList papszOptions=nullptr)
Creates a field from an ArrowSchema.
Definition ogrlayerarrow.cpp:6798
virtual void ResetReading()=0
Reset feature reading to start on the first feature.
OGRErr Update(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, CSLConstList papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Update this layer with features from the update layer.
Definition ogrlayer.cpp:7189
OGRErr CreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition ogrlayer.cpp:1539
virtual bool IsArrowSchemaSupported(const struct ArrowSchema *schema, CSLConstList papszOptions, std::string &osErrorMsg) const
Returns whether the provided ArrowSchema is supported for writing.
Definition ogrlayerarrow.cpp:6358
virtual OGRErr DeleteField(int iField)
Delete an existing field on a layer.
Definition ogrlayer.cpp:2170
virtual const OGRFeatureDefn * GetLayerDefn() const =0
Fetch the schema information for this layer.
virtual OGRErr SetIgnoredFields(CSLConstList papszFields)
Set which fields can be omitted when retrieving features from the layer.
Definition ogrlayer.cpp:4946
virtual OGRErr RollbackTransaction()
For datasources which support transactions, RollbackTransaction will roll back a datasource to its st...
Definition ogrlayer.cpp:2915
void PostFilterArrowArray(const struct ArrowSchema *schema, struct ArrowArray *array, CSLConstList papszOptions) const
Remove rows that aren't selected by the spatial or attribute filter.
Definition ogrlayerarrow.cpp:5606
OGRErr ReorderField(int iOldFieldPos, int iNewFieldPos)
Reorder an existing field on a layer.
Definition ogrlayer.cpp:2356
virtual OGRwkbGeometryType GetGeomType() const
Return the layer geometry type.
Definition ogrlayer.cpp:4870
virtual const char * GetFIDColumn() const
This method returns the name of the underlying database column being used as the FID column,...
Definition ogrlayer.cpp:4597
virtual OGRErr SetNextByIndex(GIntBig nIndex)
Move read cursor to the nIndex'th feature in the current resultset.
Definition ogrlayer.cpp:1057
OGRErr SetSpatialFilter(const OGRGeometry *)
Set a new spatial filter.
Definition ogrlayer.cpp:3493
virtual OGRStyleTable * GetStyleTable()
Returns layer style table.
Definition ogrlayer.cpp:4698
virtual OGRErr SetAttributeFilter(const char *)
Set a new attribute query.
Definition ogrlayer.cpp:752
virtual int TestCapability(const char *) const =0
Test if this layer supported the named capability.
virtual OGRFeature * GetFeature(GIntBig nFID)
Fetch a feature by its identifier.
Definition ogrlayer.cpp:942
static int StaticGetArrowSchema(struct ArrowArrayStream *, struct ArrowSchema *out_schema)
Default implementation of the ArrowArrayStream::get_schema() callback.
Definition ogrlayerarrow.cpp:864
static void ReleaseSchema(struct ArrowSchema *schema)
Release a ArrowSchema.
Definition ogrlayerarrow.cpp:323
virtual int GetArrowSchema(struct ArrowArrayStream *, struct ArrowSchema *out_schema)
Default implementation of the ArrowArrayStream::get_schema() callback.
Definition ogrlayerarrow.cpp:387
OGRErr UpdateFeature(OGRFeature *poFeature, int nUpdatedFieldsCount, const int *panUpdatedFieldsIdx, int nUpdatedGeomFieldsCount, const int *panUpdatedGeomFieldsIdx, bool bUpdateStyleString)
Update (part of) an existing feature.
Definition ogrlayer.cpp:1856
virtual bool WriteArrowBatch(const struct ArrowSchema *schema, struct ArrowArray *array, CSLConstList papszOptions=nullptr)
Writes a batch of rows from an ArrowArray.
Definition ogrlayerarrow.cpp:8181
static const char * GetLastErrorArrowArrayStream(struct ArrowArrayStream *)
Default implementation of the ArrowArrayStream::get_last_error() callback.
Definition ogrlayerarrow.cpp:2593
virtual OGRGeometry * GetSpatialFilter()
This method returns the current spatial filter for this layer.
Definition ogrlayer.cpp:3381
virtual OGRErr Rename(const char *pszNewName)
Rename layer.
Definition ogrlayer.cpp:5052
int GetRefCount() const
Fetch reference count.
Definition ogrlayer.cpp:159
static constexpr const char * DEFAULT_ARROW_GEOMETRY_NAME
Field name used by GetArrowSchema() for the name of the (single) geometry column (returned by GetGeom...
Definition ogrsf_frmts.h:424
virtual OGRFeature * GetNextFeature()=0
Fetch the next available feature from this layer.
int Reference()
Increment layer reference count.
Definition ogrlayer.cpp:99
static constexpr const char * DEFAULT_ARROW_FID_NAME
Field name used by GetArrowSchema() for a FID column when GetFIDColumn() is not set.
Definition ogrsf_frmts.h:419
virtual OGRErr SyncToDisk()
Flush pending changes to disk.
Definition ogrlayer.cpp:4453
virtual OGRErr ReorderFields(int *panMap)
Reorder all the fields of a layer.
Definition ogrlayer.cpp:2260
static int StaticGetNextArrowArray(struct ArrowArrayStream *, struct ArrowArray *out_array)
Default implementation of the ArrowArrayStream::get_next() callback.
Definition ogrlayerarrow.cpp:2540
static OGRLayer * FromHandle(OGRLayerH hLayer)
Convert a OGRLayerH to a OGRLayer*.
Definition ogrsf_frmts.h:397
virtual OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn, int nFlagsIn)
Alter the definition of an existing field on a layer.
Definition ogrlayer.cpp:2493
OGRErr SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
Set a new rectangular spatial filter.
Definition ogrlayer.cpp:3725
virtual bool CanPostFilterArrowArray(const struct ArrowSchema *schema) const
Whether the PostFilterArrowArray() can work on the schema to remove rows that aren't selected by the ...
Definition ogrlayerarrow.cpp:3283
LEGACY class.
Definition ogrsf_frmts.h:610
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
This class represents a style table.
Definition ogr_featurestyle.h:69
CPLErr
Error category / error level.
Definition cpl_error.h:45
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:279
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:275
#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:1101
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1252
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:1035
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:165
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:195
void * OGRLayerH
Opaque type for a layer (OGRLayer).
Definition gdal_fwd.h:157
This file is legacy since GDAL 3.12, but will be kept at least in the whole GDAL 3....
OGRwkbGeometryType
List of well known binary geometry types.
Definition ogr_core.h:423
int OGRErr
Type for a OGR error.
Definition ogr_core.h:388
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition ogr_feature.h:1723
Simple feature style classes.
std::unique_ptr< OGRLayer > OGRLayerUniquePtr
Unique pointer type for OGRLayer.
Definition ogrsf_frmts.h:494
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:478
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:486
Result item of OGR_L_GetGeometryTypes.
Definition ogr_api.h:627