<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">If I use the GDAL 1.7.3 version of ogr2ogr from the command line, like:<div>
<i> ogr2ogr -skipfailures /path/to/dest /path/to/source</i></div><div>it works great. I get a directory 'dest' full of shapefiles, one for each layer in the source S-57 chart file. (in my case, 21 different layers)</div>
<div><br></div><div>I am trying to use ogr2ogr.java to do the same thing, like:</div><div><div><i> String[] args = new String[3];</i></div><div><i> args[0] = "-skipfailures";</i></div><div><i> args[2] = "/path/to/dest";</i></div>
<div><i> args[3] = "/path/to/source";</i></div><div><i> ogr2ogr.main(args);</i></div></div><div>but I only get three shapefiles in my destination directory, Area, Point, and Line. Adding a printout to the ogr2ogr.java code reveals that <datasource>.GetLayerCount() returns 5.</div>
<div><br></div><div>Furthermore, if I try to convert only one layer of the chart on the command line, as in:</div><div> <i>ogr2ogr -skipfailures /path/to/dest /path/to/source DEPCNT</i></div><div>it results in one shapefile in the destination directory. The java version complains:</div>
<div> <i>String[] args = new String[4];</i></div><div><i> args[0] = "-skipfailures";</i></div><div><i> args[2] = "/path/to/dest";</i></div><div><i> args[3] = "/path/to/source";</i></div>
<div><i> args[4] = "DEPCNT";</i></div><div><i> ogr2ogr.main(args);</i></div><div><i> ...</i></div><div><i> FAILURE: Couldn't fetch advertised layer DEPCNT!</i></div><div><i><br></i></div><div>Can anyone shed some light on this behavior? Is my ogr2ogr.java, which was compiled using GDAL 1.8.0, somehow different? Is this expected behavior? Should I change my configuration options before building?</div>
<div><br></div><div>Thanks for any and all information...</div><div><br></div><div>~Bob</div></span>