[gdal-dev] ogr2ogr.java s57 conversion

Robert Naugle bobbynaugs at gmail.com
Wed Jun 22 12:48:34 EDT 2011


Oliver,

Thanks much for your help, and with the link. I thought I would share my
progress:

The first thing I tried was moving the csv files (s57attributes.csv and
s57objectclasses.csv) into the working directory. Success! (sort of...)
ogr2ogr.java found all the layers in the s57 chart file. However, the layers
appeared to be empty :(

Now I know that your suggestion was to set the environment variables within
the java environment, and that would probably help, but due to the use of
JNI in the implementation of ogr2ogr in java, and the desire for a working
JavaWebStart application later on, that path is beyond my capabilities.
So...

I did a little digging to see why the layers were empty. Layer translation
was failing when creating fields for the attributes in the s57 chart.
Specifically, the LNAM_REFS and FFPT_RIND fields. I modified ogr2ogr.java to
just skip these fields and started to find objects in the layers!

Now I am dealing with 'OGR Error: Unsupported geometry type', when loading
more than one geometry type into a shapefile, which I know is against the
rules, but it seems like the cpp ogr2ogr did a better job of handling these
sorts of errors. I believe this can be helped with some argument
manipulation...

SUMMARY: Thanks again for your help it was crucial to my progress. *This
issue can be considered resolved at this point, for my purposes.* However,
if anyone would care to continue a discussion on why these two fields are
failing and causing the layer translation to abort, or why it seems like
command-line ogr2ogr takes care of all these geometry issues for me and
ogr2ogr.java does not, I would certainly be interested in what they had to
say.

~Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110622/a5e79120/attachment.html


More information about the gdal-dev mailing list