Skip to content
Permalink
Browse files
Let ogr give ids to created features (otherwise, there are problems w…
…ith exported dxf files)
  • Loading branch information
mhugent committed Dec 26, 2012
1 parent c74509e commit 891e66523fdf21283ca15533684a57dd8c27f955
Showing with 8 additions and 9 deletions.
  1. +8 −9 src/core/qgsvectorfilewriter.cpp
@@ -502,15 +502,14 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
if ( fid > std::numeric_limits<int>::max() )
{
QgsDebugMsg( QString( "feature id %1 too large." ).arg( fid ) );
}

OGRErr err = OGR_F_SetFID( poFeature, static_cast<long>( fid ) );
if ( err != OGRERR_NONE )
{
QgsDebugMsg( QString( "Failed to set feature id to %1: %2 (OGR error: %3)" )
.arg( feature.id() )
.arg( err ).arg( CPLGetLastErrorMsg() )
);
OGRErr err = OGR_F_SetFID( poFeature, static_cast<long>( fid ) );
if ( err != OGRERR_NONE )
{
QgsDebugMsg( QString( "Failed to set feature id to %1: %2 (OGR error: %3)" )
.arg( feature.id() )
.arg( err ).arg( CPLGetLastErrorMsg() )
);
}
}

// attribute handling

0 comments on commit 891e665

Please sign in to comment.