Skip to content
Snippets Groups Projects

Fix error : Invalid index -1

Merged Cédric Traizet requested to merge fix_invalid_index into develop

Summary

Sometimes otb logs the following error from gdal:

ERROR 1: Invalid index : -1

This happens for example on the test bfTvVectorDataRasterizeFilterSHP. This MR adds a fix for this bug.

See related issue #1883 (closed)

Rationale

In otbOGRIOHelper the ConvertDataTreeNodeToOGRLayers creates a memory ogr layer from vector data. All fields from the VectorDataKeyworkList are created in the layer except from FID. Then, the vector data is added to the layer. For points geomtries, all fields are copied excepting the FID field, but for other geometries (lines and polygons) all fields are copied, including the FID. As this has not been created, its field index is -1, and the field cannot be copied.

With this MR the FID field is not copied anymore (same behavior for points, lines and polygons)

This also applies to the ProcessNodeWrite() method.

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 :thumbsup: votes from core developers, no :thumbsdown: vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit
Edited by Cédric Traizet

Merge request reports

Merge request pipeline #1715 passed

Merge request pipeline passed for d8abe8f8

Approval is optional

Merged by Cédric TraizetCédric Traizet 5 years ago (Jun 12, 2019 7:08am UTC)

Merge details

Pipeline #1728 passed

Pipeline passed for 43f06085 on develop

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading