[gdal-dev] [OGR] Questions about the MIF/MID format implementation
Pierre Mauduit
pierre.mauduit at camptocamp.com
Mon May 19 07:27:33 PDT 2014
Hi list,
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]:
if (!driverName.equalsIgnoreCase("georss") &&
!driverName.equalsIgnoreCase("gpx") &&
!driverName.equalsIgnoreCase("sosi") &&
!ogr.LayerCanCreateField(layer)) {
throw new DataSourceException(
"OGR reports it's not possible to create fields on
this layer");
}
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 ?
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.
Secondly, by reading the code, I found out a weird test[2]: is line #2258
ever triggered ?
Thanks in advance for the answers and regards,
[1]
https://github.com/geotools/geotools/blob/master/modules/plugin/ogr/ogr-core/src/main/java/org/geotools/data/ogr/OGRDataStore.java#L194-L198
[2]
https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrsf_frmts/mitab/mitab_miffile.cpp#L2255-L2259
<https://github.com/geotools/geotools/blob/master/modules/plugin/ogr/ogr-core/src/main/java/org/geotools/data/ogr/OGRDataStore.java#L194-L198>
--
Pierre Mauduit
Ingénieur développement
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel (France) : +33 4 79 26 58 02
Fax : 04 79 70 15 81
Mail : pierre.mauduit at camptocamp.com <yves.jacolin at camptocamp.com>
http://www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140519/dff0fe99/attachment.html>
More information about the gdal-dev
mailing list