QGIS API Documentation  2.11.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)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

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)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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: