[gdal-dev] S-57 layers export to ASCII
Even Rouault
even.rouault at mines-paris.org
Wed Nov 12 12:26:18 EST 2008
The command line switch to use for GEOMETRY=AS_XYZ is -lco and not -nlt
ogr2ogr -f "CSV" SOUNDG.csv SOUNDG.shp -lco GEOMETRY=AS_XYZ
And it will only work with a version of GDAL built from very recent sources
(it will come in GDAL 1.6.0)
Le Friday 07 November 2008 18:39:35 Donnet, Sebastien, vous avez écrit :
> Hi,
>
> I'm not sure I'm in the right spot to post this, but I couldn't find a
> better place, forgive me if it is not.
>
> 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.
>
> 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.
>
> 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).
>
> The way I went was to first extract all the layers of the S-57 file into
>
> shapefiles like this:
> >ogr2ogr -skipfailure outshp mys57file.000
>
> and then to convert the COALNE.shp and SOUNDG.shp into GMT ascii like
>
> this:
> >ogr2ogr -f "GMT" SOUNDG.gmt SOUNDG.shp
> >ogr2ogr -f "GMT" COALNE.gmt COALNE.shp
>
> That worked pretty well, since I can relatively easily read the field of
> the gmt files, and I got what I was looking for...
> but ! it is not a very "sexy" way I found, and I was wondering if there
> where no better ways to achieve this...
>
> I tried several things such as:
> >ogr2ogr -skipfailure -f "GMT" outgmt mys57file.000
>
> ERROR 1: Features without geometry not supported by GMT writer.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer DSID
>
> or:
> >ogr2ogr -select "COALNE,SOUNDG" -f "GMT" outgmt mys57file.000
>
> Field 'COALNE' not found in source layer.
> ERROR 1 : Terminating translation prematurely after failed
> translation of layer DSID
>
> or also tried with CSV file type (better files for me to read) such as:
> >ogr2ogr -f "CSV" SOUNDG.csv SOUNDG.shp -nlt GEOMETRY=AS_XYZ
>
> -nlt GEOMETRY=AS_XYZ: type not recognised
>
>
> 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.
>
> Any idea or suggestion will be appreciated, :-)
>
> thanks,
>
>
> S.
>
>
> The information contained in this e-mail is intended only for the
> individual or entity to whom it is addressed. Its contents (including any
> attachments) may contain confidential and/or privileged information. If you
> are not an intended recipient you must not use, disclose, disseminate, copy
> or print its contents. If you receive this e-mail in error, please notify
> the sender by reply e-mail and delete and destroy the message.
More information about the gdal-dev
mailing list