[gdal-dev] reprojection and clip of a netCDF

Ottavio Cavalcanti ott.cavalcanti at gmail.com
Fri Mar 15 09:57:49 PDT 2019


Hello,

I'd like to reproject a netCDF file through the command:

*gdalwarp -t_srs '+proj=lcc +units=m +a=6370000.0 +b=6370000.0 +lat_1=30.0
+lat_2=60.0 +lat_0=39.51 +lon_0=-120.0 +x_0=0 +y_0=0 +k_0=1.0
+nadgrids=@null +wktext  +no_defs' -of netCDF
NETCDF:"cut_wrf2d_d01_CTRL_EU10_200010-200012.nc":EU10 reprj_EU10.tif*

and then I tried clip the tiff file using a shapefile:

gdalwarp -q -cutline d01_domain_4km.shp -crop_to_cutline -of Gtiff
reprj_EU10.tif clip_EU10.tif

But I have got the following error:

*ERROR 1: Cannot compute bounding box of cutline.*

This is because the reprojected file (reprj_EU10.tif) is not in the right
position on the map.  Its lower left corner is in the origin (0,0) which
aren't the right coordinates.
I have tried with another command too:

*gdal_translate -a_srs d01_domain_4km.prj -of netCDF
NETCDF:"cut_wrf2d_d01_CTRL_EU10_200010-200012.nc":EU10 reprj_EU10.tif*

But I got the same error of the first attempt. I don't have any idea of how
to solve this problem.

Thanks.

Ottavio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20190315/dc4d7fb4/attachment.html>


More information about the gdal-dev mailing list