Opened 10 years ago

Last modified 8 years ago

#70 new defect

listgeo not printing corners correctly for PixelIsPoint

Reported by: normvcr Owned by: warmerdam
Priority: normal Milestone:
Component: libgeotiff Version: 1.3.0
Keywords: listgeo corners PixelIsPoint Cc: normvcr@…

Description

Actually, in version 1.4 of libgeotiff. In listgeo.c:

In GTIFPrintCorners(), the following code/hack needs to be added at the very top:

if( PixelIsPoint ) {

--xsize; --ysize;

}

For example, suppose an image extent has a width of 10m, with 5m pixels.

In PixelIsArea, the image has 2 pixels in the width, centred at 2.5m and 7.5m.

In PixelIsPoint, the image has 3 pixels in the width, at 0m, 5m and 10m.

Change History (1)

comment:1 by rouault, 8 years ago

The current behaviour is wrong, but the proposed solution is a bit disputable. For example, it wouldn't report the same as gdalinfo would, but this is a matter of conventions. GDAL reports the coordinates of the corners, applying a half-pixel shift. The proposed patch would display the coordinates of the centers of pixels, so this wouldn't be consistent with the "Corner Coordinates" label. Or some extra text would be needed to clarify, like "Corner Coordinates (center of pixels)".

Note: See TracTickets for help on using tickets.