Skip to content

Commit

Permalink
oracle provider: handle empty geometries (fixes #14631)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 8, 2016
1 parent 96148e3 commit d07bc18
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/providers/oracle/qgsoraclefeatureiterator.cpp
Expand Up @@ -190,12 +190,19 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
(( mRequest.flags() & QgsFeatureRequest::ExactIntersect ) != 0 && ( !mConnection->hasSpatial() || !mSource->mHasSpatialIndex ) ) )
{
QByteArray *ba = static_cast<QByteArray*>( mQry.value( col++ ).data() );
unsigned char *copy = new unsigned char[ba->size()];
memcpy( copy, ba->constData(), ba->size() );
if ( ba->size() > 0 )
{
unsigned char *copy = new unsigned char[ba->size()];
memcpy( copy, ba->constData(), ba->size() );

QgsGeometry *g = new QgsGeometry();
g->fromWkb( copy, ba->size() );
feature.setGeometry( g );
QgsGeometry *g = new QgsGeometry();
g->fromWkb( copy, ba->size() );
feature.setGeometry( g );
}
else
{
feature.setGeometry( 0 );
}

if (( mRequest.flags() & QgsFeatureRequest::ExactIntersect ) != 0 && ( !mConnection->hasSpatial() || !mSource->mHasSpatialIndex ) &&
mRequest.filterType() == QgsFeatureRequest::FilterRect &&
Expand Down

0 comments on commit d07bc18

Please sign in to comment.