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);
122 const int *panUpdatedFieldsIdx,
int nUpdatedGeomFieldsCount,
123 const int *panUpdatedGeomFieldsIdx,
129 friend struct OGRGenSQLResultsLayerArrowStreamPrivateData;
131 struct ArrowArrayStreamPrivateData
133 bool m_bArrowArrayStreamInProgress =
false;
135 OGRLayer *m_poLayer =
nullptr;
136 std::vector<GIntBig> m_anQueriedFIDs{};
137 size_t m_iQueriedFIDS = 0;
138 std::deque<std::unique_ptr<OGRFeature>> m_oFeatureQueue{};
141 std::shared_ptr<ArrowArrayStreamPrivateData>
142 m_poSharedArrowArrayStreamPrivateData{};
144 struct ArrowArrayStreamPrivateDataSharedDataWrapper
146 std::shared_ptr<ArrowArrayStreamPrivateData> poShared{};
150 friend class OGRArrowArrayHelper;
151 friend class OGRGenSQLResultsLayer;
156 struct ArrowSchema *out_schema);
158 struct ArrowArray *out_array);
160 struct ArrowSchema *out_schema);
162 struct ArrowArray *out_array);
165 static struct ArrowSchema *
167 const char *pszArrowFormat,
168 const char *pszExtensionName);
173 struct ArrowArray *array,
177 bool CreateFieldFromArrowSchemaInternal(
const struct ArrowSchema *schema,
178 const std::string &osFieldPrefix,
184 ~OGRLayer()
override;
195 FeatureIterator
begin();
198 FeatureIterator
end();
208 double dfMaxX,
double dfMaxY);
222 std::
string &osErrorMsg) const;
227 struct ArrowArray *array,
234 const
int *panUpdatedFieldsIdx,
235 int nUpdatedGeomFieldsCount,
236 const
int *panUpdatedGeomFieldsIdx,
241 virtual const
char *
GetName() const;
248 const_cast<const OGRLayer *
>(
this)->GetLayerDefn());
251 virtual int FindFieldIndex(
const char *pszFieldName,
int bExactMatch);
257 std::unique_ptr<OGRSpatialReference, OGRSpatialReferenceReleaser>>
290 int bApproxOK = TRUE);
305 virtual
void PrepareStartTransaction();
307 virtual
void FinishRollbackTransaction(const std::
string &osSavepointName);
317 GDALProgressFunc pfnProgress,
void *pProgressData);
320 char **papszOptions =
nullptr,
321 GDALProgressFunc pfnProgress =
nullptr,
322 void *pProgressArg =
nullptr);
323 OGRErr Union(OGRLayer *pLayerMethod, OGRLayer *pLayerResult,
324 char **papszOptions =
nullptr,
325 GDALProgressFunc pfnProgress =
nullptr,
326 void *pProgressArg =
nullptr);
328 char **papszOptions, GDALProgressFunc pfnProgress,
331 char **papszOptions =
nullptr,
332 GDALProgressFunc pfnProgress =
nullptr,
333 void *pProgressArg =
nullptr);
334 OGRErr Update(OGRLayer *pLayerMethod, OGRLayer *pLayerResult,
335 char **papszOptions =
nullptr,
336 GDALProgressFunc pfnProgress =
nullptr,
337 void *pProgressArg =
nullptr);
338 OGRErr Clip(OGRLayer *pLayerMethod, OGRLayer *pLayerResult,
339 char **papszOptions =
nullptr,
340 GDALProgressFunc pfnProgress =
nullptr,
341 void *pProgressArg =
nullptr);
342 OGRErr Erase(OGRLayer *pLayerMethod, OGRLayer *pLayerResult,
343 char **papszOptions =
nullptr,
344 GDALProgressFunc pfnProgress =
nullptr,
345 void *pProgressArg =
nullptr);
358 int AttributeFilterEvaluationNeedsGeometry();
361 OGRErr InitializeIndexSupport(const
char *);
363 OGRLayerAttrIndex *GetIndex()
365 return m_poAttrIndex;
368 int GetGeomFieldFilter()
const
370 return m_iGeomFieldFilter;
373 const char *GetAttrQueryString()
const
375 return m_pszAttrQueryString;
384 return reinterpret_cast<OGRLayerH>(poLayer);
391 return reinterpret_cast<OGRLayer *
>(hLayer);
395 bool FilterWKBGeometry(
const GByte *pabyWKB,
size_t nWKBSize,
396 bool bEnvelopeAlreadySet,
399 static bool FilterWKBGeometry(
const GByte *pabyWKB,
size_t nWKBSize,
400 bool bEnvelopeAlreadySet,
403 bool bFilterIsEnvelope,
405 OGRPreparedGeometry *&poPreparedFilterGeom);
421 enum class FieldChangeType :
char
429 template <
typename T>
struct FieldDefnChange
432 FieldDefnChange(std::unique_ptr<T> &&poFieldDefnIn,
int iFieldIn,
433 FieldChangeType eChangeTypeIn,
434 const std::string &osSavepointNameIn =
"")
435 : poFieldDefn(std::move(poFieldDefnIn)), iField(iFieldIn),
436 eChangeType(eChangeTypeIn), osSavepointName(osSavepointNameIn)
440 std::unique_ptr<T> poFieldDefn;
442 FieldChangeType eChangeType;
443 std::string osSavepointName;
446 std::vector<FieldDefnChange<OGRFieldDefn>> m_apoFieldDefnChanges{};
447 std::vector<FieldDefnChange<OGRGeomFieldDefn>> m_apoGeomFieldDefnChanges{};
449 OGRStyleTable *m_poStyleTable;
450 OGRFeatureQuery *m_poAttrQuery;
451 char *m_pszAttrQueryString;
452 OGRLayerAttrIndex *m_poAttrIndex;
470inline OGRLayer::FeatureIterator
begin(OGRLayer *poLayer)
472 return poLayer->
begin();
478inline OGRLayer::FeatureIterator
end(OGRLayer *poLayer)
480 return poLayer->
end();
510 const auto poThis =
static_cast<BaseLayer *
>(
this);
513 OGRFeature *poFeature = poThis->GetNextRawFeature();
514 if (poFeature ==
nullptr)
517 if ((poThis->m_poFilterGeom ==
nullptr ||
519 (poThis->m_poAttrQuery ==
nullptr ||
520 poThis->m_poAttrQuery->Evaluate(poFeature)))
531#define DEFINE_GET_NEXT_FEATURE_THROUGH_RAW(BaseLayer) \
533 friend class OGRGetNextFeatureThroughRaw<BaseLayer>; \
536 OGRFeature *GetNextFeature() override \
538 return OGRGetNextFeatureThroughRaw<BaseLayer>::GetNextFeature(); \
568 ~OGRDataSource()
override;
571 virtual const char *GetName()
572 OGR_DEPRECATED(
"Use GDALDataset class instead") = 0;
574 static void DestroyDataSource(OGRDataSource *)
575 OGR_DEPRECATED(
"Use GDALDataset class instead");
607 virtual const char *GetName()
608 OGR_DEPRECATED(
"Use GDALDriver class instead") = 0;
610 virtual OGRDataSource *Open(
const char *pszName,
int bUpdate = FALSE)
611 OGR_DEPRECATED(
"Use GDALDriver class instead") = 0;
613 virtual int TestCapability(
const char *pszCap)
614 OGR_DEPRECATED(
"Use GDALDriver class instead") = 0;
618 OGR_DEPRECATED(
"Use GDALDriver class instead");
619 virtual OGRErr DeleteDataSource(
const char *pszName)
620 OGR_DEPRECATED(
"Use GDALDriver class instead");
641class CPL_DLL OGRSFDriverRegistrar
644 OGRSFDriverRegistrar();
645 ~OGRSFDriverRegistrar();
651 char **papszOptions);
656 static OGRSFDriverRegistrar *GetRegistrar()
657 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
659 CPPCHECK_STATIC
void RegisterDriver(
OGRSFDriver *poDriver)
660 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
662 CPPCHECK_STATIC
int GetDriverCount(
void)
663 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
665 CPPCHECK_STATIC
GDALDriver *GetDriver(
int iDriver)
666 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
668 CPPCHECK_STATIC
GDALDriver *GetDriverByName(
const char *)
669 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
671 CPPCHECK_STATIC
int GetOpenDSCount()
672 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
675 OGR_DEPRECATED(
"Use GDALDriverManager class instead");
685void OGRRegisterAllInternal();
687void CPL_DLL RegisterOGRFileGDB();
688void DeclareDeferredOGRFileGDBPlugin();
689void CPL_DLL RegisterOGRShape();
690void CPL_DLL RegisterOGRS57();
691void CPL_DLL RegisterOGRTAB();
692void CPL_DLL RegisterOGRMIF();
693void CPL_DLL RegisterOGRODBC();
694void DeclareDeferredOGRODBCPlugin();
695void CPL_DLL RegisterOGRWAsP();
696void CPL_DLL RegisterOGRPG();
697void DeclareDeferredOGRPGPlugin();
698void CPL_DLL RegisterOGRMSSQLSpatial();
699void DeclareDeferredOGRMSSQLSpatialPlugin();
700void CPL_DLL RegisterOGRMySQL();
701void DeclareDeferredOGRMySQLPlugin();
702void CPL_DLL RegisterOGROCI();
703void DeclareDeferredOGROCIPlugin();
704void CPL_DLL RegisterOGRDGN();
705void CPL_DLL RegisterOGRGML();
706void CPL_DLL RegisterOGRLIBKML();
707void DeclareDeferredOGRLIBKMLPlugin();
708void CPL_DLL RegisterOGRKML();
709void CPL_DLL RegisterOGRFlatGeobuf();
710void CPL_DLL RegisterOGRGeoJSON();
711void CPL_DLL RegisterOGRGeoJSONSeq();
712void CPL_DLL RegisterOGRESRIJSON();
713void CPL_DLL RegisterOGRTopoJSON();
714void CPL_DLL RegisterOGRAVCBin();
715void CPL_DLL RegisterOGRAVCE00();
716void CPL_DLL RegisterOGRVRT();
717void CPL_DLL RegisterOGRSQLite();
718void CPL_DLL RegisterOGRCSV();
719void CPL_DLL RegisterOGRILI1();
720void CPL_DLL RegisterOGRILI2();
721void CPL_DLL RegisterOGRPGeo();
722void CPL_DLL RegisterOGRDXF();
723void CPL_DLL RegisterOGRCAD();
724void DeclareDeferredOGRCADPlugin();
725void CPL_DLL RegisterOGRDWG();
726void CPL_DLL RegisterOGRDGNV8();
727void DeclareDeferredOGRDWGPlugin();
728void DeclareDeferredOGRDGNV8Plugin();
729void CPL_DLL RegisterOGRIDB();
730void DeclareDeferredOGRIDBPlugin();
731void CPL_DLL RegisterOGRGMT();
732void CPL_DLL RegisterOGRGPX();
733void CPL_DLL RegisterOGRNAS();
734void CPL_DLL RegisterOGRGeoRSS();
735void CPL_DLL RegisterOGRVFK();
736void DeclareDeferredOGRVFKPlugin();
737void CPL_DLL RegisterOGRPGDump();
738void CPL_DLL RegisterOGROSM();
739void CPL_DLL RegisterOGRGPSBabel();
740void CPL_DLL RegisterOGRPDS();
741void CPL_DLL RegisterOGRWFS();
742void CPL_DLL RegisterOGROAPIF();
743void CPL_DLL RegisterOGRSOSI();
744void DeclareDeferredOGRSOSIPlugin();
745void CPL_DLL RegisterOGREDIGEO();
746void CPL_DLL RegisterOGRIdrisi();
747void CPL_DLL RegisterOGRXLS();
748void DeclareDeferredOGRXLSPlugin();
749void CPL_DLL RegisterOGRODS();
750void CPL_DLL RegisterOGRXLSX();
751void CPL_DLL RegisterOGRElastic();
752void DeclareDeferredOGRElasticPlugin();
753void CPL_DLL RegisterOGRGeoPackage();
754void CPL_DLL RegisterOGRCarto();
755void DeclareDeferredOGRCartoPlugin();
756void CPL_DLL RegisterOGRAmigoCloud();
757void CPL_DLL RegisterOGRSXF();
758void CPL_DLL RegisterOGROpenFileGDB();
759void DeclareDeferredOGROpenFileGDBPlugin();
760void CPL_DLL RegisterOGRSelafin();
761void CPL_DLL RegisterOGRJML();
762void CPL_DLL RegisterOGRPLSCENES();
763void DeclareDeferredOGRPLSCENESPlugin();
764void CPL_DLL RegisterOGRCSW();
765void CPL_DLL RegisterOGRMongoDBv3();
766void DeclareDeferredOGRMongoDBv3Plugin();
767void CPL_DLL RegisterOGRVDV();
768void CPL_DLL RegisterOGRGMLAS();
769void DeclareDeferredOGRGMLASPlugin();
770void CPL_DLL RegisterOGRMVT();
771void CPL_DLL RegisterOGRNGW();
772void CPL_DLL RegisterOGRMapML();
773void CPL_DLL RegisterOGRLVBAG();
774void CPL_DLL RegisterOGRHANA();
775void DeclareDeferredOGRHANAPlugin();
776void CPL_DLL RegisterOGRParquet();
777void DeclareDeferredOGRParquetPlugin();
778void CPL_DLL RegisterOGRArrow();
779void DeclareDeferredOGRArrowPlugin();
780void CPL_DLL RegisterOGRGTFS();
781void CPL_DLL RegisterOGRPMTiles();
782void CPL_DLL RegisterOGRJSONFG();
783void CPL_DLL RegisterOGRMiraMon();
784void CPL_DLL RegisterOGRXODR();
785void DeclareDeferredOGRXODRPlugin();
786void CPL_DLL RegisterOGRADBC();
787void DeclareDeferredOGRADBCPlugin();
788void CPL_DLL RegisterOGRAIVector();
String list class designed around our use of C "char**" string lists.
Definition cpl_string.h:454
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:76
Format specific driver.
Definition gdal_driver.h:63
GDALMajorObject(const GDALMajorObject &)=default
Copy constructor.
Class for dataset open functions.
Definition gdal_openinfo.h:28
LEGACY class.
Definition ogrsf_frmts.h:565
Simple container for a bounding region in 3D.
Definition ogr_core.h:199
Simple container for a bounding region (rectangle).
Definition ogr_core.h:44
Definition of a feature class or feature layer.
Definition ogr_feature.h:504
A simple feature, including geometry and attributes.
Definition ogr_feature.h:934
OGRGeometry * GetGeometryRef()
Fetch pointer to feature geometry.
Definition ogrfeature.cpp:737
Definition of an attribute of an OGRFeatureDefn.
Definition ogr_feature.h:69
Definition of a geometry field of an OGRFeatureDefn.
Definition ogr_feature.h:332
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:501
OGRFeature * GetNextFeature()
Implement OGRLayer::GetNextFeature(), relying on BaseLayer::GetNextRawFeature().
Definition ogrsf_frmts.h:508
virtual OGRErr ISetSpatialFilter(int iGeomField, const OGRGeometry *)
Set a new spatial filter.
Definition ogrlayer.cpp:3398
OGRErr UpsertFeature(OGRFeature *poFeature)
Rewrite/replace an existing feature or create a new feature within a layer.
Definition ogrlayer.cpp:1533
friend FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:470
virtual OGRErr IGetExtent3D(int iGeomField, OGREnvelope3D *psExtent3D, bool bForce)
Fetch the 3D extent of this layer, on the specified geometry field.
Definition ogrlayer.cpp:613
virtual OGRErr SetActiveSRS(int iGeomField, const OGRSpatialReference *poSRS)
Change the active SRS.
Definition ogrlayer.cpp:8286
int Dereference()
Decrement layer reference count.
Definition ogrlayer.cpp:130
virtual OGRErr DeleteFeature(GIntBig nFID)
Delete feature from layer.
Definition ogrlayer.cpp:4338
OGRErr Erase(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Remove areas that are covered by the method layer.
Definition ogrlayer.cpp:7665
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable)
Set layer style table.
Definition ogrlayer.cpp:4536
virtual OGRErr StartTransaction()
For datasources which support transactions, StartTransaction creates a transaction.
Definition ogrlayer.cpp:2600
virtual const GetSupportedSRSListRetType & GetSupportedSRSList(int iGeomField)
Get the list of SRS supported.
Definition ogrlayer.cpp:8205
virtual GIntBig GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition ogrlayer.cpp:205
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:723
virtual void SetStyleTable(OGRStyleTable *poStyleTable)
Set layer style table.
Definition ogrlayer.cpp:4558
OGRErr Identity(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Identify the features of this layer with the ones from the identity layer.
Definition ogrlayer.cpp:6589
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:1748
virtual OGRErr IUpsertFeature(OGRFeature *poFeature)
Rewrite/replace an existing feature or create a new feature within a layer.
Definition ogrlayer.cpp:1562
virtual bool GetArrowStream(struct ArrowArrayStream *out_stream, CSLConstList papszOptions=nullptr)
Get a Arrow C stream.
Definition ogrlayerarrow.cpp:2584
virtual OGRErr ICreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition ogrlayer.cpp:1462
virtual OGRErr AlterGeomFieldDefn(int iGeomField, const OGRGeomFieldDefn *poNewGeomFieldDefn, int nFlagsIn)
Alter the definition of an existing geometry field on a layer.
Definition ogrlayer.cpp:2415
OGRErr Intersection(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Intersection of two layers.
Definition ogrlayer.cpp:5204
virtual GDALDataset * GetDataset()
Return the dataset associated with this layer.
Definition ogrlayer.cpp:8353
OGRErr GetExtent3D(int iGeomField, OGREnvelope3D *psExtent, bool bForce=true)
Fetch the 3D extent of this layer, on the specified geometry field.
Definition ogrlayer.cpp:560
virtual OGRErr ISetFeature(OGRFeature *poFeature)
Rewrite/replace an existing feature.
Definition ogrlayer.cpp:1343
virtual const char * GetName() const
Return the layer name.
Definition ogrlayer.cpp:4625
static void ReleaseStream(struct ArrowArrayStream *stream)
Release a ArrowArrayStream.
Definition ogrlayerarrow.cpp:2410
virtual int GetNextArrowArray(struct ArrowArrayStream *, struct ArrowArray *out_array)
Default implementation of the ArrowArrayStream::get_next() callback.
Definition ogrlayerarrow.cpp:1936
OGRErr SetFeature(OGRFeature *poFeature)
Rewrite/replace an existing feature.
Definition ogrlayer.cpp:1315
virtual OGRErr CreateField(const OGRFieldDefn *poField, int bApproxOK=TRUE)
Create a new field on a layer.
Definition ogrlayer.cpp:1898
OGRErr Update(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Update this layer with features from the update layer.
Definition ogrlayer.cpp:7007
virtual const char * GetGeometryColumn() const
This method returns the name of the underlying database column being used as the geometry column,...
Definition ogrlayer.cpp:4463
virtual OGRErr CommitTransaction()
For datasources which support transactions, CommitTransaction commits a transaction.
Definition ogrlayer.cpp:2659
static OGRLayerH ToHandle(OGRLayer *poLayer)
Convert a OGRLayer* to a OGRLayerH.
Definition ogrsf_frmts.h:382
std::vector< std::unique_ptr< OGRSpatialReference, OGRSpatialReferenceReleaser > > GetSupportedSRSListRetType
Return type of OGRLayer::GetSupportedSRSList().
Definition ogrsf_frmts.h:258
virtual OGRErr IGetExtent(int iGeomField, OGREnvelope *psExtent, bool bForce)
Fetch the extent of this layer, on the specified geometry field.
Definition ogrlayer.cpp:377
virtual OGRGeometryTypeCounter * GetGeometryTypes(int iGeomField, int nFlagsGGT, int &nEntryCountOut, GDALProgressFunc pfnProgress, void *pProgressData)
Get actual geometry types found in features.
Definition ogrlayer.cpp:8049
friend FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:478
OGRErr SymDifference(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Symmetrical difference of two layers.
Definition ogrlayer.cpp:6159
static void ReleaseArray(struct ArrowArray *array)
Release a ArrowArray.
Definition ogrlayerarrow.cpp:884
OGRErr Clip(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Clip off areas that are not covered by the method layer.
Definition ogrlayer.cpp:7356
virtual OGRErr CreateGeomField(const OGRGeomFieldDefn *poField, int bApproxOK=TRUE)
Create a new geometry field on a layer.
Definition ogrlayer.cpp:2518
OGRErr GetExtent(OGREnvelope *psExtent, bool bForce=true)
Fetch the extent of this layer.
Definition ogrlayer.cpp:295
virtual bool CreateFieldFromArrowSchema(const struct ArrowSchema *schema, CSLConstList papszOptions=nullptr)
Creates a field from an ArrowSchema.
Definition ogrlayerarrow.cpp:6421
virtual void ResetReading()=0
Reset feature reading to start on the first feature.
OGRErr CreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition ogrlayer.cpp:1432
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:6003
virtual OGRErr DeleteField(int iField)
Delete an existing field on a layer.
Definition ogrlayer.cpp:1989
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:4764
virtual OGRErr RollbackTransaction()
For datasources which support transactions, RollbackTransaction will roll back a datasource to its st...
Definition ogrlayer.cpp:2734
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:5258
OGRErr ReorderField(int iOldFieldPos, int iNewFieldPos)
Reorder an existing field on a layer.
Definition ogrlayer.cpp:2175
virtual OGRwkbGeometryType GetGeomType() const
Return the layer geometry type.
Definition ogrlayer.cpp:4688
virtual const char * GetFIDColumn() const
This method returns the name of the underlying database column being used as the FID column,...
Definition ogrlayer.cpp:4415
virtual OGRErr SetNextByIndex(GIntBig nIndex)
Move read cursor to the nIndex'th feature in the current resultset.
Definition ogrlayer.cpp:1033
OGRErr SetSpatialFilter(const OGRGeometry *)
Set a new spatial filter.
Definition ogrlayer.cpp:3312
virtual OGRStyleTable * GetStyleTable()
Returns layer style table.
Definition ogrlayer.cpp:4516
virtual OGRErr SetAttributeFilter(const char *)
Set a new attribute query.
Definition ogrlayer.cpp:751
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:918
static int StaticGetArrowSchema(struct ArrowArrayStream *, struct ArrowSchema *out_schema)
Default implementation of the ArrowArrayStream::get_schema() callback.
Definition ogrlayerarrow.cpp:826
static void ReleaseSchema(struct ArrowSchema *schema)
Release a ArrowSchema.
Definition ogrlayerarrow.cpp:313
virtual int GetArrowSchema(struct ArrowArrayStream *, struct ArrowSchema *out_schema)
Default implementation of the ArrowArrayStream::get_schema() callback.
Definition ogrlayerarrow.cpp:377
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:1675
virtual bool WriteArrowBatch(const struct ArrowSchema *schema, struct ArrowArray *array, CSLConstList papszOptions=nullptr)
Writes a batch of rows from an ArrowArray.
Definition ogrlayerarrow.cpp:7648
static const char * GetLastErrorArrowArrayStream(struct ArrowArrayStream *)
Default implementation of the ArrowArrayStream::get_last_error() callback.
Definition ogrlayerarrow.cpp:2436
virtual OGRGeometry * GetSpatialFilter()
This method returns the current spatial filter for this layer.
Definition ogrlayer.cpp:3200
virtual OGRErr Rename(const char *pszNewName)
Rename layer.
Definition ogrlayer.cpp:4870
OGRErr Union(OGRLayer *pLayerMethod, OGRLayer *pLayerResult, char **papszOptions=nullptr, GDALProgressFunc pfnProgress=nullptr, void *pProgressArg=nullptr)
Union of two layers.
Definition ogrlayer.cpp:5622
int GetRefCount() const
Fetch reference count.
Definition ogrlayer.cpp:160
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:416
virtual OGRFeature * GetNextFeature()=0
Fetch the next available feature from this layer.
int Reference()
Increment layer reference count.
Definition ogrlayer.cpp:100
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:411
virtual OGRErr SyncToDisk()
Flush pending changes to disk.
Definition ogrlayer.cpp:4271
virtual OGRErr ReorderFields(int *panMap)
Reorder all the fields of a layer.
Definition ogrlayer.cpp:2079
static int StaticGetNextArrowArray(struct ArrowArrayStream *, struct ArrowArray *out_array)
Default implementation of the ArrowArrayStream::get_next() callback.
Definition ogrlayerarrow.cpp:2383
static OGRLayer * FromHandle(OGRLayerH hLayer)
Convert a OGRLayerH to a OGRLayer*.
Definition ogrsf_frmts.h:389
virtual OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn, int nFlagsIn)
Alter the definition of an existing field on a layer.
Definition ogrlayer.cpp:2312
OGRErr SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
Set a new rectangular spatial filter.
Definition ogrlayer.cpp:3544
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:3022
LEGACY class.
Definition ogrsf_frmts.h:602
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.
Definition cpl_error.h:37
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
#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
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition cpl_port.h:870
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:205
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:405
int OGRErr
Type for a OGR error.
Definition ogr_core.h:370
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition ogr_feature.h:1604
Simple feature style classes.
std::unique_ptr< OGRLayer > OGRLayerUniquePtr
Unique pointer type for OGRLayer.
Definition ogrsf_frmts.h:486
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition ogrsf_frmts.h:470
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition ogrsf_frmts.h:478
Result item of OGR_L_GetGeometryTypes.
Definition ogr_api.h:622