0

I want to project a netcdf file projected with the NSIDC Sea Ice Polar Stereographic North (EPSG:3411) to the WGS84 (EPSG:4326). The NETCDF data input file comes from Copernicus Marine Model.

I use gdalwarp on Windows (GDAL 3.0.2, released 2019/10/28) to perform this projection change.

gdalwarp -t_srs EPSG:4326 -te -180 -90 180 90 -of NETCDF in.nc out.nc

The result file out.nc seems to have the correct EPSG:4326 projection but there are no data inside -32767 (no data value from the in file)

enter image description here

I tried to : - Extract the chla subdataset specifying the input file as NETCDF:"chla":in.nc but it does not change anything - Change the -te values : i always have the issue

  • Specify directly the source EPSG with -s_srs "EPSG:3411" and with -s_srs "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs" : i always have the issue

  • Specify the interpolation method, bilinear for instance : i always have the issue

What is strange is that in the in.nc when i check in Panoply the No Datavalue are Nan (and the internal code is -32767 and the scale factor and offset are specified in the metadata) whereas in the out.nc the grid displays Nan values directly as -32767 and the scale factor and addoffset are not specified.

I also tried the advises specified here : Re-projecting from Polar projection to EPSG:4326?

Below find the log of the projection :

enter image description here

enter image description here

After additional investigations it seems that the NETCDF original file may contain bad information for the the extent compared to unit in m defined in the crs. Indeed it seems that extent is defined in 100 of km.

enter image description here

Moreover when i compare the PROJCRS between the failing netcdf file and a grib file with EPSG:3411 that i manage to convert into EPSG:4326, i notice that the EPSG Reference is 4326 for the failing one whereas it is different for the good grib file even if the netecdf file specifies the Polar Stereographic for the Conversion. Any ideas ? enter image description here

1 Answer 1

1

Extracting one subdataset succeeds

gdal_translate -of NetCDF NETCDF:"nc.nc":chla nc_sub.nc

Conversion of this extracted subdataset into GeoTIFF succeeds

gdal_translate -of GTiff NETCDF:"nc.nc":chla nc_sub.tif

Subset files as NetCDF and GeoTIFF can be opened with QGIS

enter image description here

Conversion of the GeoTIFF that is good for QGIS from EPSG:3411 into EPSG:4326 fails:

gdalwarp -s_srs epsg:3411 -t_srs epsg:4326 nc_sub.tif nc_sub_wgs84.tif
Creating output file that is 1071P x 0L.
ERROR 1: Attempt to create 1071x0 dataset is illegal,sizes must be larger than zero.

Also if I change the CRS of the projection in QGIS into EPSG:4326 the image is shown as one pixel high line. I am not well aware about the polar coordinate reference systems. Do you know that transformation between EPSG:3411 and EPSG:4326 is valid?

2
  • Hi, Thanks for the investigation. I was also able to transform to Geotiff as you did but i had the same result i.e the issue you mentionned. Hence i tried to "force" the Geotiff extent with gdal_translate -a_ullr -3806250 3806250 3806250 -5506250 -a_srs "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs" -a_nodata -32767 -b 1 NETCDF:"in.nc":chla out.tif. Commented Jan 15, 2020 at 16:11
  • It allowed me after to call the gdalwarp without having the issue (illegal size) :gdalwarp -overwrite -t_srs EPSG:4326 -te -180 60 180 90 out.tif out_4326_10.tif Creating output file that is 2270P x 189L. I also added the -te option. Finally i have got tif in EPSG 4326 but it does not seem good at all...(bad projection). Normally yes it is possible to go from 3411 to 4326. Commented Jan 15, 2020 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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