Ticket #1794 (closed defect: fixed)

Opened 8 months ago

Last modified 4 months ago

AAIGRID - error calculating yllcorner in ascii header

Reported by: jdemone Assigned to: mloskot
Priority: normal Milestone: 1.4.5
Component: GDAL_Raster Version: 1.4.1
Severity: normal Keywords: AAIGRID, yllcorner
Cc: mloskot

Description

There is an error in the creation of the header in the AAIGRID format. 'yllcorner' is calculated using the dx instead of the dy. A proposed patch is attached.

Attachments

aaigriddataset.cpp.patch (0.9 kB) - added by jdemone on 09/05/07 11:12:16.
proposed patch

Change History

09/05/07 11:12:16 changed by jdemone

  • attachment aaigriddataset.cpp.patch added.

proposed patch

09/05/07 12:28:35 changed by warmerdam

  • severity changed from trivial to normal.
  • cc set to warmerdam.
  • component changed from default to GDAL_Raster.
  • priority changed from low to normal.
  • milestone set to 1.4.3.
  • owner changed from warmerdam to mloskot.

Mateusz,

Could you look into this? I have a vague recollection that this may have been fixed since 1.4.1.

10/17/07 06:25:53 changed by mloskot

  • status changed from new to assigned.

As I see, only half of the fix (line 816 in r10146) have been applied since 1.4.1.

10/17/07 06:28:40 changed by mloskot

  • status changed from assigned to closed.
  • resolution set to fixed.

I've applied the second part of the fix (r12453).

Frank, Do we have any aaigrid datasets with features specific to Golden Surfer, that we could add to the autotest?

10/17/07 12:56:54 changed by mloskot

I ported the fix to stable branch 1.4 (r12461)

01/21/08 14:17:57 changed by warmerdam

  • status changed from closed to reopened.
  • resolution deleted.

The applied patch is incorrect. It computes YLLCORNER improperly. In normal cases adfGeoTransform[5] is negative while adfGeoTransform[1] was positive. This basically means that yllcorner is written as being as far above the top left corner as it ought to be below the top left corner.

        sprintf( szHeader, 
                 "ncols        %d\n" 
                 "nrows        %d\n"
                 "xllcorner    %.12f\n"
                 "yllcorner    %.12f\n"
                 "dx           %.12f\n"
                 "dy           %.12f\n", 
                 nXSize, nYSize, 
                 adfGeoTransform[0], 
                 adfGeoTransform[3] - nYSize * adfGeoTransform[5],
                 adfGeoTransform[1],
                 fabs(adfGeoTransform[5]) );

01/21/08 14:28:27 changed by warmerdam

  • status changed from reopened to closed.
  • cc changed from warmerdam to mloskot.
  • resolution set to fixed.
  • milestone changed from 1.4.3 to 1.4.5.

Fixed in trunk (r13561), 1.5 (r13562) and 1.4 (r13563).

Added test in test suite (r13564).