Skip to content

Commit

Permalink
Feature #8725: Minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuarte47 committed Dec 17, 2013
1 parent 5a6dc99 commit 17b31c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -236,10 +236,12 @@ bool QgsOgrFeatureIterator::readFeature( OGRFeatureH fet, QgsFeature& feature )
notifyReadedFeature( fet, geom, feature );

// get the wkb representation
unsigned char *wkb = new unsigned char[OGR_G_WkbSize( geom )];
int memorySize = OGR_G_WkbSize( geom );
unsigned char *wkb = new unsigned char[memorySize];
OGR_G_ExportToWkb( geom, ( OGRwkbByteOrder ) QgsApplication::endian(), wkb );

feature.setGeometryAndOwnership( wkb, OGR_G_WkbSize( geom ) );
QgsGeometry* geometry = feature.geometry();
if ( !geometry ) feature.setGeometryAndOwnership( wkb, memorySize ); else geometry->fromWkb( wkb, memorySize );

notifyLoadedFeature( fet, feature );
}
Expand Down

0 comments on commit 17b31c2

Please sign in to comment.