Skip to content

Commit

Permalink
Rework MSSQL parser to support v2 geometries (fixes #22041)
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest authored and nyalldawson committed Jun 15, 2019
1 parent b25fa7a commit 38659fb
Show file tree
Hide file tree
Showing 4 changed files with 418 additions and 325 deletions.
7 changes: 3 additions & 4 deletions src/providers/mssql/qgsmssqlfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,10 @@ bool QgsMssqlFeatureIterator::fetchFeature( QgsFeature &feature )
QByteArray ar = mQuery->record().value( mSource->mGeometryColName ).toByteArray();
if ( !ar.isEmpty() )
{
if ( unsigned char *wkb = mParser.ParseSqlGeometry( reinterpret_cast< unsigned char * >( ar.data() ), ar.size() ) )
std::unique_ptr<QgsAbstractGeometry> geom = mParser.ParseSqlGeometry(reinterpret_cast< unsigned char * >(ar.data()), ar.size());
if ( geom != nullptr )
{
QgsGeometry g;
g.fromWkb( wkb, mParser.GetWkbLen() );
feature.setGeometry( g );
feature.setGeometry( QgsGeometry( geom.release() ) );
}
}
}
Expand Down
Loading

0 comments on commit 38659fb

Please sign in to comment.