ogrinfo, ogr2ogr for S57 charts

151 Views Asked by At

I am trying to convert S57 charts to another file format with ogr2ogr, but I cannot get it to work.

Ogrinfo and ogr2ogr report this error:

ISO8211: Didn't find field terminator, read one more byte.
ERROR 1: Not enough byte to initialize field `SG3D'.

ogrinfo works if I have export S57_PROFILE iw without having s57objectclasses_iw.csv and s57attributes_iw.csv in the same folder. However, if I don’t have the iw profile set or I have the two files in the directory, I get an error. Also, ogr2ogr always gives the same error and I couldn’t figure out how to fix it.

I can use ogrinfo with the layer name (e.g. Point) and it extracts the contents:

ogrinfo --debug ON --config S57_PROFILE iw -ro  ENC_ROOT/FI/FI5SAI5A/1/0/FI5SAI5A.000 Point

S57: The following S57 options are being set:
S57:     SPLIT_MULTIPOINT=ON
S57:     ADD_SOUNDG_DEPTH=ON
GDAL: GDALOpen(ENC_ROOT/FI/FI5SAI5A/1/0/FI5SAI5A.000, this=0x13a813a80) succeeds as S57.
ISO8211: Didn't find field terminator, read one more byte.
ERROR 1: Not enough byte to initialize field `SG3D'.
S57: Applying feature updates from ENC_ROOT/FI/FI5SAI5A/1/1/FI5SAI5A.001.
S57: Applying feature updates from ENC_ROOT/FI/FI5SAI5A/1/2/FI5SAI5A.002.
S57: Applying feature updates from ENC_ROOT/FI/FI5SAI5A/1/3/FI5SAI5A.003.
INFO: Open of `ENC_ROOT/FI/FI5SAI5A/1/0/FI5SAI5A.000'
      using driver `S57' successful.

Layer name: Point
Geometry: Point
...

It seems that ogrinfo also applied the updates. So would it be safe to parse the features with a script from ogrinfo response?

OGRFeature(Point):0
  RCID (Integer) = 1
  PRIM (Integer) = 1
  GRUP (Integer) = 2
  OBJL (Integer) = 119
  RVER (Integer) = 1
  AGEN (Integer) = 160
  FIDN (Integer) = 33707
  FIDS (Integer) = 529
  LNAM (String) = 00A0000083AB0211
  POINT (28.0155887 63.0110526)

0

There are 0 best solutions below