Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • otb otb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 196
    • Issues 196
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Main Repositories
  • otbotb
  • Merge requests
  • !512

Fix error : Invalid index -1

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Cédric Traizet requested to merge fix_invalid_index into develop Jun 07, 2019
  • Overview 0
  • Commits 1
  • Pipelines 2
  • Changes 1

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 👍 votes from core developers, no 👎 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 Jun 11, 2019 by Cédric Traizet
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix_invalid_index