QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Signals | Public Member Functions | Protected Member Functions | List of all members
QgsOSMXmlImport Class Reference

The QgsOSMXmlImport class imports OpenStreetMap XML format to our topological representation in a SQLite database (see QgsOSMDatabase for details). More...

#include <qgsosmimport.h>

Signals

void progress (int percent)

Public Member Functions

 QgsOSMXmlImport (const QString &xmlFileName=QString(), const QString &dbFileName=QString())
QString errorString () const
bool hasError () const
bool import ()
 Run import.
QString inputXmlFileName () const
QString outputDbFileName () const
void setInputXmlFileName (const QString &xmlFileName)
void setOutputDbFileName (const QString &dbFileName)

Protected Member Functions

bool closeDatabase ()
bool createDatabase ()
bool createIndexes ()
void deleteStatement (sqlite3_stmt *&stmt)
void readNode (QXmlStreamReader &xml)
void readRoot (QXmlStreamReader &xml)
void readTag (bool way, QgsOSMId id, QXmlStreamReader &xml)
void readWay (QXmlStreamReader &xml)

Detailed Description

The QgsOSMXmlImport class imports OpenStreetMap XML format to our topological representation in a SQLite database (see QgsOSMDatabase for details).

How to use the classs:

  1. set input XML file name and output DB file name (in constructor or with respective functions)
  2. run import()
  3. check errorString() if the import failed

Definition at line 35 of file qgsosmimport.h.

Constructor & Destructor Documentation

QgsOSMXmlImport::QgsOSMXmlImport ( const QString &  xmlFileName = QString(),
const QString &  dbFileName = QString() 
)
explicit

Definition at line 24 of file qgsosmimport.cpp.

Member Function Documentation

bool QgsOSMXmlImport::closeDatabase ( )
protected

Definition at line 228 of file qgsosmimport.cpp.

bool QgsOSMXmlImport::createDatabase ( )
protected

Definition at line 136 of file qgsosmimport.cpp.

bool QgsOSMXmlImport::createIndexes ( )
protected

Definition at line 112 of file qgsosmimport.cpp.

void QgsOSMXmlImport::deleteStatement ( sqlite3_stmt *&  stmt)
protected

Definition at line 218 of file qgsosmimport.cpp.

QString QgsOSMXmlImport::errorString ( ) const
inline

Definition at line 54 of file qgsosmimport.h.

bool QgsOSMXmlImport::hasError ( ) const
inline

Definition at line 53 of file qgsosmimport.h.

bool QgsOSMXmlImport::import ( )

Run import.

This will parse the XML file and store the data in a SQLite database.

Returns
true on success, false when import failed (see errorString() for the error)

Definition at line 37 of file qgsosmimport.cpp.

QString QgsOSMXmlImport::inputXmlFileName ( ) const
inline

Definition at line 42 of file qgsosmimport.h.

QString QgsOSMXmlImport::outputDbFileName ( ) const
inline

Definition at line 45 of file qgsosmimport.h.

void QgsOSMXmlImport::progress ( int  percent)
signal
void QgsOSMXmlImport::readNode ( QXmlStreamReader &  xml)
protected

Definition at line 283 of file qgsosmimport.cpp.

void QgsOSMXmlImport::readRoot ( QXmlStreamReader &  xml)
protected

Definition at line 247 of file qgsosmimport.cpp.

void QgsOSMXmlImport::readTag ( bool  way,
QgsOSMId  id,
QXmlStreamReader &  xml 
)
protected

Definition at line 320 of file qgsosmimport.cpp.

void QgsOSMXmlImport::readWay ( QXmlStreamReader &  xml)
protected

Definition at line 342 of file qgsosmimport.cpp.

void QgsOSMXmlImport::setInputXmlFileName ( const QString &  xmlFileName)
inline

Definition at line 41 of file qgsosmimport.h.

void QgsOSMXmlImport::setOutputDbFileName ( const QString &  dbFileName)
inline

Definition at line 44 of file qgsosmimport.h.


The documentation for this class was generated from the following files: