Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#6662 closed defect (fixed)

gdalwarp creates correct ENVI hdr but incomplete raster

Reported by: piyushrpt Owned by: warmerdam
Priority: high Milestone: 2.1.2
Component: GDAL_Raster Version:
Severity: major Keywords: ENVI
Cc:

Description

I'm trying to warp some swath data using geolocation arrays. All input data is stored in flat binary files with appropriate VRTs. The methodology works for most cases but there were a couple of instances where it resulted in incomplete raster files (missing lines at the bottom).

Command used:

gdalwarp -t_srs EPSG:4326 -of ENVI -ot Float32  -srcnodata 0 -te -122.32 37.57-121.102 38.617 -geoloc -tr 0.0001 0.0001 swathRaster.dat.vrt  mapRaster.dat

The resulting mapRaster.dat.hdr is correct with the expected dimensions, but the generated mapRaster.dat has missing lines. One thing to note is that the missing lines should contain nodata (0) and lie outside the support of the geoloc arrays.

I can overcome the issue in two ways:

  1. Create a Geotiff and then translate it to an ENVI file. This worked fine.
  2. Increase working memory using "-wm 2000" and this worked as well.

Looks like there could be issues with nodata regions and memory settings when using the ENVI driver to warp raster files. I'm also attaching two log files generated with debug turned on - one for default call using gdalwarp and one using more working memory if it helps.

Attachments (2)

warpDefault.log (5.2 KB) - added by piyushrpt 14 months ago.
Log for gdalwarp with default settings
warpWithWM2000.log (1003 bytes) - added by piyushrpt 14 months ago.
Log for gdalwarp with extra working memory "-wm 2000"

Download all attachments as: .zip

Change History (6)

Changed 14 months ago by piyushrpt

Attachment: warpDefault.log added

Log for gdalwarp with default settings

Changed 14 months ago by piyushrpt

Attachment: warpWithWM2000.log added

Log for gdalwarp with extra working memory "-wm 2000"

comment:1 Changed 14 months ago by piyushrpt

Summary: gdalwarp creates correct ENVI hdr correct but incomplete rastergdalwarp creates correct ENVI hdr but incomplete raster

comment:2 Changed 14 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 35523:

ENVI: on closing, pad image file with trailing nul bytes if needed (fixes #6662)

comment:3 Changed 14 months ago by Even Rouault

In 35524:

ENVI: on closing, pad image file with trailing nul bytes if needed (fixes #6662)

comment:4 Changed 14 months ago by Even Rouault

Milestone: 2.1.2
Version: 2.1.1
Note: See TracTickets for help on using tickets.