4

I have been looking for it for a while but couldn't find what exactly I need.

I have WRF outputs in NETCDF format and I want to convert them to Geotiffs with gdalwarp.

I think my -s_srs should be this one because I used lambert : http://spatialreference.org/ref/sr-org/29/ and my -t_srs should be this one since I want albers : http://spatialreference.org/ref/sr-org/6630/

By the way I want the QFX subdataset.

When I do this I receive an error:

gdalwarp NETCDF:wrfout_d01_2007-06-01:QFX -s_srs "+proj=lcc +lat_1=33 +lat_2=45 +lat_0=40 +lon_0=-97 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" -t_srs "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs" -tr 12000 12000 -of GTIFF output.tiff 

and the error is this:

Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
ERROR 1: Unable to compute a transformation between pixel/line
and georeferenced coordinates for NETCDF:wrfout_d01_2007-06-01:QFX.
There is no affine transformation and no GCPs.

So it requires some GCP but I do not know how to provide them. Also the latitude and longitude is in the NETCDF as subdatasets.

  • 1
    Ultimately the GCPs are those long/lat arrays, but you may not need any "warping" to re-establish the original LCC projection. Can you point to an example file somewhere? If the creators have smashed/lost the original projection sometimes you can recover with a bit of detective work, or it may be as simple as re-assigning it with gdal_translate's arguments "-a_srs" and "-a_ullr". If you think the data is in LCC but it ships with longlat arrays, then there's a disconnect in there somewhere. – mdsumner Nov 22 '14 at 22:55
  • 1
    Thank you very much. I solved the problem with -a_ullr option in 2 steps. First I used: gdal_translate -of Gtiff -a_ullr -106.47828674316406 44.88469696044922 -93.026123046875 37.8767204284668 -a_srs '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' NETCDF:wrfout_d01_2007-06-01:QFX output.tiff then I used gdalwarp -s_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" -t_srs "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs" -tr 12000 12000 output.tiff albers_output.tiff and it worked. Thank you very much. – user2515090 Nov 23 '14 at 20:01
2

Answer from the comments:

gdal_translate -of Gtiff -a_ullr -106.47828674316406 44.88469696044922 -93.026123046875 37.8767204284668 -a_srs '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' NETCDF:wrfout_d01_2007-06-01:QFX output.tiff
gdalwarp -s_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" -t_srs "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs" -tr 12000 12000 output.tiff albers_output.tiff

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.