QGIS API Documentation
3.0.2-Girona (307d082)
|
Utilities for working with OGR features and layers. More...
#include <qgsogrutils.h>
Static Public Member Functions | |
static QVariant | getOgrFeatureAttribute (OGRFeatureH ogrFet, const QgsFields &fields, int attIndex, QTextCodec *encoding, bool *ok=nullptr) |
Retrieves an attribute value from an OGR feature. More... | |
static QgsGeometry | ogrGeometryToQgsGeometry (OGRGeometryH geom) |
Converts an OGR geometry representation to a QgsGeometry object. More... | |
static QgsFeature | readOgrFeature (OGRFeatureH ogrFet, const QgsFields &fields, QTextCodec *encoding) |
Reads an OGR feature and converts it to a QgsFeature. More... | |
static bool | readOgrFeatureAttributes (OGRFeatureH ogrFet, const QgsFields &fields, QgsFeature &feature, QTextCodec *encoding) |
Reads all attributes from an OGR feature into a QgsFeature. More... | |
static bool | readOgrFeatureGeometry (OGRFeatureH ogrFet, QgsFeature &feature) |
Reads the geometry from an OGR feature into a QgsFeature. More... | |
static QgsFields | readOgrFields (OGRFeatureH ogrFet, QTextCodec *encoding) |
Reads an OGR feature and returns a corresponding fields collection. More... | |
static QgsFeatureList | stringToFeatureList (const QString &string, const QgsFields &fields, QTextCodec *encoding) |
Attempts to parse a string representing a collection of features using OGR. More... | |
static QgsFields | stringToFields (const QString &string, QTextCodec *encoding) |
Attempts to retrieve the fields from a string representing a collection of features using OGR. More... | |
Utilities for working with OGR features and layers.
Contains helper utilities for assisting work with both OGR features and layers.
Definition at line 161 of file qgsogrutils.h.
|
static |
Retrieves an attribute value from an OGR feature.
ogrFet | OGR feature handle |
fields | fields collection corresponding to feature |
attIndex | index of attribute to retrieve |
encoding | text encoding |
ok | optional storage for success of retrieval |
Definition at line 161 of file qgsogrutils.cpp.
|
static |
Converts an OGR geometry representation to a QgsGeometry object.
geom | OGR geometry handle |
Definition at line 272 of file qgsogrutils.cpp.
|
static |
Reads an OGR feature and converts it to a QgsFeature.
ogrFet | OGR feature handle |
fields | fields collection corresponding to feature |
encoding | text encoding |
Definition at line 85 of file qgsogrutils.cpp.
|
static |
Reads all attributes from an OGR feature into a QgsFeature.
ogrFet | OGR feature handle |
fields | fields collection corresponding to feature |
feature | QgsFeature to store attributes in |
encoding | text encoding |
Definition at line 237 of file qgsogrutils.cpp.
|
static |
Reads the geometry from an OGR feature into a QgsFeature.
ogrFet | OGR feature handle |
feature | QgsFeature to store geometry in |
Definition at line 258 of file qgsogrutils.cpp.
|
static |
Reads an OGR feature and returns a corresponding fields collection.
ogrFet | OGR feature handle |
encoding | text encoding |
Definition at line 110 of file qgsogrutils.cpp.
|
static |
Attempts to parse a string representing a collection of features using OGR.
For example, this method can be used to convert a GeoJSON encoded collection to a list of QgsFeatures.
string | string to parse |
fields | fields collection to use for parsed features ( |
encoding | text encoding |
Definition at line 345 of file qgsogrutils.cpp.
|
static |
Attempts to retrieve the fields from a string representing a collection of features using OGR.
string | string to parse |
encoding | text encoding |
Definition at line 387 of file qgsogrutils.cpp.