Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
oracle provider: handle NULL geometry in case of multiple geometry co…
…lumns
  • Loading branch information
jef-n committed Apr 2, 2016
1 parent 59de73a commit c93187d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/providers/oracle/qgsoraclefeatureiterator.cpp
Expand Up @@ -275,13 +275,20 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
if ( fld.type() == QVariant::ByteArray && fld.typeName().endsWith( ".SDO_GEOMETRY" ) )
{
QByteArray *ba = static_cast<QByteArray*>( v.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() );
v = g->exportToWkt();
delete g;
QgsGeometry *g = new QgsGeometry();
g->fromWkb( copy, ba->size() );
v = g->exportToWkt();
delete g;
}
else
{
v = QVariant( QVariant::String );
}
}
else if ( v.type() != fld.type() )
v = QgsVectorDataProvider::convertValue( fld.type(), v.toString() );
Expand Down

0 comments on commit c93187d

Please sign in to comment.