QGIS API Documentation
2.8.2-Wien
|
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()) |
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) |
void | exportSpatiaLiteWays (bool closed, const QString &tableName, const QStringList &tagKeys) |
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.
Definition at line 81 of file qgsosmdatabase.h.
|
explicit |
Definition at line 25 of file qgsosmdatabase.cpp.
QgsOSMDatabase::~QgsOSMDatabase | ( | ) |
Definition at line 38 of file qgsosmdatabase.cpp.
bool QgsOSMDatabase::close | ( | ) |
Definition at line 84 of file qgsosmdatabase.cpp.
int QgsOSMDatabase::countNodes | ( | ) | const |
Definition at line 123 of file qgsosmdatabase.cpp.
int QgsOSMDatabase::countWays | ( | ) | const |
Definition at line 128 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 372 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 341 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 74 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() |
||
) |
Definition at line 302 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 388 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 443 of file qgsosmdatabase.cpp.
|
inline |
Definition at line 53 of file qgsosmdatabase.h.
bool QgsOSMDatabase::isOpen | ( | ) | const |
Definition at line 44 of file qgsosmdatabase.cpp.
QgsOSMNodeIterator QgsOSMDatabase::listNodes | ( | ) | const |
Definition at line 134 of file qgsosmdatabase.cpp.
QgsOSMWayIterator QgsOSMDatabase::listWays | ( | ) | const |
Definition at line 139 of file qgsosmdatabase.cpp.
QgsOSMNode QgsOSMDatabase::node | ( | QgsOSMId | id | ) | const |
Definition at line 145 of file qgsosmdatabase.cpp.
bool QgsOSMDatabase::open | ( | ) |
Definition at line 50 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 263 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 516 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 522 of file qgsosmdatabase.cpp.
|
protected |
Definition at line 106 of file qgsosmdatabase.cpp.
|
inline |
Definition at line 52 of file qgsosmdatabase.h.
QgsOSMTags QgsOSMDatabase::tags | ( | bool | way, |
QgsOSMId | id | ||
) | const |
Definition at line 166 of file qgsosmdatabase.cpp.
QList< QgsOSMTagCountPair > QgsOSMDatabase::usedTags | ( | bool | ways | ) | const |
Definition at line 186 of file qgsosmdatabase.cpp.
Definition at line 209 of file qgsosmdatabase.cpp.
QgsPolyline QgsOSMDatabase::wayPoints | ( | QgsOSMId | id | ) | const |
Definition at line 241 of file qgsosmdatabase.cpp.