1

I have a dataset in nc format (Daymet weather data) using gdal translate. I convert them to GeoTIFF, then using GDALwarp I try to change the coordinate system type to geographic because I want to have latitude and longitude. It does not give me the right lat and lon. I am not sure what I am doing wrong

gdal_translate -of GTiff -a_srs "+proj=aea +datum=WGS72 +lat_1=25 n +lat_2=60n +lat_0=42.5n +lon_0=100w" NETCDF:"prcp_11742_2015.nc":prcp prcp_11742_2015_aea_lat.tif

then

gdalwarp -t_srs EPSG:4326 prcp_11742_2015_aea_lat.tif prcp_11742_2015_aea_lat001.tif

the source file is in this format

The North American Daymet projection system and parameters: 
Projection System:  Lambert Conformal Conic
Parameters: 
projection units:   meters 
datum (spheroid):   WGS_84 
1st standard parallel:  25 deg N 
2nd standard parallel:  60 deg N 
Central meridian:   100 deg W
Latitude of origin: 42.5 deg N 
false easting:      0 
false northing:     0

The lcc is the projection of source file and i I wanted to change the projection to the equal distance area too that is why I used the proj =aea, also one problem i have is i want to have the lat/lon in the geotiff file but i do not see the right lat/lon in the geotiff file. the corners are as follow but after the conversion

Corner Coordinates:
Upper Left  (  158000.000,  -45000.000) ( 97d59'54.18"W, 42d 3'26.22"N)
Lower Left  (  158000.000, -263000.000) ( 98d 3'45.07"W, 40d 0' 2.98"N)
Upper Right (  326000.000,  -45000.000) ( 95d52'21.59"W, 41d59'56.50"N)
Lower Right (  326000.000, -263000.000) ( 96d 0'17.11"W, 39d56'40.19"N)
Center      (  242000.000, -154000.000) ( 96d59' 5.65"W, 41d 0'18.37"N)

i have this

Corner Coordinates:
Upper Left  (-126.0746130,  -0.4065400) (126d 4'28.61"W,  0d24'23.54"S)
Lower Left  (-126.0746130,  -2.3815368) (126d 4'28.61"W,  2d22'53.53"S)
Upper Right (-124.5595470,  -0.4065400) (124d33'34.37"W,  0d24'23.54"S)
Lower Right (-124.5595470,  -2.3815368) (124d33'34.37"W,  2d22'53.53"S)
Center      (-125.3170800,  -1.3940384) (125d19' 1.49"W,  1d23'38.54"S)
  • 1
    Just checking--why are you using WGS72 in gdal_translate? There's a space in the lat_1 specification (typo?). Can you edit your question with the extent you are getting versus what you expect? – mkennedy Dec 3 '17 at 17:55
1

If you want to reproject, you have to use

gdalwarp -s_srs +proj=lcc ... -t_srs +proj=aea ...

whereas gdaltranslate -a_srs +proj=aea just assigns a wrong CRS without any reprojection.

If you want corner coordinates in degrees, you must use -t_srs EPSG:4326, and not any projected CRS.

1

In both cases it has not sense to pass through another projection. You can use gdalwarp directly.

lcc to wgs84:

gdalwarp -s_srs "+proj=lcc +datum=WGS84 +lat_1=25 +lat_2=60 +lat_0=42.5 +lon_0=-100 +x_0=0 +y_0=0 +units=m +no_defs" -t_srs EPSG:4326 NETCDF:"prcp_11742_2015.nc":prcp prcp_11742_2015_lcc.tif

lcc to aea(WGS72):

gdalwarp -s_srs "+proj=lcc +datum=WGS84 +lat_1=25 +lat_2=60 +lat_0=42.5 +lon_0=-100 +x_0=0 +y_0=0 +units=m +no_defs" -t_srs "+proj=aea +datum=WGS72 +lat_1=25 +lat_2=60 +lat_0=42.5 +lon_0=-100 +towgs84=0,0,4.5,0,0,0.554,0.2263 +units=m +no_defs" -t_srs EPSG:4326 NETCDF:"prcp_11742_2015.nc":prcp prcp_11742_2015_aea.tif

(+towgs84=0,0,4.5,0,0,0.554,0.2263 was missing)

considering:

Projection System:  Lambert Conformal Conic ==> +proj=lcc
Parameters: 
projection units:   meters                  ==> +units=m
datum (spheroid):   WGS_84                  ==> +datum=WGS84
1st standard parallel:  25 deg N            ==> +lat_1=25
2nd standard parallel:  60 deg N            ==> +lat_2=60
Central meridian:   100 deg W               ==> +lon_0=-100
Latitude of origin: 42.5 deg N              ==> +lat_0=42.5
false easting:      0                       ==> +x_0=0
false northing:     0                       ==> +y_0=0
  • Thanks for your reply, but the lcc is the projection of source file and i I wanted to change the projection to the equal distance area too that is why I used the proj =aea, also one problem i have is i want to have the lat/lon in the geotiff file but i do not see the right lat/lon in the geotiff file – Hamideh Ebrahimi Dec 4 '17 at 5:04

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.