"Error invalid index : -1" in applications using vector data
Description
We observed a strange message with some OTB applications that use vector data :
otbcli_VectorDataTransform -vd extract_segments.shp -in extract_zone_WV.tif -out test.shp -transform.tx 0 -transform.ty 0 -transform.ro -15 -transform.scale 1 -transform.centerx 370433 -transform.centery 48331881
`2019-04-12 14:46:04 (INFO): Default RAM limit for OTB is 128 MB
019-04-12 14:46:04 (INFO): GDAL maximum cache size is 12854 MB
2019-04-12 14:46:04 (INFO): OTB will use at most 48 threads
2019-04-12 14:46:04 (INFO): No kwl metadata found in file extract_zone_WV.tif
ERROR 1: Invalid index : -1
ERROR 1: Invalid index : -1
ERROR 1: Invalid index : -1 [ ... ]`
It seems that OTB may not use OGR field wrapper properly, in ./OTB/Modules/Adapters/GdalAdapters/src/otbOGRFieldWrapper.cxx
The message is activated if OGR can not access to m_index value.
The dataset seems to be clean and consistent.
Steps to reproduce
The following zip file contain a small dataset that shows the error log shown here before. bug_OTB_OGR.zip
Configuration information
OTB 6.6 but it seems to be an old problem. It occurs in different applications that read or produce vector files.