Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix attribute creation in transect sample
  • Loading branch information
mhugent committed Mar 14, 2016
1 parent 627815d commit 90e0cb9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/analysis/vector/qgstransectsample.cpp
Expand Up @@ -174,7 +174,7 @@ int QgsTransectSample::createSample( QProgressDialog* pd )
}

//save clipped baseline to file
QgsFeature blFeature;
QgsFeature blFeature( usedBaselineFields );
blFeature.setGeometry( *clippedBaseline );
blFeature.setAttribute( "stratum_id", strataId );
blFeature.setAttribute( "ok", "f" );
Expand All @@ -201,7 +201,7 @@ int QgsTransectSample::createSample( QProgressDialog* pd )
QgsPoint sampleQgsPoint = samplePoint->asPoint();
QgsPoint latLongSamplePoint = toLatLongTransform.transform( sampleQgsPoint );

QgsFeature samplePointFeature;
QgsFeature samplePointFeature( outputPointFields );
samplePointFeature.setGeometry( samplePoint );
samplePointFeature.setAttribute( "id", nTotalTransects + 1 );
samplePointFeature.setAttribute( "station_id", nCreatedTransects + 1 );
Expand Down Expand Up @@ -274,7 +274,7 @@ int QgsTransectSample::createSample( QProgressDialog* pd )
}

QgsFeatureId fid( nCreatedTransects );
QgsFeature sampleLineFeature( fid );
QgsFeature sampleLineFeature( outputPointFields, fid );
sampleLineFeature.setGeometry( lineClipStratum );
sampleLineFeature.setAttribute( "id", nTotalTransects + 1 );
sampleLineFeature.setAttribute( "station_id", nCreatedTransects + 1 );
Expand Down

1 comment on commit 90e0cb9

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhugent is this safe for me to backport?

Please sign in to comment.