QGIS API Documentation  2.9.0-Master
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>

Inheritance diagram for QgsOSMXmlImport:
Inheritance graph
[legend]

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. More...
 
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 23 of file qgsosmimport.cpp.

Member Function Documentation

bool QgsOSMXmlImport::closeDatabase ( )
protected

Definition at line 224 of file qgsosmimport.cpp.

bool QgsOSMXmlImport::createDatabase ( )
protected

Definition at line 132 of file qgsosmimport.cpp.

bool QgsOSMXmlImport::createIndexes ( )
protected

Definition at line 108 of file qgsosmimport.cpp.

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

Definition at line 214 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 36 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 279 of file qgsosmimport.cpp.

void QgsOSMXmlImport::readRoot ( QXmlStreamReader &  xml)
protected

Definition at line 243 of file qgsosmimport.cpp.

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

Definition at line 316 of file qgsosmimport.cpp.

void QgsOSMXmlImport::readWay ( QXmlStreamReader &  xml)
protected

Definition at line 338 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: