27#include <gdalwarper.h>
29#include "cpl_string.h"
49 void CORE_EXPORT
operator()( OGRDataSourceH source )
const;
62 void CORE_EXPORT
operator()( OGRGeometryH geometry )
const;
75 void CORE_EXPORT
operator()( OGRFieldDefnH definition )
const;
88 void CORE_EXPORT
operator()( OGRFeatureH feature )
const;
114 void CORE_EXPORT
operator()( GDALWarpOptions *options )
const;
118#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,6,0)
129 void CORE_EXPORT
operator()( GDALRelationshipH relationship )
const;
174#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,6,0)
200 static QVariant OGRFieldtoVariant(
const OGRField *value, OGRFieldType type );
207 static std::unique_ptr<OGRField> variantToOGRField(
const QVariant &value );
214 static int OGRTZFlagFromQt(
const QDateTime &datetime );
223 static QgsFeature readOgrFeature( OGRFeatureH ogrFet,
const QgsFields &fields, QTextCodec *encoding );
231 static QgsFields readOgrFields( OGRFeatureH ogrFet, QTextCodec *encoding );
243 static QVariant getOgrFeatureAttribute( OGRFeatureH ogrFet,
const QgsFields &fields,
int attIndex, QTextCodec *encoding,
bool *ok =
nullptr );
257 static QVariant getOgrFeatureAttribute( OGRFeatureH ogrFet,
const QgsField &
field,
int attIndex, QTextCodec *encoding,
bool *ok =
nullptr );
268 static bool readOgrFeatureAttributes( OGRFeatureH ogrFet,
const QgsFields &fields,
QgsFeature &feature, QTextCodec *encoding );
278 static bool readOgrFeatureGeometry( OGRFeatureH ogrFet,
QgsFeature &feature );
287 static QgsGeometry ogrGeometryToQgsGeometry( OGRGeometryH geom );
298 static QgsFeatureList stringToFeatureList(
const QString &
string,
const QgsFields &fields, QTextCodec *encoding );
307 static QgsFields stringToFields(
const QString &
string, QTextCodec *encoding );
314 static QStringList cStringListToQStringList(
char **stringList );
321 static Qgis::WkbType ogrGeometryTypeToQgsWkbType( OGRwkbGeometryType ogrGeomType );
360 static QString readShapefileEncoding(
const QString &path );
371 static QString readShapefileEncodingFromCpg(
const QString &path );
382 static QString readShapefileEncodingFromLdid(
const QString &path );
389 static QVariantMap parseStyleString(
const QString &
string );
409 static void ogrFieldTypeToQVariantType( OGRFieldType ogrType, OGRFieldSubType ogrSubType, QVariant::Type &variantType, QVariant::Type &variantSubType )
SIP_SKIP;
421 static void variantTypeToOgrFieldType( QVariant::Type variantType, OGRFieldType &ogrType, OGRFieldSubType &ogrSubType )
SIP_SKIP;
430 static QVariant stringToVariant( OGRFieldType type, OGRFieldSubType subType,
const QString &
string )
SIP_SKIP;
437 static QList<QgsVectorDataProvider::NativeType> nativeFieldTypesForDriver( GDALDriverH driver )
SIP_SKIP;
440#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,3,0)
449 static std::unique_ptr< QgsFieldDomain > convertFieldDomain( OGRFieldDomainH domain );
458 static OGRFieldDomainH convertFieldDomain(
const QgsFieldDomain *domain );
463#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,6,0)
472 static QgsWeakRelation convertRelationship( GDALRelationshipH relationship,
const QString &datasetUri );
WkbType
The WKB type describes the number of dimensions a geometry has.
This class represents a coordinate reference system (CRS).
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for field domains.
Encapsulate a field in an attribute table or data source.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
Utilities for working with OGR features and layers.
The QgsWeakRelation class represent a QgsRelation with possibly unresolved layers or unmatched fields...
void CORE_EXPORT fast_delete_and_close(dataset_unique_ptr &dataset, GDALDriverH driver, const QString &path)
Performs a fast close of an unwanted GDAL dataset handle by deleting the underlying data store.
std::unique_ptr< std::remove_pointer< OGRFeatureH >::type, OGRFeatureDeleter > ogr_feature_unique_ptr
Scoped OGR feature.
std::unique_ptr< std::remove_pointer< GDALDatasetH >::type, GDALDatasetCloser > dataset_unique_ptr
Scoped GDAL dataset.
std::unique_ptr< std::remove_pointer< OGRDataSourceH >::type, OGRDataSourceDeleter > ogr_datasource_unique_ptr
Scoped OGR data source.
std::unique_ptr< std::remove_pointer< OGRFieldDefnH >::type, OGRFldDeleter > ogr_field_def_unique_ptr
Scoped OGR field definition.
std::unique_ptr< std::remove_pointer< OGRGeometryH >::type, OGRGeometryDeleter > ogr_geometry_unique_ptr
Scoped OGR geometry.
std::unique_ptr< GDALWarpOptions, GDALWarpOptionsDeleter > warp_options_unique_ptr
Scoped GDAL warp options.
std::unique_ptr< std::remove_pointer< GDALRelationshipH >::type, GDALRelationshipDeleter > relationship_unique_ptr
Scoped GDAL relationship.
void * OGRSpatialReferenceH
QList< QgsFeature > QgsFeatureList
const QgsCoordinateReferenceSystem & crs
Closes and cleanups GDAL dataset.
void CORE_EXPORT operator()(GDALDatasetH datasource) const
Destroys an gdal dataset, using the correct gdal calls.
Closes and cleanups GDAL relationship.
void CORE_EXPORT operator()(GDALRelationshipH relationship) const
Destroys GDAL relationship, using the correct gdal calls.
Closes and cleanups GDAL warp options.
void CORE_EXPORT operator()(GDALWarpOptions *options) const
Destroys GDAL warp options, using the correct gdal calls.
Destroys OGR data sources.
void CORE_EXPORT operator()(OGRDataSourceH source) const
Destroys an OGR data source, using the correct gdal calls.
void CORE_EXPORT operator()(OGRFeatureH feature) const
Destroys an OGR feature, using the correct gdal calls.
Destroys OGR field definition.
void CORE_EXPORT operator()(OGRFieldDefnH definition) const
Destroys an OGR field definition, using the correct gdal calls.
void CORE_EXPORT operator()(OGRGeometryH geometry) const
Destroys an OGR geometry, using the correct gdal calls.