<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>I'm not sure I'm in
the right spot to post this, but I couldn't find a better place,
</FONT></SPAN><SPAN class=726200117-07112008><FONT face=Arial size=2>forgive me
if it is not. </FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>I'm trying to export
2 layers from a S-57 ENC (Electronic Nautical Chart) into a "human readable"
format, such as an ASCII or text file like: X,Y,Z
coordinates.</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>Basically,
the "end-goal" is to create a DEM (Digital Elevation Model) of the
sea-floor to run numerical models (such as waves and currents) on it.
</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>To get this, what I
needed was to extract the layers "COALNE" and "SOUNDG" from my S-57 nautical
chart, and have them as 2 ASCII or text files with : X and Y coordinates (for
the coastline) and X, Y and Z coordinates (for the depth or
sounding).</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>The way I went was
to first extract all the layers of the S-57 file into shapefiles like
this:</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>>ogr2ogr
-skipfailure outshp mys57file.000</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>and then
to convert the COALNE.shp and SOUNDG.shp into GMT ascii like
this:</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>>ogr2ogr -f "GMT"
SOUNDG.gmt SOUNDG.shp</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>>ogr2ogr -f "GMT"
COALNE.gmt COALNE.shp</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>That worked pretty
well, since I can relatively easily read the field of the gmt
files, and I got what I was looking for... </FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>but ! it is not
a very "sexy" way I found, and I was wondering if there where no better ways to
achieve this...</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>I tried several
things such as: </FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>>ogr2ogr
-skipfailure -f "GMT" outgmt mys57file.000</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>ERROR 1: Features
without geometry not supported by GMT writer.</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>ERROR 1: Terminating
translation prematurely after failed</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>translation of layer
DSID</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>or:
</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>>ogr2ogr -select
"COALNE,SOUNDG" -f "GMT" outgmt mys57file.000</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>Field 'COALNE' not
found in source layer.</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>ERROR 1 :
Terminating translation prematurely after failed</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>translation of layer
DSID</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>or also tried with
CSV file type (better files for me to read) such as:</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>>ogr2ogr -f
"CSV" SOUNDG.csv SOUNDG.shp -nlt GEOMETRY=AS_XYZ</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>-nlt
GEOMETRY=AS_XYZ: type not recognised</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial size=2>Some of those
attempt might look a little stupid and I may have made some writing errors,
but please forgive me, I'm quite a beginner with OGR and GDAL great library
tools.</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2>Any idea or suggestion will be appreciated,
:-)</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2>thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=726200117-07112008><FONT face=Arial
size=2>S.</FONT></SPAN></DIV></BODY></HTML>
<table><tr><td bgcolor=#ffffff><font color=#000000>The information contained in this e-mail is intended only for the individual or entity to whom it is addressed. <br>
Its contents (including any attachments) may contain confidential and/or privileged information. <br>
If you are not an intended recipient you must not use, disclose, disseminate, copy or print its contents. <br>
If you receive this e-mail in error, please notify the sender by reply e-mail and delete and destroy the message.<br>
</font></td></tr></table>