QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
Class that encapsulates access to OpenStreetMap data stored in a database previously imported from XML file. More...
#include <qgsosmdatabase.h>
Public Types | |
enum | ExportType { Point, Polyline, Polygon } |
Public Member Functions | |
QgsOSMDatabase (const QString &dbFileName=QString()) | |
~QgsOSMDatabase () | |
bool | close () |
int | countNodes () const |
int | countWays () const |
QString | errorString () const |
bool | exportSpatiaLite (ExportType type, const QString &tableName, const QStringList &tagKeys=QStringList(), const QStringList &noNullTagKeys=QStringList()) |
QString | filename () const |
bool | isOpen () const |
QgsOSMNodeIterator | listNodes () const |
QgsOSMWayIterator | listWays () const |
QgsOSMNode | node (QgsOSMId id) const |
bool | open () |
void | setFileName (const QString &dbFileName) |
QgsOSMTags | tags (bool way, QgsOSMId id) const |
QList< QgsOSMTagCountPair > | usedTags (bool ways) const |
QgsOSMWay | way (QgsOSMId id) const |
QgsPolyline | wayPoints (QgsOSMId id) const |
Protected Member Functions | |
bool | createSpatialIndex (const QString &tableName) |
bool | createSpatialTable (const QString &tableName, const QString &geometryType, const QStringList &tagKeys) |
void | deleteStatement (sqlite3_stmt *&stmt) |
void | exportSpatiaLiteNodes (const QString &tableName, const QStringList &tagKeys, const QStringList ¬NullTagKeys=QStringList()) |
void | exportSpatiaLiteWays (bool closed, const QString &tableName, const QStringList &tagKeys, const QStringList ¬NullTagKeys=QStringList()) |
bool | prepareStatements () |
QString | quotedIdentifier (QString id) |
QString | quotedValue (QString value) |
int | runCountStatement (const char *sql) const |
Class that encapsulates access to OpenStreetMap data stored in a database previously imported from XML file.
Internal database structure consists of the following tables:
The topology representation can be translated to simple features representation using exportSpatiaLite() method into SpatiaLite layers (tables). These can be easily used in QGIS like any other layers.
Definition at line 46 of file qgsosmdatabase.h.
Enumerator | |
---|---|
Point | |
Polyline | |
Polygon |
Definition at line 85 of file qgsosmdatabase.h.
Definition at line 22 of file qgsosmdatabase.cpp.
QgsOSMDatabase::~QgsOSMDatabase | ( | ) |
Definition at line 34 of file qgsosmdatabase.cpp.
bool QgsOSMDatabase::close | ( | ) |
Definition at line 77 of file qgsosmdatabase.cpp.
int QgsOSMDatabase::countNodes | ( | ) | const |
Definition at line 116 of file qgsosmdatabase.cpp.
int QgsOSMDatabase::countWays | ( | ) | const |
Definition at line 121 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 365 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 334 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 67 of file qgsosmdatabase.cpp.
|
inline |
Definition at line 59 of file qgsosmdatabase.h.
bool QgsOSMDatabase::exportSpatiaLite | ( | ExportType | type, |
const QString & | tableName, | ||
const QStringList & | tagKeys = QStringList() , |
||
const QStringList & | noNullTagKeys = QStringList() |
||
) |
Definition at line 293 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 381 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 445 of file qgsosmdatabase.cpp.
|
inline |
Definition at line 53 of file qgsosmdatabase.h.
bool QgsOSMDatabase::isOpen | ( | ) | const |
Definition at line 40 of file qgsosmdatabase.cpp.
QgsOSMNodeIterator QgsOSMDatabase::listNodes | ( | ) | const |
Definition at line 127 of file qgsosmdatabase.cpp.
QgsOSMWayIterator QgsOSMDatabase::listWays | ( | ) | const |
Definition at line 132 of file qgsosmdatabase.cpp.
QgsOSMNode QgsOSMDatabase::node | ( | QgsOSMId | id | ) | const |
Definition at line 138 of file qgsosmdatabase.cpp.
bool QgsOSMDatabase::open | ( | ) |
Definition at line 46 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 256 of file qgsosmdatabase.cpp.
Definition at line 531 of file qgsosmdatabase.cpp.
Definition at line 537 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 99 of file qgsosmdatabase.cpp.
|
inline |
Definition at line 52 of file qgsosmdatabase.h.
QgsOSMTags QgsOSMDatabase::tags | ( | bool | way, |
QgsOSMId | id | ||
) | const |
Definition at line 159 of file qgsosmdatabase.cpp.
QList< QgsOSMTagCountPair > QgsOSMDatabase::usedTags | ( | bool | ways | ) | const |
Definition at line 179 of file qgsosmdatabase.cpp.
Definition at line 202 of file qgsosmdatabase.cpp.
QgsPolyline QgsOSMDatabase::wayPoints | ( | QgsOSMId | id | ) | const |
Definition at line 234 of file qgsosmdatabase.cpp.