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 Oct 24, 2013
1 parent 81afd87 commit b745c3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/providers/ogr/qgsogrfeatureiterator.cpp
Original file line number Diff line number Diff line change
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 b745c3d

Please sign in to comment.