[GIS] Reprojecting netcdf file using gdalwarp

coordinate systemgdalwarputm

My netcdf file coonsists of radar rainfall data in aeqd projection (azimuthal equidistant projection). Each file consists of 5952 timestamps(7.5 minutes resolution) of rainfall values for 1kmx1km grids.

I want to reproject from aeqd to UTM33 using gdalwarp in commandline as follows.

gdalwarp -t_srs "+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" -of netCDF C:/Radar/precip_aeqd-1000.201408.nc C:/Radar/RadarPrecip_UTM33proj.nc

I get error message that

Input file C:/Radar/precip_aeqd-1000.201408.nc has no raster bands.

Why do I get this error message?

I want to get output as reprojected netcdf file with utm33 1kmx1km grids.

Best Answer

I got it working in two steps for the first band:

gdal_translate -a_ullr -240500 240500 239500 -239500 -a_srs "+proj=aeqd +lat_0=59.458925 +lon_0=10.564472 +R=6371000 +x_0=0 +y_0=0 +units=m +no_defs" -a_nodata 9.96921e+036 -b 1 HDF5:"precip_aeqd-1000.201408.nc"://equivalent_reflectivity_factor precip-aeqd-1.tif
gdalwarp -overwrite -t_srs EPSG:25833 -tr 1000 1000 precip-aeqd.tif precip-utm-1.tif

This does not use the geoloc information in subdataset 2 and 3, but the corner coordinates from those subdatasets, converted to aeqd with

cs2cs +init=epsg:4326 +to +proj=aeqd +lat_0=59.458925 +lon_0=10.564472 +R=6371000 +x_0=0 +y_0=0 +units=m +no_defs corners.txt >aeqd.txt 

and added 500m offset from mid cell to the edge. I omitted datum=WGS84 from the projection because this conflicts with the given radius.

This is my result, with the corner points from the subdatasets 2 and 3:

enter image description here

For all 5545 bands, you better use a vrt file:

gdal_translate -of VRT -a_ullr -240500 240500 239500 -239500 -a_srs "+proj=aeqd +lat_0=59.458925 +lon_0=10.564472 +R=6371000 +x_0=0 +y_0=0 +units=m +no_defs" -a_nodata 9.96921e+036 HDF5:"precip_aeqd-1000.201408.nc"://equivalent_reflectivity_factor precip-aeqd.vrt
gdalwarp -of GTiff -co COMPRESS=LZW -t_srs EPSG:25833 -tr 1000 1000 precip-aeqd.vrt precip-utm.tif

but the resulting tif is 2.4GB even with compression.

Related Question