Hello Robert, Try setting the GDAL_DATA and OGR_S57_OPTIONS environment variables within your java environment.
http://www.gdal.org/ogr/drv_s57.html Best regards, Oliver 2011/6/20 Robert Naugle <[email protected]>: > If I use the GDAL 1.7.3 version of ogr2ogr from the command line, like: > ogr2ogr -skipfailures /path/to/dest /path/to/source > 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) > I am trying to use ogr2ogr.java to do the same thing, like: > String[] args = new String[3]; > args[0] = "-skipfailures"; > args[2] = "/path/to/dest"; > args[3] = "/path/to/source"; > ogr2ogr.main(args); > 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. > Furthermore, if I try to convert only one layer of the chart on the command > line, as in: > ogr2ogr -skipfailures /path/to/dest /path/to/source DEPCNT > it results in one shapefile in the destination directory. The java version > complains: > String[] args = new String[4]; > args[0] = "-skipfailures"; > args[2] = "/path/to/dest"; > args[3] = "/path/to/source"; > args[4] = "DEPCNT"; > ogr2ogr.main(args); > ... > FAILURE: Couldn't fetch advertised layer DEPCNT! > 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? > Thanks for any and all information... > ~Bob > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev > _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
