3

I'm trying to convert a raster with projections of (0, 360) to (-180, 180), and I've tried various SO solutions such as this, but it gave me a cropped output that doesn't have the western hemisphere.

The exact command that I've used is:

gdalwarp -t_srs EPSG:4326 -te -180 -90 180 90 prec_high_res.tif rec_high_res2.tif

Does anyone have any idea how to resolve this?

alphabetasoup
  • 8,718
  • 4
  • 38
  • 78
Ali Abbas
  • 69
  • 4

1 Answers1

2

As you can see in following image, I have loaded in QGIS 3 a raster (world_0_360.tif) with longitudes from 0 360 and with latitudes from -90 90.

enter image description here

Afterward, I tried out an equivalent command used in accepted answer in your link:

gdalwarp -t_srs WGS84 world_0_360.tif world_180.tif  -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0

and it ran without any error:

Using band 4 of source image as alpha. Creating output file that is 2048P x 1024L. Processing world_0_360.tif [1/1] : 0...10...20...30...40...50...60...70...80...90...100 - done.

After running above command, I also loaded resulting raster (world_180.tif) in QGIS. I assigned 50 % of transparency for both raster and it can be observed in following image that they match almost perfectly. So, @Frank Warmerdam procedure produces a good and reproducible result.

enter image description here

xunilk
  • 29,891
  • 4
  • 41
  • 80