<div dir="ltr">Hi list,<div><br></div><div>We are currently using GDAL/OGR bindings for Java, and we stumbled upon a bug using MIF/MID (where the same code achieves generating TAB with no problem at all). While debugging, we reached the following (GeoTools) code[1]:</div>
<div><br></div><div><div> if (!driverName.equalsIgnoreCase("georss") &&</div><div> !driverName.equalsIgnoreCase("gpx") &&</div><div> !driverName.equalsIgnoreCase("sosi") &&</div>
<div> !ogr.LayerCanCreateField(layer)) {</div><div> throw new DataSourceException(</div><div> "OGR reports it's not possible to create fields on this layer");</div>
<div> }</div></div><div><br></div><div>By digging into the MIF/MID and tab code "OGR-side", I discovered that the TestCapability method between the two formats is not returning exactly the same capabilities. I thought both were very close to each other, so is the CreateField capability not supported at MIF/MID side, or is it just a missing test ?</div>
<div><br></div><div>I tried to recompile a own version of GDAL/OGR returning true for CreateField TestCapability in the MIF/MID code, and I was able to correctly generate the expected mif file from my application, but I might be wrong in the approach, being pretty new to gdal codebase and not a C++ guru.</div>
<div><br></div><div>Secondly, by reading the code, I found out a weird test[2]: is line #2258 ever triggered ?</div><div><br clear="all"><div>Thanks in advance for the answers and regards,</div><div><br></div><div>[1] <a href="https://github.com/geotools/geotools/blob/master/modules/plugin/ogr/ogr-core/src/main/java/org/geotools/data/ogr/OGRDataStore.java#L194-L198">https://github.com/geotools/geotools/blob/master/modules/plugin/ogr/ogr-core/src/main/java/org/geotools/data/ogr/OGRDataStore.java#L194-L198</a></div>
<div><br></div><div>[2] <a href="https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrsf_frmts/mitab/mitab_miffile.cpp#L2255-L2259">https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrsf_frmts/mitab/mitab_miffile.cpp#L2255-L2259</a></div>
<div><br></div><div><font color="#222222"><a href="https://github.com/geotools/geotools/blob/master/modules/plugin/ogr/ogr-core/src/main/java/org/geotools/data/ogr/OGRDataStore.java#L194-L198"><br></a></font>-- </div><div dir="ltr">
<p style="white-space:pre-wrap;font-size:12px;margin:0px"><span style="font-family:arial,helvetica,sans-serif">Pierre Mauduit</span><br></p><p style="white-space:pre-wrap;font-size:12px;margin:0px"><font face="arial, helvetica, sans-serif">Ingénieur développement</font></p>
<p style="white-space:pre-wrap;font-size:12px;margin:0px"><font face="arial, helvetica, sans-serif">Camptocamp France SAS<br></font></p><p style="white-space:pre-wrap;font-size:12px;margin:0px"><font face="arial, helvetica, sans-serif">Savoie Technolac, BP 352</font></p>
<p style="white-space:pre-wrap;font-size:12px;margin:0px"><font face="arial, helvetica, sans-serif">73377 Le Bourget du Lac, Cedex</font></p><p style="white-space:pre-wrap;font-size:12px;margin:0px"><font face="arial, helvetica, sans-serif">Tel (France) : +33 4 79 26 58 02</font></p>
<p style="white-space:pre-wrap;font-size:12px;margin:0px"><font face="arial, helvetica, sans-serif">Fax : 04 79 70 15 81<br></font></p><p style="white-space:pre-wrap;font-size:12px;margin:0px"><font face="arial, helvetica, sans-serif">Mail : <a href="mailto:yves.jacolin@camptocamp.com" style="color:rgb(17,85,204)" target="_blank">pierre.mauduit@camptocamp.com</a></font></p>
<p style="white-space:pre-wrap;font-size:12px;margin:0px"><a href="http://www.camptocamp.com/" style="color:rgb(17,85,204)" target="_blank"><font face="arial, helvetica, sans-serif">http://www.camptocamp.com</font></a></p>
</div>
</div></div>