Skip to content
Permalink
Browse files
Add file headers, do not report error in case there are no spatial ta…
…bles in SpatiaLite database
  • Loading branch information
wonder-sk committed Feb 28, 2013
1 parent 4512133 commit 84728d3360be9d4d36f42e2ae5edb14ebd605de1
Show file tree
Hide file tree
Showing 16 changed files with 240 additions and 63 deletions.
@@ -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
@@ -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:
@@ -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>
@@ -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

@@ -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
{
@@ -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

@@ -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>
@@ -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

@@ -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
@@ -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(); }
@@ -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>
@@ -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

@@ -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"
@@ -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

@@ -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>
@@ -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

0 comments on commit 84728d3

Please sign in to comment.