1

I'm having a problem with resampling ETOPO NetCDF GRD to a bigger pixelsize for using it with Generic Mapping Tools.

I'm using gdal_warp for the resampling (just for testing with pixelsize of 1°):

gdalwarp -overwrite -s_srs EPSG:4326 -tr 1 1 -r near -of netCDF input_etopo.grd etopo_resampled.nc

but the output grd gets many null-values. If I use the geotiff of etopo the output is the same.

Does anybody had the same problem and knows how to prevent it? Different resampling methods doesn't solved the problem.

Etopo-Input: Etopo-Input

Etopo-Resampled: enter image description here

  • Could you point where to get a test image? – user30184 Oct 28 '15 at 10:17
  • Are you referring to the ETOPO1 which are delivered in 1 arc-minute? – Kersten Oct 28 '15 at 10:20
  • yes I use the ETOPO1. I have to resample it because I'm working on an automatic Tsunami-Report with gmt. My script calculates the perfect pixelsize in regard to the extent and uses one of some preserved resampled Etopo which matches the best for that pixelsize. What do you mean to pointing out where to get a test image? – Basti Oct 28 '15 at 10:26
  • found a solution with gmt grdsample. However the output grd is not visible in QGIS for example, but for printing with gmt it works. But if somebody have a solution for the problem obove I would still be interested – Basti Oct 28 '15 at 10:59
0

I could reproduce your error when I directly converted GRD -> netCDF. With the command you gave.

What works for me is GRD -> GTiff -> netCDF. I suspect there is some kind of error in the GDAL netCDF driver, which I couldn't circumvent even with -srcnodata -dstnodata and different creation options.

gdalwarp -s_srs EPSG:4326 -tr 1 1 -r near -of GTiff input_etopo.grd etopo_resampled.tif

gdal_translate -of netCDF etopo_resampled.tif etopo_resampled.nc

enter image description here

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.