2

I'm reprojecting GFS GRIB files to EPSG:3857 using gdalwarp. Resulting file get little bit shorter to the right so when I zoom in from zoom level 5 and higher, I can see vertical line with missing data. Check image below:

vertical line with missing data

When I check edges with gdalinfo I could clearly see that map is indeed shorter:

Upper Left  (-20037508.343,26491625.382)  (180d 0' 0.00"W, 88d12' 0.00"N)
Lower Left  (-20037508.343,-26492654.355) (180d 0' 0.00"W, 88d12' 1.05"S)
Upper Right (20036608.125,26491625.382)   (179d59'30.89"E, 88d12' 0.00"N)
Lower Right (20036608.125,-26492654.355)  (179d59'30.89"E, 88d12' 1.05"S)
Center      (    -450.109,    -514.486)   (0d 0'14.56"W,  0d 0'16.64"S)

For tile x = 32767; y = 14181; zoomLevel = 15; I calculated geo coords:

x0 = 20036285.349764004
x1 = 20037508.34221653
y0 = 2693029.380466357
y1 = 2694252.372918885

and I get complexly blank image.

For tile x = 63; y = 28; zoomLevel = 6; There is missing data vertical line at the right side of image.

I am using SOURCE_EXTRA=1000. I tried much higher numbers, but I guess resulting tif bounding box is not calculated correctly so this doesn't help.

Downloaded any grib2 file from here

Extracted 270 variable using wgrib2 tool with following grid params:

-new_grid latlon 180:23040:0.015625 -90:11520:0.015625

Finally, I used gdalwarp command: gdalwarp -t_srs EPSG:3857 -wo SOURCE_EXTRA=1000 --config CENTER_LONG 0 -of GTiff --config GRIB_NORMALIZE_UNITS NO -co "TILED=YES" 270-16.grb test.tif

Extracted and interpolated grib file: link

Resulting TIF file: link

Any thoughts how to fix this?

  • 1
    Can you share some test data and exact gdalwarp command that you have used? – user30184 Dec 4 '18 at 18:15
  • Updated original post with test data and more info – Mike Jackson Dec 4 '18 at 18:43
0

This is probably a duplicate of How to stop gdalwarp creating world-spanning outputs near the dateline?

Try --config CENTER_LONG 180

  • Unfortunately, I get same results with CENTER_LONG 180 – Mike Jackson Dec 4 '18 at 18:43
  • How about forcing the output to the mercator bounds -te -20037508.3427892 -20037508.3427892 20037508.3427892 20037508.3427892? – Marc Pfister Dec 4 '18 at 23:23

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.