Skip to content

Commit

Permalink
Merge pull request #167 from hytechimaging/fix_plateform_value_for_fi…
Browse files Browse the repository at this point in the history
…rst_line

fix plateform value for first line
  • Loading branch information
SebastienPeillet authored Apr 11, 2022
2 parents f418c58 + afbb507 commit 59b63ec
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,27 +515,28 @@ def _addFeature(
if layer == self.sightingsLayer:
feat["side"] = lastFeat["side"]
if layer == self.environmentLayer or duplicate:
plateform = (
next(self.plateformLayer.getFeatures())
if self.plateformLayer.featureCount()
else None
)
for name in lastFeat.fields().names():
if name in [
"fid",
"dateTime",
"speed",
"courseAverage",
"validated",
]:
continue
elif plateform and name in [
"plateform",
"plateformHeight",
]:
feat[name] = plateform[name]
continue
else:
feat[name] = lastFeat[name]
if layer == self.environmentLayer:
plateform = (
next(self.plateformLayer.getFeatures())
if self.plateformLayer.featureCount()
else None
)
if plateform:
feat["plateform"] = plateform["plateform"]
feat["plateformHeight"] = plateform["plateformHeight"]

for key, value in kwargs.items():
if key in ["speed", "courseAverage"] and value == -9999.0:
Expand Down

0 comments on commit 59b63ec

Please sign in to comment.