Skip to content

Commit

Permalink
Add file headers, do not report error in case there are no spatial ta…
Browse files Browse the repository at this point in the history
…bles in SpatiaLite database
  • Loading branch information
wonder-sk committed Feb 28, 2013
1 parent 4512133 commit 84728d3
Show file tree
Hide file tree
Showing 16 changed files with 240 additions and 63 deletions.
15 changes: 15 additions & 0 deletions src/analysis/openstreetmap/qgsosmbase.cpp
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmbase.cpp
--------------------------------------
Date : January 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgsosmbase.h"

// nothing here now
4 changes: 3 additions & 1 deletion src/analysis/openstreetmap/qgsosmbase.h
Expand Up @@ -111,7 +111,9 @@ class ANALYSIS_EXPORT QgsOSMRelation : public QgsOSMElement
};
#endif


/**
* This class is a container of tags for a node, way or a relation.
*/
class ANALYSIS_EXPORT QgsOSMTags
{
public:
Expand Down
15 changes: 15 additions & 0 deletions src/analysis/openstreetmap/qgsosmdatabase.cpp
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmdatabase.cpp
--------------------------------------
Date : January 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgsosmdatabase.h"

#include <spatialite.h>
Expand Down
26 changes: 26 additions & 0 deletions src/analysis/openstreetmap/qgsosmdatabase.h
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmdatabase.h
--------------------------------------
Date : January 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef OSMDATABASE_H
#define OSMDATABASE_H

Expand All @@ -16,6 +31,17 @@ typedef QPair<QString, int> QgsOSMTagCountPair;
/**
* Class that encapsulates access to OpenStreetMap data stored in a database
* previously imported from XML file.
*
* Internal database structure consists of the following tables:
* - nodes
* - nodes_tags
* - ways
* - ways_tags
* - ways_nodes
*
* The topology representation can be translated to simple features representation
* using exportSpatiaLite() method into SpatiaLite layers (tables). These can be
* easily used in QGIS like any other layers.
*/
class ANALYSIS_EXPORT QgsOSMDatabase
{
Expand Down
15 changes: 15 additions & 0 deletions src/analysis/openstreetmap/qgsosmdownload.h
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmdownload.h
--------------------------------------
Date : January 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef OSMDOWNLOAD_H
#define OSMDOWNLOAD_H

Expand Down
15 changes: 15 additions & 0 deletions src/analysis/openstreetmap/qgsosmimport.cpp
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmimport.cpp
--------------------------------------
Date : January 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgsosmimport.h"

#include <spatialite.h>
Expand Down
29 changes: 28 additions & 1 deletion src/analysis/openstreetmap/qgsosmimport.h
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmimport.h
--------------------------------------
Date : January 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef OSMIMPORT_H
#define OSMIMPORT_H

Expand All @@ -8,7 +23,15 @@

class QXmlStreamReader;


/**
* @brief 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
*/
class ANALYSIS_EXPORT QgsOSMXmlImport : public QObject
{
Q_OBJECT
Expand All @@ -21,6 +44,10 @@ class ANALYSIS_EXPORT QgsOSMXmlImport : public QObject
void setOutputDbFileName( const QString& dbFileName ) { mDbFileName = dbFileName; }
QString outputDbFileName() const { return mDbFileName; }

/**
* Run import. This will parse the XML file and store the data in a SQLite database.
* @return true on success, false when import failed (see errorString() for the error)
*/
bool import();

bool hasError() const { return !mError.isEmpty(); }
Expand Down
15 changes: 15 additions & 0 deletions src/app/openstreetmap/qgsosmdownloaddialog.cpp
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmdownloaddialog.cpp
--------------------------------------
Date : February 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgsosmdownloaddialog.h"

#include <QFileDialog>
Expand Down
15 changes: 15 additions & 0 deletions src/app/openstreetmap/qgsosmdownloaddialog.h
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmdownloaddialog.h
--------------------------------------
Date : February 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSOSMDOWNLOADDIALOG_H
#define QGSOSMDOWNLOADDIALOG_H

Expand Down
15 changes: 15 additions & 0 deletions src/app/openstreetmap/qgsosmexportdialog.cpp
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmexportdialog.cpp
--------------------------------------
Date : February 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgsosmexportdialog.h"

#include "qgsosmdatabase.h"
Expand Down
15 changes: 15 additions & 0 deletions src/app/openstreetmap/qgsosmexportdialog.h
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmexportdialog.h
--------------------------------------
Date : February 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSOSMEXPORTDIALOG_H
#define QGSOSMEXPORTDIALOG_H

Expand Down
15 changes: 15 additions & 0 deletions src/app/openstreetmap/qgsosmimportdialog.cpp
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmimportdialog.cpp
--------------------------------------
Date : February 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgsosmimportdialog.h"

#include <QApplication>
Expand Down
15 changes: 15 additions & 0 deletions src/app/openstreetmap/qgsosmimportdialog.h
@@ -1,3 +1,18 @@
/***************************************************************************
qgsosmimportdialog.h
--------------------------------------
Date : February 2013
Copyright : (C) 2013 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSOSMIMPORTDIALOG_H
#define QGSOSMIMPORTDIALOG_H

Expand Down

0 comments on commit 84728d3

Please sign in to comment.