QGIS API Documentation  2.6.0-Brighton
 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())
void setInputXmlFileName (const QString &xmlFileName)
QString inputXmlFileName () const
void setOutputDbFileName (const QString &dbFileName)
QString outputDbFileName () const
bool import ()
 Run import.
bool hasError () const
QString errorString () const

Protected Member Functions

bool createDatabase ()
bool closeDatabase ()
void deleteStatement (sqlite3_stmt *&stmt)
bool createIndexes ()
void readRoot (QXmlStreamReader &xml)
void readNode (QXmlStreamReader &xml)
void readWay (QXmlStreamReader &xml)
void readTag (bool way, QgsOSMId id, 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

Constructor & Destructor Documentation

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

Member Function Documentation

bool QgsOSMXmlImport::closeDatabase ( )
protected
bool QgsOSMXmlImport::createDatabase ( )
protected
bool QgsOSMXmlImport::createIndexes ( )
protected
void QgsOSMXmlImport::deleteStatement ( sqlite3_stmt *&  stmt)
protected
QString QgsOSMXmlImport::errorString ( ) const
inline
bool QgsOSMXmlImport::hasError ( ) const
inline
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)
QString QgsOSMXmlImport::inputXmlFileName ( ) const
inline
QString QgsOSMXmlImport::outputDbFileName ( ) const
inline
void QgsOSMXmlImport::progress ( int  percent)
signal
void QgsOSMXmlImport::readNode ( QXmlStreamReader &  xml)
protected
void QgsOSMXmlImport::readRoot ( QXmlStreamReader &  xml)
protected
void QgsOSMXmlImport::readTag ( bool  way,
QgsOSMId  id,
QXmlStreamReader &  xml 
)
protected
void QgsOSMXmlImport::readWay ( QXmlStreamReader &  xml)
protected
void QgsOSMXmlImport::setInputXmlFileName ( const QString &  xmlFileName)
inline
void QgsOSMXmlImport::setOutputDbFileName ( const QString &  dbFileName)
inline

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