[gdal-dev] S-57 Driver WRONG Geometry

Bogdan Grama bogdan.grama at soft-union.ro
Thu May 27 02:12:01 EDT 2010


Dear all,

I'm using GDAL/OGR for reading and rendering ENC files in c#. Recently
i've discovered that for some ENC a feature geometry was badly decoded.

    ---->LAYER NAME = ROADWY
    ---->NAME_RCNM = (10:130,130,130,130,130,130,130,130,130,130)
    ---->NAME_RCID = (10:114,103,89,97,99,112,111,108,110,124)
    ----> TYPE  : wkbLineString
    ----> Geom  : LINESTRING (22.5659615 44.554194199999998,22.5652045
44.5531651,22.565431499999999 44.551777399999999,22.5663008
44.5510096,22.565618700000002 44.550082199999999,22.5654462
44.5495941,22.5637522 44.548679300000003,22.563407999999999
44.547728599999999,22.565408699999999
44.547119799999997,22.567032699999999 44.546393700000003,22.5667729
44.545651200000002,22.565761299999998 44.544027,22.5636273
44.5411638,22.562342099999999 44.540039800000002,22.559403
44.536748899999999,22.557911199999999 44.534543999999997,22.5566466
44.530951399999999,22.5563888 44.529523099999999,22.5549946
44.528591499999997,22.5541939 44.525933100000003,22.5526434
44.523788799999998,22.5670219 44.549351899999998,22.568407700000002
44.549145199999998,22.5329111 44.493582500000002,22.531871899999999
44.496433699999997,22.524960799999999
44.502708900000002,22.525470899999998 44.503191399999999,22.5295138
44.505221400000003,22.5331359 44.507771099999999,22.5362468
44.509275100000004,22.5408091 44.5115306,22.544131199999999
44.512737399999999,22.5461053 44.513267499999998,22.546569399999999
44.514995599999999,22.510513499999998 44.499248100000003,22.5158217
44.499421599999998,22.520606699999998
44.499890700000002,22.523095999999999
44.500945199999997,22.524960799999999
44.502708900000002,22.576765300000002 44.4773213,22.5769802
44.479661800000002,22.577548499999999
44.481585799999998,22.576243399999999
44.484254399999998,22.576583599999999
44.485509100000002,22.577508699999999 44.486599099999999,22.5769145
44.487933599999998,22.5708196 44.491083799999998,22.569402799999999
44.493083300000002,22.5692354 44.4958977,22.579960499999999
44.501314999999998,22.5831172 44.500742799999998,22.584523999999998
44.4999964,22.5848604 44.4999039,22.580137799999999
44.526185900000002,22.5825748 44.530118700000003,22.510796899999999
44.528525799999997,22.510890499999999 44.526797799999997,22.5076679
44.5223309)


After parsing the file with:
 OSGeo.GDAL.Gdal.SetConfigOption("OGR_S57_OPTIONS",
"RETURN_PRIMITIVES=ON,RETURN_LINKAGES=ON,LNAM_REFS=ON");

the result according with chained node topology (NAME_RCNM =
(10:130,130,130,130,130,130,130,130,130,130)) is:

ConnectedNode 114 - POINT (22.5659615 44.554194199999998)
Edge 114 - LINESTRING (22.5652045 44.5531651,22.565431499999999
44.551777399999999,22.5663008 44.5510096)
ConnectedNode 82  - POINT (22.565618700000002 44.550082199999999)

ConnectedNode 82  - POINT (22.565618700000002 44.550082199999999)
Edge 103 - LINESTRING (22.5654462 44.5495941,22.5637522
44.548679300000003,22.563407999999999
44.547728599999999,22.565408699999999
44.547119799999997,22.567032699999999 44.546393700000003,22.5667729
44.545651200000002,22.565761299999998 44.544027,22.5636273
44.5411638,22.562342099999999 44.540039800000002,22.559403
44.536748899999999,22.557911199999999 44.534543999999997,22.5566466
44.530951399999999,22.5563888 44.529523099999999,22.5549946
44.528591499999997,22.5541939 44.525933100000003)
ConnectedNode 98  - POINT (22.5526434 44.523788799999998)

ConnectedNode 82  - POINT (22.565618700000002 44.550082199999999)
Edge 89  - LINESTRING (22.5670219 44.549351899999998)
ConnectedNode 83  - POINT (22.568407700000002 44.549145199999998)

ConnectedNode 93  - POINT (22.5350702 44.491883799999997)
Edge 97  - LINESTRING (22.5329111 44.493582500000002,22.531871899999999
44.496433699999997)
ConnectedNode 94  - POINT (22.524960799999999 44.502708900000002)

ConnectedNode 94  - POINT (22.524960799999999 44.502708900000002)
Edge 99  - LINESTRING (22.525470899999998 44.503191399999999,22.5295138
44.505221400000003,22.5331359 44.507771099999999,22.5362468
44.509275100000004,22.5408091 44.5115306,22.544131199999999
44.512737399999999,22.5461053 44.513267499999998)
ConnectedNode 85  - POINT (22.546569399999999 44.514995599999999)

ConnectedNode 111 - POINT (22.5094658 44.4989464)
Edge 112 - LINESTRING (22.510513499999998 44.499248100000003,22.5158217
44.499421599999998,22.520606699999998
44.499890700000002,22.523095999999999 44.500945199999997)
ConnectedNode 94  - (22.524960799999999 44.502708900000002)

ConnectedNode 109 - POINT (22.576296200000002 44.464573399999999)
Edge 111 - LINESTRING (22.576765300000002 44.4773213,22.5769802
44.479661800000002,22.577548499999999
44.481585799999998,22.576243399999999
44.484254399999998,22.576583599999999
44.485509100000002,22.577508699999999 44.486599099999999,22.5769145
44.487933599999998,22.5708196 44.491083799999998,22.569402799999999
44.493083300000002)
ConnectedNode 102 - POINT (22.5692354 44.4958977)

ConnectedNode 103 - POINT (22.576376799999998 44.502952700000002)
Edge 108 - LINESTRING (22.579960499999999 44.501314999999998,22.5831172
44.500742799999998,22.584523999999998 44.4999964)
ConnectedNode 108 - POINT (22.5848604 44.4999039)

ConnectedNode 105 - POINT (22.5731362 44.512910499999997)
Edge 110 - LINESTRING (22.580137799999999 44.526185900000002)
ConnectedNode 107 - POINT (22.5825748 44.530118700000003)

ConnectedNode 117 - POINT (22.5093748 44.531118200000002)
Edge 124 - LINESTRING (22.510796899999999
44.528525799999997,22.510890499999999 44.526797799999997)
ConnectedNode 119 - POINT (22.5076679 44.5223309)


Now this is correct: 1 feature with 10 distinct linestrings. What do you
think? Can this be fix? I can provide sample ENC and screenshots with
rendered image.

Best regards,--

Bogdan GRAMA



More information about the gdal-dev mailing list