2

I need to extract a DEM of a waterbody from a netCDF file so I can ultimately convert the DEM into xyz format. I'm not sure how to go about doing this, and so far, I have tried to create raster layers of the DEM in ArcGIS. However, I'm not sure if this is the best approach to obtain the data in xyz format.

If anyone could provide some ideas about how I would go about handling this conversion I would appreciate it.

3

You can use GDAL to transform driectly from NetCDF to ASCII XYZ with the gdal_translate command. Start with gdalinfo to get the name of the band to extract (it will look something like NETCDF:"filename.nc":dem_bnds) to pass as the dataset, for example:

gdal_translate -of XYZ NETCDF:"filename.nc":dem_bnds dem.xyz
  • I have downloaded gebco bathymetry data. but when I ran the command in GDAL its returning an error. ":dem_bnds is a netCDF file, but dem_bnds is not a variable" – Devils Dream Feb 10 '13 at 9:42
  • @DevilsDream What was the output from gdalinfo? If you can, could you please post it online somewhere, for example pastebin? – om_henners Feb 10 '13 at 22:30
1

I'm doing the same thing, converting the GEBCO 2019.nc to an xyz for further processing. I'm using gdal via qgis tools, gdal2xyz. The interface is a little more intuitive vice command line. The conversion (elevation layer for z conversion) is Band 1. (default on my instance). The resulting .csv can be processed in any number of downstream tools

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.