[FWTools] S-57 ring winding direction

Frank Warmerdam warmerdam at pobox.com
Mon Feb 23 13:45:38 EST 2009

Lim Chee Kiang wrote:
> Hi Frank,
> I extracted coordinates of features from a s57 file using the dumpReadable
> function with default settings. However i am not able to figure out how the
> coordinates (latitude and longitude) are ordered and whether they are
> oriented clockwise or anticlockwise. Can you shed some light on that? Do
> linestrings have the same order?
> I need to know the order and orientation to use some triangulate functions
> to decompose the polygons to primitives.


You should not depend on the winding direction of the outer and inner rings
of polygon geometries read from S-57 format.

There is an isClockwise() method available on the OGRLinearRing class,
as well as a reverseWindingOrder().  So you could investigate the winding
order of outer and inner rings of polygons and correct them to your needs.
But you should not trust them to have any particular winding direction as
they are read.

 > I noticed sounding features are all multipoints. Am i right to say that the
 > third value for each triplet are simply depths?

Yes, the Z values are the depths.

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 FWTools mailing list