3

I want to project a global image (source ERA INTERIM) from WGS 84 to sinusoidal, using gdal 1.11 and bilinear resampling. It work fine BUT I have values everywhere on the rectangular extent of the projected dataset when I use the -te option. That is, the values are repeated when the dateline is crossed (e.g values from 179 East are duplicated on the left of values from 180 West).

Is there a trick to make sure that the values are not duplicated on the output image (NoData to the left of the projected 180W and to the right of the projected 180E) ?

The workaround is to create a mask of the globe for NoData, but mabe there is a gdalwarp option for doing this in one step.

EDIT : there was a little extra of 1/2 pixel on the original data set, but I've tried with a vrt of just less the 180 and the problem persisted. It does not solve the problem.

the problem occurs with :

gdalwarp -r bilinear -co COMPRESS=LZW -co TILED=YES -tr 463.312716527777752 463.312716527777752 -te -20015109.353999998420477 -10007554.677 20015109.354 10007554.676999999210238 -multi -t_srs "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs" $input $output 

enter image description here

but not with

gdalwarp -r bilinear -co COMPRESS=LZW -co TILED=YES -tr 463.312716527777752 463.312716527777752 -multi -t_srs "+proj=sinu" $input $output 

enter image description here

however, I need to use the -te option in order to force all my output images with exactly the same extent.

1
  • Are the extents exactly at -180 and +180? Or is there a little extra?
    – mkennedy
    Commented Oct 24, 2014 at 16:01

1 Answer 1

2

Sorry, I can't replicate your problem.

I have a 2048x1024px image of Blue Marble referenced to WGS84, and warped it in GDAL with

gdalwarp -t_srs "+proj=sinu" bluemarble-WGS84.tif bluemarble-sinu.tif

and get:

enter image description here

8
  • thnaks for testing. What is your gdal version? maybe this is a bug of gdal 1.11.1
    – radouxju
    Commented Oct 24, 2014 at 14:46
  • same as yours, but I did not select any resampling method.
    – AndreJ
    Commented Oct 24, 2014 at 15:20
  • the resampling is not the reason for the problem. When I don't specify the extent (-te) I have the no data as expected. The problem is that I wanted to force the extent in order to match another one. Maybe I should try with -tap, but this will be on Monday. May I ask you to try with the -te option if you can reproduce i ?
    – radouxju
    Commented Oct 24, 2014 at 17:39
  • What -te did you use?
    – AndreJ
    Commented Oct 24, 2014 at 18:48
  • -te -20015109.353999998420477 -10007554.677 20015109.354 10007554.676999999210238
    – radouxju
    Commented Oct 27, 2014 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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