Skip to main content
added 99 characters in body
Source Link
AndreJ
  • 77.1k
  • 5
  • 88
  • 163

There seems to be a bug in the data. Ncdump reads:

netcdf \3a-day {
dimensions:
    AD = 2 ;
    chn = 2 ;
    nlon = 1440 ;
    nlat = 536 ;

and Panolpy plots it correctly, while exporting to tif with GDAL returns a 536x1440 raster with coordinates flipped. So you can use this workaround:

gdal_translate -of VRT -gcp -67 180 180 -67 -gcp -67 -180 -180 -67 -gcp 67 180 180 67 -gcp 67 -180 -180 67  3a-day.nc tmp.vrt
gdalwarp -t_srs EPSG:4326 tmp.vrt warpout.tif
gdal_translate -a_ullr -180 67 180 -67 warpout.tif 3a-day.tif

Please check the result with a dataset that has an uneven placement of data around the world.

See also http://osgeo-org.1560.x6.nabble.com/gdal-dev-Netcdf-coordinates-swapped-td5381627.html for a reply from the GDAL dev's.

There seems to be a bug in the data. Ncdump reads:

netcdf \3a-day {
dimensions:
    AD = 2 ;
    chn = 2 ;
    nlon = 1440 ;
    nlat = 536 ;

and Panolpy plots it correctly, while exporting to tif with GDAL returns a 536x1440 raster with coordinates flipped. So you can use this workaround:

gdal_translate -of VRT -gcp -67 180 180 -67 -gcp -67 -180 -180 -67 -gcp 67 180 180 67 -gcp 67 -180 -180 67  3a-day.nc tmp.vrt
gdalwarp -t_srs EPSG:4326 tmp.vrt warpout.tif
gdal_translate -a_ullr -180 67 180 -67 warpout.tif 3a-day.tif

Please check the result with a dataset that has an uneven placement of data around the world.

There seems to be a bug in the data. Ncdump reads:

netcdf \3a-day {
dimensions:
    AD = 2 ;
    chn = 2 ;
    nlon = 1440 ;
    nlat = 536 ;

and Panolpy plots it correctly, while exporting to tif with GDAL returns a 536x1440 raster with coordinates flipped. So you can use this workaround:

gdal_translate -of VRT -gcp -67 180 180 -67 -gcp -67 -180 -180 -67 -gcp 67 180 180 67 -gcp 67 -180 -180 67  3a-day.nc tmp.vrt
gdalwarp -t_srs EPSG:4326 tmp.vrt warpout.tif
gdal_translate -a_ullr -180 67 180 -67 warpout.tif 3a-day.tif

Please check the result with a dataset that has an uneven placement of data around the world.

See also http://osgeo-org.1560.x6.nabble.com/gdal-dev-Netcdf-coordinates-swapped-td5381627.html for a reply from the GDAL dev's.

Source Link
AndreJ
  • 77.1k
  • 5
  • 88
  • 163

There seems to be a bug in the data. Ncdump reads:

netcdf \3a-day {
dimensions:
    AD = 2 ;
    chn = 2 ;
    nlon = 1440 ;
    nlat = 536 ;

and Panolpy plots it correctly, while exporting to tif with GDAL returns a 536x1440 raster with coordinates flipped. So you can use this workaround:

gdal_translate -of VRT -gcp -67 180 180 -67 -gcp -67 -180 -180 -67 -gcp 67 180 180 67 -gcp 67 -180 -180 67  3a-day.nc tmp.vrt
gdalwarp -t_srs EPSG:4326 tmp.vrt warpout.tif
gdal_translate -a_ullr -180 67 180 -67 warpout.tif 3a-day.tif

Please check the result with a dataset that has an uneven placement of data around the world.