0

I'm attempting to mass convert the Sinusoidal projections of hundreds of MODIS single-band files to WGS84 in a single directory (which were extracted from HDF-EOS format using gdal_translate) using GDAL in Cygwin.

When I execute the gdalwarp command on a single file, it executes the command successfully and the result is my desired output:

$ gdalwarp -s_srs "+proj=sinu +R=6371007.181 +nadgrids=@null +wktext" -t_srs EPSG:4326 testfile.tif testfile_proj_1.tif
Processing testfile.tif [1/1] : 0Using internal nodata values (e.g. -1) for imag
e testfile.tif.
...10...20...30...40...50...60...70...80...90...100 - done.

However, when I try to process the aforementioned hundreds of files using a for loop...:

$ for f in *.tif; do
> gdalwarp -s_srs "+proj=sinu +R=6371007.181 +nadgrids=@null +wktext" -t_srs EPSG:4326 "$f" "${f%.*}.tif"

..., it returns errors:

ERROR 1: Too many points (529 out of 529) failed to transform, unable to compute
 output bounds.
Warning 1: Unable to compute source region for output window 0,0,2400,2400, skip
ping.

I am baffled as to why the command will work on a single file, but won't in a mass conversion.

How do I get this to work? Are there any alternatives to GDAL that I can use to mass reproject TIFFs if this is a wall I hit?

Thank you in advance.

5
  • may be it is a single file (or few ones) that have problems ? Or you have problems on all the files ?
    – matzeri
    Feb 19, 2021 at 10:48
  • The singular file I executed the command on was part of the package, but the command line returns these errors only when I'm attempting the command on the entirety of the package.
    – emil
    Feb 19, 2021 at 11:44
  • the for cycle (that misses a done) is applying the same command to every single file (o so it seems). So I assume that some files fail but most pass. Have you tried to identify the failing ones ?
    – matzeri
    Feb 19, 2021 at 13:49
  • None of the files pass - they return this error individually when using batch processing. When I execute the command on single files, it accomplishes the task successfully.
    – emil
    Feb 20, 2021 at 4:45
  • can we find some files anywhere ?
    – matzeri
    Feb 20, 2021 at 10:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.