0

I have this NetCDF file of the Greenland ice sheet velocities but the coordinate system is NSIDC Sea Ice Polar Stereographic North (y: -655750 to -3355750 and x: -639750 to 855750 meters). I wanted to project these data to WGS84 lat/lon degrees but got the following error:

gdalwarp -overwrite -s_srs "+proj=stere +lat_0=90 +lat_ts=70
+lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs" -t_srs EPSG:4326 lgreenland_vel_cci.nc greenland_latlon.nc

Warning: The target file has a 'nc' extension, which is normally used by the GMT, netCDF drivers, but the requested output driver is GTiff. Is it really what you want? 
ERROR 1: Input file lgreenland_vel_cci.nc has no raster bands.

For the ones interested, here is some info about the netcdf (it can also be downloaded from the site of the CCI http://products.esa-icesheets-cci.org/products/downloadlist/IV/):

Variables:
    crs                                
           Size:       1x1
           Dimensions: 
           Datatype:   int32
           Attributes:
                       grid_mapping_name                     = 'polar_stereographic'
                       standard_parallel                     = 70
                       straight_vertical_longitude_from_pole = -45
                       false_easting                         = 0
                       false_northing                        = 0
                       unit                                  = 'meter'
                       latitude_of_projection_origin         = 90
                       spatial_ref                           = 'PROJCS["WGS 84 / NSIDC Sea Ice Polar Stereographic North",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Polar_Stereographic"],PARAMETER["latitude_of_origin",70],PARAMETER["central_meridian",-45],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3413"]]'
    y                                  
           Size:       5401x1
           Dimensions: y
           Datatype:   double
           Attributes:
                       units         = 'm'
                       axis          = 'Y'
                       long_name     = 'y coordinate of projection'
                       standard_name = 'projection_y_coordinate'
    x                                  
           Size:       2992x1
           Dimensions: x
           Datatype:   double
           Attributes:
                       units         = 'm'
                       axis          = 'X'
                       long_name     = 'x coordinate of projection'
                       standard_name = 'projection_x_coordinate'
land_ice_surface_velocity_magnitude
       Size:       2992x5401
       Dimensions: x,y
       Datatype:   single
       Attributes:
                   _FillValue   = 3.402823466385289e+38
                   units        = 'meter day-1'
                   description  = 'magnitude of horizontal ice velocity'
                   grid_mapping = 'crs'
                   coordinates  = 'y x'
1

We can do one error at a time:

Warning: The target file has a 'nc' extension, which is normally used by the GMT, netCDF drivers, but the requested output driver is GTiff. Is it really what you want?

If you don't want a geotiff output, which is the default. You need to set a format so add:

-of GMT

It might be a vector file as well as suggested in the comments.

Try ogr2ogr:

ogr2ogr -f netCDF -s_srs "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs" -t_srs EPSG:4326 greenland_latlon.nc lgreenland_vel_cci.nc

  • Hi, thanks for the fast reply. I tried adding the -of in the command line, now that is gone but still gives the other error. This is from gdalinfo: – Yoni Verhaegen Jul 5 at 9:54
  • Try ogr2ogr as suggested in the comments. – HeikkiVesanto Jul 5 at 11:15
  • This worked fine: gdalwarp -overwrite -of netCDF -s_srs "+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs" -t_srs EPSG:4326 NETCDF:"lgreenland_vel_cci.nc":land_ice_surface_velocity_magnitude greenland_latlon.nc – Yoni Verhaegen Jul 5 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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