Tuesday 29 August 2017

gdal - Facing a problem when re-projecting a file?


I am trying to re-project from Equi-rectangular. The file is provided as HDF5. I wonder why half of the map is not projected correctly.


gdal_translate -of "ENVI" -gcp 0 0 0 90 -gcp 1440 0 360 90 -gcp 0 720 0 -90 - 
gcp 1440 7 20 360 -90 -a_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"

here how the results look like: ![enter image description here][1]


For info:



Answer



I have added a few intermediate steps to change longitudes from 0/360 to -180/180:



gdal_translate HDF5:"GW1AM2_20141231_01D_EQOD_L3SGTPWLA1100100.nc"://Time_Information ti.tif
gdal_translate -a_ullr 0 90 360 -90 -a_srs epsg:4326 ti.tif deg.tif
gdalwarp -t_srs epsg:4326 -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0 deg.tif degree.tif
gdalwarp -of "ENVI" -s_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" -t_srs "+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +a=6371228 +b=6371228 +units=m +no_defs" -ts 1383 586 degree.tif gcp_wgs_ease.img

and it looks like expected:


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...