Opened 6 years ago

Closed 6 years ago

#3881 closed enhancement (fixed)

S57 driver: add support for Dutch inland ENCs

Reported by: hogendrr Owned by: warmerdam
Priority: normal Milestone: 1.9.0
Component: OGR_SF Version: 1.7.3
Severity: normal Keywords: S57

Description (last modified by hogendrr)

Dutch inland ENCs are encoded in a slightly different way than most (maritime) ENCs. They are, however, compliant with the IHO S57 3.1 specification. The difference is that in a vector record (section 7.7 of the S57 spec), a line or polygon feature can be encoded in more than one way: one SG2D record with repeating rows of coordinates or a repeating series of SG2D records with one row of coordinates (or even a combination thereof). The current (1.7.3) driver only supports the former encoding. This patch adds support for both encodings. Tested against inland ENCs at and several maritime ENCs

Attachments (1)

gdal-1.7.3-s57-reader_support_multiple_fields.patch (41.8 KB) - added by hogendrr 6 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 6 years ago by hogendrr

Description: modified (diff)

comment:2 Changed 6 years ago by Even Rouault

Component: defaultOGR_SF
Milestone: 1.9.0
Resolution: fixed
Status: newclosed

Patch applied. A bit substantial, but I've checked that it doesn't change the output of ogrinfo against various S57 ENC charts : all the US region charts, an australian sample, samples from and it actually fixes the decoding of some of the charts available on the FTP site, such as that one :

r22458 /trunk/gdal/ogr/ogrsf_frmts/s57/ (s57.h s57reader.cpp): OGR S57: add support for Dutch inland ENCs (#3881)

comment:3 Changed 6 years ago by Even Rouault

r22459 /trunk/autotest/ogr/ Test decoding of Dutch inland ENCs (#3881)

comment:4 Changed 6 years ago by Even Rouault

r22465 /trunk/gdal/ogr/ogrsf_frmts/s57/s57.h: S57: revert change for MAX_ATTRIBUTES done in r22458. It is not correct since iAttr and panAttrIndex are GInt16 ( #3881 )

comment:5 Changed 6 years ago by warmerdam

Resolution: fixed
Status: closedreopened

Dear Frank,

In commit #21684 s57classregistrar.cpp was changed: warmerdam: avoid a variety of warnings for MSVC In particular, the types of iAttr and panAttrIndex[] were changed from int to GInt16. The corresponding types in s57reader.cpp were not touched though. Some manufacturers and some administrations use attributes with an index, above the present MAX_ATTRIBUTES 25000, even up to 65535. This could be accommodated by using a type of GUInt16, rather than the GInt16, since indexes are usually >=0. Is there any objection to changing the type to unsigned (I am thinking of MSVC, which I do not have)? Regards,

Rene Hogendoorn

comment:6 Changed 6 years ago by warmerdam

Resolution: fixed
Status: reopenedclosed

I have adjusted things to use GUInt16 and a limit of 65536 attributes in trunk (r22469).

Note: See TracTickets for help on using tickets.