Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[mssql] Fix debug noise when reading features with null geometry
- Loading branch information
Showing
with
8 additions
and
13 deletions.
-
+8
−13
src/providers/mssql/qgsmssqlfeatureiterator.cpp
|
@@ -330,24 +330,19 @@ bool QgsMssqlFeatureIterator::fetchFeature( QgsFeature &feature ) |
|
|
|
|
|
feature.setId( mQuery->record().value( mSource->mFidColName ).toLongLong() ); |
|
|
|
|
|
feature.clearGeometry(); |
|
|
if ( mSource->isSpatial() ) |
|
|
{ |
|
|
QByteArray ar = mQuery->record().value( mSource->mGeometryColName ).toByteArray(); |
|
|
unsigned char *wkb = mParser.ParseSqlGeometry( ( unsigned char * )ar.data(), ar.size() ); |
|
|
if ( wkb ) |
|
|
if ( !ar.isEmpty() ) |
|
|
{ |
|
|
QgsGeometry g; |
|
|
g.fromWkb( wkb, mParser.GetWkbLen() ); |
|
|
feature.setGeometry( g ); |
|
|
if ( unsigned char *wkb = mParser.ParseSqlGeometry( ( unsigned char * )ar.data(), ar.size() ) ) |
|
|
{ |
|
|
QgsGeometry g; |
|
|
g.fromWkb( wkb, mParser.GetWkbLen() ); |
|
|
feature.setGeometry( g ); |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
feature.clearGeometry(); |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
feature.clearGeometry(); |
|
|
} |
|
|
|
|
|
feature.setValid( true ); |
|
|