Opened 17 years ago

Closed 16 years ago

#1794 closed defect (fixed)

AAIGRID - error calculating yllcorner in ascii header

Reported by: jdemone Owned by: Mateusz Łoskot
Priority: normal Milestone: 1.4.5
Component: GDAL_Raster Version: 1.4.1
Severity: normal Keywords: AAIGRID, yllcorner
Cc: Mateusz Łoskot

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 (1)

aaigriddataset.cpp.patch (887 bytes ) - added by jdemone 17 years ago.
proposed patch

Download all attachments as: .zip

Change History (7)

by jdemone, 17 years ago

Attachment: aaigriddataset.cpp.patch added

proposed patch

comment:1 by warmerdam, 17 years ago

Cc: warmerdam added
Component: defaultGDAL_Raster
Milestone: 1.4.3
Owner: changed from warmerdam to Mateusz Łoskot
Priority: lownormal
Severity: trivialnormal

Mateusz,

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

comment:2 by Mateusz Łoskot, 17 years ago

Status: newassigned

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

comment:3 by Mateusz Łoskot, 17 years ago

Resolution: fixed
Status: assignedclosed

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?

comment:4 by Mateusz Łoskot, 17 years ago

I ported the fix to stable branch 1.4 (r12461)

comment:5 by warmerdam, 16 years ago

Resolution: fixed
Status: closedreopened

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]) );

comment:6 by warmerdam, 16 years ago

Cc: Mateusz Łoskot added; warmerdam removed
Milestone: 1.4.31.4.5
Resolution: fixed
Status: reopenedclosed

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

Added test in test suite (r13564).

Note: See TracTickets for help on using tickets.