Skip to content
Permalink
Browse files

fix issues

  • Loading branch information
kiselev-dv committed May 4, 2015
1 parent 5d54b32 commit 314bf4e14d79e923325a8f948d5133f947078b3f
Showing with 15 additions and 11 deletions.
  1. +13 −9 src/analysis/openstreetmap/qgsosmdatabase.cpp
  2. +2 −2 src/analysis/openstreetmap/qgsosmdatabase.h
@@ -299,7 +299,7 @@ bool QgsOSMDatabase::prepareStatements()

bool QgsOSMDatabase::exportSpatiaLite( ExportType type, const QString& tableName,
const QStringList& tagKeys,
const QStringList& notNullTagKeys)
const QStringList& notNullTagKeys )
{
mError.clear();

@@ -338,7 +338,7 @@ bool QgsOSMDatabase::exportSpatiaLite( ExportType type, const QString& tableName
}


bool QgsOSMDatabase::createSpatialTable( const QString& tableName, const QString& geometryType, const QStringList& tagKeys)
bool QgsOSMDatabase::createSpatialTable( const QString& tableName, const QString& geometryType, const QStringList& tagKeys )
{
QString sqlCreateTable = QString( "CREATE TABLE %1 (id INTEGER PRIMARY KEY" ).arg( quotedIdentifier( tableName ) );
for ( int i = 0; i < tagKeys.count(); ++i )
@@ -409,9 +409,13 @@ void QgsOSMDatabase::exportSpatiaLiteNodes( const QString& tableName, const QStr
continue;

//check not null tags
for( int i = 0; i < notNullTagKeys.count(); ++i )
bool skipNull = false;
for ( int i = 0; i < notNullTagKeys.count() && !skipNull; ++i )
if ( !t.contains( notNullTagKeys[i] ) )
continue;
skipNull = true;

if ( skipNull )
continue;

QgsGeometry* geom = QgsGeometry::fromPoint( n.point() );
int col = 0;
@@ -446,8 +450,8 @@ void QgsOSMDatabase::exportSpatiaLiteNodes( const QString& tableName, const QStr


void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName,
const QStringList& tagKeys,
const QStringList& notNullTagKeys)
const QStringList& tagKeys,
const QStringList& notNullTagKeys )
{
Q_UNUSED( tagKeys );

@@ -487,12 +491,12 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
bool skipNull = false;

//check not null tags
for( int i = 0; i < notNullTagKeys.count() && skipNull == false; ++i )
for ( int i = 0; i < notNullTagKeys.count() && skipNull == false; ++i )
if ( !t.contains( notNullTagKeys[i] ) )
skipNull = true;

if(skipNull)
continue;
if ( skipNull )
continue;

QgsGeometry* geom = closed ? QgsGeometry::fromPolygon( QgsPolygon() << polyline ) : QgsGeometry::fromPolyline( polyline );
int col = 0;
@@ -88,8 +88,8 @@ class ANALYSIS_EXPORT QgsOSMDatabase
int runCountStatement( const char* sql ) const;
void deleteStatement( sqlite3_stmt*& stmt );

void exportSpatiaLiteNodes( const QString& tableName, const QStringList& tagKeys, const QStringList& notNullTagKeys );
void exportSpatiaLiteWays( bool closed, const QString& tableName, const QStringList& tagKeys, const QStringList& notNullTagKeys );
void exportSpatiaLiteNodes( const QString& tableName, const QStringList& tagKeys, const QStringList& notNullTagKeys = QStringList() );
void exportSpatiaLiteWays( bool closed, const QString& tableName, const QStringList& tagKeys, const QStringList& notNullTagKeys = QStringList() );
bool createSpatialTable( const QString& tableName, const QString& geometryType, const QStringList& tagKeys );
bool createSpatialIndex( const QString& tableName );

0 comments on commit 314bf4e

Please sign in to comment.
You can’t perform that action at this time.