Skip to content

Commit 1f57745

Browse files
mhugentjef-n
authored andcommittedMar 23, 2016
Fix attribute creation in transect sample
(cherry picked from commit 90e0cb9)
1 parent 31c914d commit 1f57745

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/analysis/vector/qgstransectsample.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ int QgsTransectSample::createSample( QProgressDialog* pd )
174174
}
175175

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

204-
QgsFeature samplePointFeature;
204+
QgsFeature samplePointFeature( outputPointFields );
205205
samplePointFeature.setGeometry( samplePoint );
206206
samplePointFeature.setAttribute( "id", nTotalTransects + 1 );
207207
samplePointFeature.setAttribute( "station_id", nCreatedTransects + 1 );
@@ -274,7 +274,7 @@ int QgsTransectSample::createSample( QProgressDialog* pd )
274274
}
275275

276276
QgsFeatureId fid( nCreatedTransects );
277-
QgsFeature sampleLineFeature( fid );
277+
QgsFeature sampleLineFeature( outputPointFields, fid );
278278
sampleLineFeature.setGeometry( lineClipStratum );
279279
sampleLineFeature.setAttribute( "id", nTotalTransects + 1 );
280280
sampleLineFeature.setAttribute( "station_id", nCreatedTransects + 1 );

0 commit comments

Comments
 (0)
Please sign in to comment.