QGIS API Documentation
2.6.0-Brighton
|
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 () | |
void | setFileName (const QString &dbFileName) |
QString | filename () const |
bool | isOpen () const |
bool | open () |
bool | close () |
QString | errorString () const |
int | countNodes () const |
int | countWays () const |
QgsOSMNodeIterator | listNodes () const |
QgsOSMWayIterator | listWays () const |
QgsOSMNode | node (QgsOSMId id) const |
QgsOSMWay | way (QgsOSMId id) const |
QgsOSMTags | tags (bool way, QgsOSMId id) const |
QList< QgsOSMTagCountPair > | usedTags (bool ways) const |
QgsPolyline | wayPoints (QgsOSMId id) const |
bool | exportSpatiaLite (ExportType type, const QString &tableName, const QStringList &tagKeys=QStringList()) |
Protected Member Functions | |
bool | prepareStatements () |
int | runCountStatement (const char *sql) const |
void | deleteStatement (sqlite3_stmt *&stmt) |
void | exportSpatiaLiteNodes (const QString &tableName, const QStringList &tagKeys) |
void | exportSpatiaLiteWays (bool closed, const QString &tableName, const QStringList &tagKeys) |
bool | createSpatialTable (const QString &tableName, const QString &geometryType, const QStringList &tagKeys) |
bool | createSpatialIndex (const QString &tableName) |
QString | quotedIdentifier (QString id) |
QString | quotedValue (QString value) |
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.
|
explicit |
QgsOSMDatabase::~QgsOSMDatabase | ( | ) |
bool QgsOSMDatabase::close | ( | ) |
int QgsOSMDatabase::countNodes | ( | ) | const |
int QgsOSMDatabase::countWays | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
inline |
bool QgsOSMDatabase::exportSpatiaLite | ( | ExportType | type, |
const QString & | tableName, | ||
const QStringList & | tagKeys = QStringList() |
||
) |
|
protected |
|
protected |
|
inline |
bool QgsOSMDatabase::isOpen | ( | ) | const |
QgsOSMNodeIterator QgsOSMDatabase::listNodes | ( | ) | const |
QgsOSMWayIterator QgsOSMDatabase::listWays | ( | ) | const |
QgsOSMNode QgsOSMDatabase::node | ( | QgsOSMId | id | ) | const |
bool QgsOSMDatabase::open | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
QgsOSMTags QgsOSMDatabase::tags | ( | bool | way, |
QgsOSMId | id | ||
) | const |
QList< QgsOSMTagCountPair > QgsOSMDatabase::usedTags | ( | bool | ways | ) | const |
QgsPolyline QgsOSMDatabase::wayPoints | ( | QgsOSMId | id | ) | const |