@@ -299,7 +299,7 @@ bool QgsOSMDatabase::prepareStatements()
299
299
300
300
bool QgsOSMDatabase::exportSpatiaLite ( ExportType type, const QString& tableName,
301
301
const QStringList& tagKeys,
302
- const QStringList& notNullTagKeys)
302
+ const QStringList& notNullTagKeys )
303
303
{
304
304
mError .clear ();
305
305
@@ -338,7 +338,7 @@ bool QgsOSMDatabase::exportSpatiaLite( ExportType type, const QString& tableName
338
338
}
339
339
340
340
341
- bool QgsOSMDatabase::createSpatialTable ( const QString& tableName, const QString& geometryType, const QStringList& tagKeys)
341
+ bool QgsOSMDatabase::createSpatialTable ( const QString& tableName, const QString& geometryType, const QStringList& tagKeys )
342
342
{
343
343
QString sqlCreateTable = QString ( " CREATE TABLE %1 (id INTEGER PRIMARY KEY" ).arg ( quotedIdentifier ( tableName ) );
344
344
for ( int i = 0 ; i < tagKeys.count (); ++i )
@@ -409,9 +409,13 @@ void QgsOSMDatabase::exportSpatiaLiteNodes( const QString& tableName, const QStr
409
409
continue ;
410
410
411
411
// check not null tags
412
- for ( int i = 0 ; i < notNullTagKeys.count (); ++i )
412
+ bool skipNull = false ;
413
+ for ( int i = 0 ; i < notNullTagKeys.count () && !skipNull; ++i )
413
414
if ( !t.contains ( notNullTagKeys[i] ) )
414
- continue ;
415
+ skipNull = true ;
416
+
417
+ if ( skipNull )
418
+ continue ;
415
419
416
420
QgsGeometry* geom = QgsGeometry::fromPoint ( n.point () );
417
421
int col = 0 ;
@@ -446,8 +450,8 @@ void QgsOSMDatabase::exportSpatiaLiteNodes( const QString& tableName, const QStr
446
450
447
451
448
452
void QgsOSMDatabase::exportSpatiaLiteWays ( bool closed, const QString& tableName,
449
- const QStringList& tagKeys,
450
- const QStringList& notNullTagKeys)
453
+ const QStringList& tagKeys,
454
+ const QStringList& notNullTagKeys )
451
455
{
452
456
Q_UNUSED ( tagKeys );
453
457
@@ -487,12 +491,12 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
487
491
bool skipNull = false ;
488
492
489
493
// check not null tags
490
- for ( int i = 0 ; i < notNullTagKeys.count () && skipNull == false ; ++i )
494
+ for ( int i = 0 ; i < notNullTagKeys.count () && skipNull == false ; ++i )
491
495
if ( !t.contains ( notNullTagKeys[i] ) )
492
496
skipNull = true ;
493
497
494
- if ( skipNull)
495
- continue ;
498
+ if ( skipNull )
499
+ continue ;
496
500
497
501
QgsGeometry* geom = closed ? QgsGeometry::fromPolygon ( QgsPolygon () << polyline ) : QgsGeometry::fromPolyline ( polyline );
498
502
int col = 0 ;
0 commit comments