Ticket #1794 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

AAIGRID - error calculating yllcorner in ascii header

Reported by: jdemone Owned by: 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 Download (0.9 KB) - added by jdemone 6 years ago.
proposed patch

Change History

Changed 6 years ago by jdemone

proposed patch

Changed 6 years ago by warmerdam

  • severity changed from trivial to normal
  • cc warmerdam added
  • 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.

Changed 6 years ago 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.

Changed 6 years ago 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?

Changed 6 years ago by mloskot

I ported the fix to stable branch 1.4 (r12461)

Changed 5 years ago by warmerdam

  • status changed from closed to reopened
  • resolution fixed 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]) );

Changed 5 years ago by warmerdam

  • cc mloskot added; warmerdam removed
  • status changed from reopened to closed
  • 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).

Note: See TracTickets for help on using tickets.