QGIS API Documentation  2.99.0-Master (9f5e33a)
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 outputDatabaseFileName () const
 Returns the filename for the output database. More...
 
void setInputXmlFileName (const QString &xmlFileName)
 
void setOutputDatabaseFileName (const QString &fileName)
 Sets the filename for the output database. More...
 

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 class:

  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 37 of file qgsosmimport.h.

Constructor & Destructor Documentation

◆ QgsOSMXmlImport()

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

Definition at line 23 of file qgsosmimport.cpp.

Member Function Documentation

◆ closeDatabase()

bool QgsOSMXmlImport::closeDatabase ( )
protected

Definition at line 224 of file qgsosmimport.cpp.

◆ createDatabase()

bool QgsOSMXmlImport::createDatabase ( )
protected

Definition at line 132 of file qgsosmimport.cpp.

◆ createIndexes()

bool QgsOSMXmlImport::createIndexes ( )
protected

Definition at line 108 of file qgsosmimport.cpp.

◆ deleteStatement()

void QgsOSMXmlImport::deleteStatement ( sqlite3_stmt *&  stmt)
protected
Note
not available in Python bindings

Definition at line 214 of file qgsosmimport.cpp.

◆ errorString()

QString QgsOSMXmlImport::errorString ( ) const
inline

Definition at line 65 of file qgsosmimport.h.

◆ hasError()

bool QgsOSMXmlImport::hasError ( ) const
inline

Definition at line 64 of file qgsosmimport.h.

◆ import()

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.

◆ inputXmlFileName()

QString QgsOSMXmlImport::inputXmlFileName ( ) const
inline

Definition at line 44 of file qgsosmimport.h.

◆ outputDatabaseFileName()

QString QgsOSMXmlImport::outputDatabaseFileName ( ) const
inline

Returns the filename for the output database.

See also
setOutputDatabaseFileName()

Definition at line 56 of file qgsosmimport.h.

◆ progress

void QgsOSMXmlImport::progress ( int  percent)
signal

◆ readNode()

void QgsOSMXmlImport::readNode ( QXmlStreamReader &  xml)
protected

Definition at line 279 of file qgsosmimport.cpp.

◆ readRoot()

void QgsOSMXmlImport::readRoot ( QXmlStreamReader &  xml)
protected

Definition at line 243 of file qgsosmimport.cpp.

◆ readTag()

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

Definition at line 316 of file qgsosmimport.cpp.

◆ readWay()

void QgsOSMXmlImport::readWay ( QXmlStreamReader &  xml)
protected

Definition at line 338 of file qgsosmimport.cpp.

◆ setInputXmlFileName()

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

Definition at line 43 of file qgsosmimport.h.

◆ setOutputDatabaseFileName()

void QgsOSMXmlImport::setOutputDatabaseFileName ( const QString &  fileName)
inline

Sets the filename for the output database.

See also
outputDatabaseFileName()

Definition at line 50 of file qgsosmimport.h.


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