[gdal-dev] S57 questions

Frank Warmerdam warmerdam at pobox.com
Tue Dec 15 22:26:16 EST 2009


ogr user wrote:
> I wonder if anyone here with a good knowledge of S57 format internals
> can help me out on this issue.
> 
> OGR S57 parser seems to work quite well with most charts in NOAA ENC
> data set. However, I found a feature on one of the charts that puzzles
> me (to be specific, the chart is US5CA92M, the feature RCID is 1167 in
> current chart edition).
> 
> This is a polygon-based feature which is defined such that, as read by
> OGR, the outer polygon ring does not enclose inner rings (it is
> essentially "on the side"). The first inner ring is what you would
> consider the outer ring in OGR definition, if you were to visualize this
> polygon. This in turn causes all sorts of issues (in particular in any
> code that assumes the entire polygon to be enclosed in the outer ring).
> 
> So, my question is - is it that S57 standard allows for multiple outer
> rings for polygons and so this is not handled in OGR because OGRPolygon
> is defined that way? Is it an error in S57 data, something that chart
> makers did? Or is it, perhaps, something in DDF encoding that is not
> read correctly by the iso8211 module?
> 

Mike,

The S-57 driver uses OGRBuildPolygonFromEdges() to form the set of lines
into a polygon.  No effort is currently made to properly represent
exterior vs. interior rings as is required by the simple features geometry
specification.

So, I believe this is a bug of the S-57 driver and OGRBuildPolygonFromEdges()
function.  In OGRBuildPolygonFromEdges() I see this comment:

// Eventually we should at least identify the external ring properly,
// perhaps even ordering the direction of rings, though this isn't
// required by the OGC geometry model.

You might want to file a ticket on this issue, though I can't say when the
issue will be fixed.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list