Skip to content

Commit 84728d3

Browse files
committed
Add file headers, do not report error in case there are no spatial tables in SpatiaLite database
1 parent 4512133 commit 84728d3

16 files changed

+240
-63
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmbase.cpp
3+
--------------------------------------
4+
Date : January 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#include "qgsosmbase.h"
217

318
// nothing here now

src/analysis/openstreetmap/qgsosmbase.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ class ANALYSIS_EXPORT QgsOSMRelation : public QgsOSMElement
111111
};
112112
#endif
113113

114-
114+
/**
115+
* This class is a container of tags for a node, way or a relation.
116+
*/
115117
class ANALYSIS_EXPORT QgsOSMTags
116118
{
117119
public:

src/analysis/openstreetmap/qgsosmdatabase.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmdatabase.cpp
3+
--------------------------------------
4+
Date : January 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#include "qgsosmdatabase.h"
217

318
#include <spatialite.h>

src/analysis/openstreetmap/qgsosmdatabase.h

+26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmdatabase.h
3+
--------------------------------------
4+
Date : January 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#ifndef OSMDATABASE_H
217
#define OSMDATABASE_H
318

@@ -16,6 +31,17 @@ typedef QPair<QString, int> QgsOSMTagCountPair;
1631
/**
1732
* Class that encapsulates access to OpenStreetMap data stored in a database
1833
* previously imported from XML file.
34+
*
35+
* Internal database structure consists of the following tables:
36+
* - nodes
37+
* - nodes_tags
38+
* - ways
39+
* - ways_tags
40+
* - ways_nodes
41+
*
42+
* The topology representation can be translated to simple features representation
43+
* using exportSpatiaLite() method into SpatiaLite layers (tables). These can be
44+
* easily used in QGIS like any other layers.
1945
*/
2046
class ANALYSIS_EXPORT QgsOSMDatabase
2147
{

src/analysis/openstreetmap/qgsosmdownload.h

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmdownload.h
3+
--------------------------------------
4+
Date : January 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#ifndef OSMDOWNLOAD_H
217
#define OSMDOWNLOAD_H
318

src/analysis/openstreetmap/qgsosmimport.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmimport.cpp
3+
--------------------------------------
4+
Date : January 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#include "qgsosmimport.h"
217

318
#include <spatialite.h>

src/analysis/openstreetmap/qgsosmimport.h

+28-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmimport.h
3+
--------------------------------------
4+
Date : January 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#ifndef OSMIMPORT_H
217
#define OSMIMPORT_H
318

@@ -8,7 +23,15 @@
823

924
class QXmlStreamReader;
1025

11-
26+
/**
27+
* @brief The QgsOSMXmlImport class imports OpenStreetMap XML format to our topological representation
28+
* in a SQLite database (see QgsOSMDatabase for details).
29+
*
30+
* How to use the classs:
31+
* 1. set input XML file name and output DB file name (in constructor or with respective functions)
32+
* 2. run import()
33+
* 3. check errorString() if the import failed
34+
*/
1235
class ANALYSIS_EXPORT QgsOSMXmlImport : public QObject
1336
{
1437
Q_OBJECT
@@ -21,6 +44,10 @@ class ANALYSIS_EXPORT QgsOSMXmlImport : public QObject
2144
void setOutputDbFileName( const QString& dbFileName ) { mDbFileName = dbFileName; }
2245
QString outputDbFileName() const { return mDbFileName; }
2346

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

2653
bool hasError() const { return !mError.isEmpty(); }

src/app/openstreetmap/qgsosmdownloaddialog.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmdownloaddialog.cpp
3+
--------------------------------------
4+
Date : February 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#include "qgsosmdownloaddialog.h"
217

318
#include <QFileDialog>

src/app/openstreetmap/qgsosmdownloaddialog.h

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmdownloaddialog.h
3+
--------------------------------------
4+
Date : February 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#ifndef QGSOSMDOWNLOADDIALOG_H
217
#define QGSOSMDOWNLOADDIALOG_H
318

src/app/openstreetmap/qgsosmexportdialog.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmexportdialog.cpp
3+
--------------------------------------
4+
Date : February 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#include "qgsosmexportdialog.h"
217

318
#include "qgsosmdatabase.h"

src/app/openstreetmap/qgsosmexportdialog.h

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmexportdialog.h
3+
--------------------------------------
4+
Date : February 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#ifndef QGSOSMEXPORTDIALOG_H
217
#define QGSOSMEXPORTDIALOG_H
318

src/app/openstreetmap/qgsosmimportdialog.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmimportdialog.cpp
3+
--------------------------------------
4+
Date : February 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#include "qgsosmimportdialog.h"
217

318
#include <QApplication>

src/app/openstreetmap/qgsosmimportdialog.h

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/***************************************************************************
2+
qgsosmimportdialog.h
3+
--------------------------------------
4+
Date : February 2013
5+
Copyright : (C) 2013 by Martin Dobias
6+
Email : wonder dot sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
116
#ifndef QGSOSMIMPORTDIALOG_H
217
#define QGSOSMIMPORTDIALOG_H
318

0 commit comments

Comments
 (0)