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

GDAL does not like 1-dimensional raster bands. WithinThe error message makes sense since the netcdf file, longitudes and latitudes are stored on 1D arrays. The main data is in 2D-tables, but unfortunately X stores tables of different size and Y swappeddimensions. If you run

gdalinfo ssh_grids_v1609_2014122612.nc >out2.txt

Youyou see that there are 5 subdatasets stored inside the file. Alternatively, you can use NASA GISS panoply to investigate the file, and maybe export its tables to CSV. Alternatively

To resize a subdataset, you can use the QGIS Netcdf browser pluginhave to loadrun either:

gdalwarp -of netCDF -ts 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o1.nc
gdal_translate -of netCDF -outsize 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o2.nc

for every dataset you are interested in.

Unfortunately, the X and Y coordinates in the 2D tables as raster (unfortunately still-tables are swapped), and.

You can translate them to tif files with this command line:

gdal_translate -of GTIFF NETCDF:"path/to/ssh_grids_v1609_2014122612"ssh_grids_v1609_2014122612.nc":SLA D:/Karten/netcdf/ssh.tif

the file looks like this:

enter image description here

toTo turn the image to the usual view, you might follow Making QGIS interpret coordinates as long-lat instead of lat-long?

So the full workflow is:

gdal_translate -of VRT NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh1.vrt
gdal_translate -of VRT -gcp 0 0 360 -80 -gcp 960 0 360 80 -gcp 0 2160 0 -80 -gcp 960 2160 0 80 ssh1.vrt ssh2.vrt
gdalwarp -r bilinear -t_srs EPSG:4326 ssh2.vrt ssh2.tif
gdal_translate -of VRT -a_ullr 0 80 360 -80 ssh2.tif ssh3.vrt
gdalwarp -t_srs WGS84 ssh3.vrt ssh.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

to get the right picture:

enter image description here


EDIT

It seems that adding the NETCDF: prefix and specifying the subdataset name solves the error message you get. This makes sense since the netcdf file stores tables of different size and dimensions.

So if you only want to change the resolution, you can run either of

gdalwarp -of netCDF -ts 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o1.nc
gdal_translate -of netCDF -outsize 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o2.nc

for every dataset you are interested in. The steps above are still necessary, if you want to combine the data with other GIS data when using GDAL-based GIS software.

GDAL does not like 1-dimensional raster bands. Within the netcdf file, longitudes and latitudes are stored on 1D arrays. The main data is in 2D-tables, but unfortunately X and Y swapped.

You can use NASA GISS panoply to investigate the file, and export its tables to CSV. Alternatively, you can use the QGIS Netcdf browser plugin to load the 2D tables as raster (unfortunately still swapped), and translate them to tif files with this command line:

gdal_translate -of GTIFF NETCDF:"path/to/ssh_grids_v1609_2014122612.nc":SLA D:/Karten/netcdf/ssh.tif

the file looks like this:

enter image description here

to turn the image to the usual view, you might follow Making QGIS interpret coordinates as long-lat instead of lat-long?

So the full workflow is:

gdal_translate -of VRT NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh1.vrt
gdal_translate -of VRT -gcp 0 0 360 -80 -gcp 960 0 360 80 -gcp 0 2160 0 -80 -gcp 960 2160 0 80 ssh1.vrt ssh2.vrt
gdalwarp -r bilinear -t_srs EPSG:4326 ssh2.vrt ssh2.tif
gdal_translate -of VRT -a_ullr 0 80 360 -80 ssh2.tif ssh3.vrt
gdalwarp -t_srs WGS84 ssh3.vrt ssh.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

to get the right picture:

enter image description here


EDIT

It seems that adding the NETCDF: prefix and specifying the subdataset name solves the error message you get. This makes sense since the netcdf file stores tables of different size and dimensions.

So if you only want to change the resolution, you can run either of

gdalwarp -of netCDF -ts 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o1.nc
gdal_translate -of netCDF -outsize 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o2.nc

for every dataset you are interested in. The steps above are still necessary, if you want to combine the data with other GIS data when using GDAL-based GIS software.

The error message makes sense since the netcdf file stores tables of different size and dimensions. If you run

gdalinfo ssh_grids_v1609_2014122612.nc >out2.txt

you see that there are 5 subdatasets stored inside the file. Alternatively, you can use NASA GISS panoply to investigate the file, and maybe export its tables to CSV.

To resize a subdataset, you have to run either:

gdalwarp -of netCDF -ts 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o1.nc
gdal_translate -of netCDF -outsize 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o2.nc

for every dataset you are interested in.

Unfortunately, the X and Y coordinates in the 2D-tables are swapped.

You can translate them to tif files with this command line:

gdal_translate -of GTIFF NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh.tif

the file looks like this:

enter image description here

To turn the image to the usual view, you might follow Making QGIS interpret coordinates as long-lat instead of lat-long?

So the full workflow is:

gdal_translate -of VRT NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh1.vrt
gdal_translate -of VRT -gcp 0 0 360 -80 -gcp 960 0 360 80 -gcp 0 2160 0 -80 -gcp 960 2160 0 80 ssh1.vrt ssh2.vrt
gdalwarp -r bilinear -t_srs EPSG:4326 ssh2.vrt ssh2.tif
gdal_translate -of VRT -a_ullr 0 80 360 -80 ssh2.tif ssh3.vrt
gdalwarp -t_srs WGS84 ssh3.vrt ssh.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

to get the right picture:

enter image description here

added 652 characters in body
Source Link
AndreJ
  • 77.1k
  • 5
  • 88
  • 163

GDAL does not like 1-dimensional raster bands. Within the netcdf file, longitudes and latitudes are stored on 1D arrays. The main data is in 2D-tables, but unfortunately X and Y swapped.

You can use NASA GISS panoply to investigate the file, and export its tables to CSV. Alternatively, you can use the QGIS Netcdf browser plugin to load the 2D tables as raster (unfortunately still swapped), and translate them to tif files with this command line:

gdal_translate -of GTIFF NETCDF:"path/to/ssh_grids_v1609_2014122612.nc":SLA D:/Karten/netcdf/ssh.tif

the file looks like this:

enter image description here

to turn the image to the usual view, you might follow Making QGIS interpret coordinates as long-lat instead of lat-long?

So the full workflow is:

gdal_translate -of VRT NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh1.vrt
gdal_translate -of VRT -gcp 0 0 360 -80 -gcp 960 0 360 80 -gcp 0 2160 0 -80 -gcp 960 2160 0 80 ssh1.vrt ssh2.vrt
gdalwarp -r bilinear -t_srs EPSG:4326 ssh2.vrt ssh2.tif
gdal_translate -of VRT -a_ullr 0 80 360 -80 ssh2.tif ssh3.vrt
gdalwarp -t_srs WGS84 ssh3.vrt ssh.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

to get the right picture:

enter image description here


EDIT

It seems that adding the NETCDF: prefix and specifying the subdataset name solves the error message you get. This makes sense since the netcdf file stores tables of different size and dimensions.

So if you only want to change the resolution, you can run either of

gdalwarp -of netCDF -ts 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o1.nc
gdal_translate -of netCDF -outsize 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o2.nc

for every dataset you are interested in. The steps above are still necessary, if you want to combine the data with other GIS data when using GDAL-based GIS software.

GDAL does not like 1-dimensional raster bands. Within the netcdf file, longitudes and latitudes are stored on 1D arrays. The main data is in 2D-tables, but unfortunately X and Y swapped.

You can use NASA GISS panoply to investigate the file, and export its tables to CSV. Alternatively, you can use the QGIS Netcdf browser plugin to load the 2D tables as raster (unfortunately still swapped), and translate them to tif files with this command line:

gdal_translate -of GTIFF NETCDF:"path/to/ssh_grids_v1609_2014122612.nc":SLA D:/Karten/netcdf/ssh.tif

the file looks like this:

enter image description here

to turn the image to the usual view, you might follow Making QGIS interpret coordinates as long-lat instead of lat-long?

So the full workflow is:

gdal_translate -of VRT NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh1.vrt
gdal_translate -of VRT -gcp 0 0 360 -80 -gcp 960 0 360 80 -gcp 0 2160 0 -80 -gcp 960 2160 0 80 ssh1.vrt ssh2.vrt
gdalwarp -r bilinear -t_srs EPSG:4326 ssh2.vrt ssh2.tif
gdal_translate -of VRT -a_ullr 0 80 360 -80 ssh2.tif ssh3.vrt
gdalwarp -t_srs WGS84 ssh3.vrt ssh.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

to get the right picture:

enter image description here

GDAL does not like 1-dimensional raster bands. Within the netcdf file, longitudes and latitudes are stored on 1D arrays. The main data is in 2D-tables, but unfortunately X and Y swapped.

You can use NASA GISS panoply to investigate the file, and export its tables to CSV. Alternatively, you can use the QGIS Netcdf browser plugin to load the 2D tables as raster (unfortunately still swapped), and translate them to tif files with this command line:

gdal_translate -of GTIFF NETCDF:"path/to/ssh_grids_v1609_2014122612.nc":SLA D:/Karten/netcdf/ssh.tif

the file looks like this:

enter image description here

to turn the image to the usual view, you might follow Making QGIS interpret coordinates as long-lat instead of lat-long?

So the full workflow is:

gdal_translate -of VRT NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh1.vrt
gdal_translate -of VRT -gcp 0 0 360 -80 -gcp 960 0 360 80 -gcp 0 2160 0 -80 -gcp 960 2160 0 80 ssh1.vrt ssh2.vrt
gdalwarp -r bilinear -t_srs EPSG:4326 ssh2.vrt ssh2.tif
gdal_translate -of VRT -a_ullr 0 80 360 -80 ssh2.tif ssh3.vrt
gdalwarp -t_srs WGS84 ssh3.vrt ssh.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

to get the right picture:

enter image description here


EDIT

It seems that adding the NETCDF: prefix and specifying the subdataset name solves the error message you get. This makes sense since the netcdf file stores tables of different size and dimensions.

So if you only want to change the resolution, you can run either of

gdalwarp -of netCDF -ts 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o1.nc
gdal_translate -of netCDF -outsize 480 1080 NETCDF:"ssh_grids_v1609_2014122612.nc":SLA o2.nc

for every dataset you are interested in. The steps above are still necessary, if you want to combine the data with other GIS data when using GDAL-based GIS software.

added 6 characters in body
Source Link
AndreJ
  • 77.1k
  • 5
  • 88
  • 163

GDAL does not like 1-dimensional raster bands. Within the netcdf file, longitudes and latitudes are stored on 1D arrays. The main data is in 2D-tables, but unfortunately X and Y swapped.

You can use NASA GISS panoply to investigate the file, and export its tables to CSV. Alternatively, you can use the QGIS Netcdf browser plugin to load the 2D tables as raster (unfortunately still swapped), and translate them to tif files with this command line:

gdal_translate -of GTIFF NETCDF:"path/to/ssh_grids_v1609_2014122612.nc":SLA D:/Karten/netcdf/ssh.tif

the file looks like this:

enter image description here

to turn the image to the usual view, you might follow Making QGIS interpret coordinates as long-lat instead of lat-long?

So the full workflow is:

gdal_translate -of VRT NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh1.vrt
gdal_translate -of VRT -gcp 0 0 0360 -80 -gcp 960 0 0360 80 -gcp 0 2160 -3600 -80 -gcp 960 2160 -3600 80 ssh1.vrt ssh2.vrt
gdalwarp -r bilinear -t_srs EPSG:4326 ssh2.vrt ssh2.tif
gdal_translate -of VRT -a_ullr 0 80 360 -80 ssh2.tif ssh3.tifvrt
gdalwarp -t_srs WGS84 ssh3.tifvrt ssh.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

to get the right picture:

enter image description here

GDAL does not like 1-dimensional raster bands. Within the netcdf file, longitudes and latitudes are stored on 1D arrays. The main data is in 2D-tables, but unfortunately X and Y swapped.

You can use NASA GISS panoply to investigate the file, and export its tables to CSV. Alternatively, you can use the QGIS Netcdf browser plugin to load the 2D tables as raster (unfortunately still swapped), and translate them to tif files with this command line:

gdal_translate -of GTIFF NETCDF:"path/to/ssh_grids_v1609_2014122612.nc":SLA D:/Karten/netcdf/ssh.tif

the file looks like this:

enter image description here

to turn the image to the usual view, you might follow Making QGIS interpret coordinates as long-lat instead of lat-long?

So the full workflow is:

gdal_translate -of VRT NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh1.vrt
gdal_translate -of VRT -gcp 0 0 0 -80 -gcp 960 0 0 80 -gcp 0 2160 -360 -80 -gcp 960 2160 -360 80 ssh1.vrt ssh2.vrt
gdalwarp -r bilinear -t_srs EPSG:4326 ssh2.vrt ssh2.tif
gdal_translate -a_ullr 0 80 360 -80 ssh2.tif ssh3.tif
gdalwarp -t_srs WGS84 ssh3.tif ssh.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

to get the right picture:

enter image description here

GDAL does not like 1-dimensional raster bands. Within the netcdf file, longitudes and latitudes are stored on 1D arrays. The main data is in 2D-tables, but unfortunately X and Y swapped.

You can use NASA GISS panoply to investigate the file, and export its tables to CSV. Alternatively, you can use the QGIS Netcdf browser plugin to load the 2D tables as raster (unfortunately still swapped), and translate them to tif files with this command line:

gdal_translate -of GTIFF NETCDF:"path/to/ssh_grids_v1609_2014122612.nc":SLA D:/Karten/netcdf/ssh.tif

the file looks like this:

enter image description here

to turn the image to the usual view, you might follow Making QGIS interpret coordinates as long-lat instead of lat-long?

So the full workflow is:

gdal_translate -of VRT NETCDF:"ssh_grids_v1609_2014122612.nc":SLA ssh1.vrt
gdal_translate -of VRT -gcp 0 0 360 -80 -gcp 960 0 360 80 -gcp 0 2160 0 -80 -gcp 960 2160 0 80 ssh1.vrt ssh2.vrt
gdalwarp -r bilinear -t_srs EPSG:4326 ssh2.vrt ssh2.tif
gdal_translate -of VRT -a_ullr 0 80 360 -80 ssh2.tif ssh3.vrt
gdalwarp -t_srs WGS84 ssh3.vrt ssh.tif -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

to get the right picture:

enter image description here

added 556 characters in body
Source Link
AndreJ
  • 77.1k
  • 5
  • 88
  • 163
Loading
added 178 characters in body
Source Link
AndreJ
  • 77.1k
  • 5
  • 88
  • 163
Loading
Source Link
AndreJ
  • 77.1k
  • 5
  • 88
  • 163
Loading