Opened 11 years ago

Closed 7 years ago

Last modified 6 years ago

#3578 closed defect (fixed)

BMP: Correct use of resolution information?

Reported by: clundgren Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: GDAL_Raster Version: 1.7.2
Severity: normal Keywords: BMP
Cc: gaopeng

Description

A change was made to the BMP driver in r16706 to use the resolution information in the header as part of the geotransform.

I'll defer to your wisdom, but I thought I'd raise the point that this seems a bit odd to me. Isn't this information intended as display information rather than location information? Perhaps this would be better as metadata instead (similar to TIFFTAG_XRESOLUTION, for example)?

Also, if you do think it makes the most sense for this information to be represented through the geotransform, shouldn't the value be (1 / iXPelsPerMeter), since the geotransform should be capturing meters per pixel, not pixels per meter?

Change History (6)

comment:1 Changed 11 years ago by clundgren

Whoops, mentioned the wrong revision in the initial report. That should be r17065.

comment:2 Changed 11 years ago by warmerdam

Cc: gaopeng added
Keywords: BMP added
Status: newassigned

Gao,

The referenced change (r17065) came from you guys. Can you comment on why it seems like an appropriate change?

comment:3 Changed 7 years ago by Jukka Rahkonen

The code that is referred in this ticket is still there in http://trac.osgeo.org/gdal/browser/trunk/gdal/frmts/bmp/bmpdataset.cpp.

As far as I understand that metadata in BMP format has nothing to do with geotransform nor the real world units/pixel an thus r17065 should be reverted.

http://www.digicamsoft.com/bmp/bmp.html

biXPelsPerMeter Specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap. An application can use this value to select a bitmap from a resource group that best matches the characteristics of the current device.

On the other hand, who cares about BMP anyway when it comes to geospatial imagery?

comment:4 Changed 7 years ago by Jukka Rahkonen

This may be also a reason for the odd corner coordinates in this gis.stackexchange question http://gis.stackexchange.com/questions/127479/set-coordinate-origin-to-the-top-left-corner?noredirect=1#comment182794_127479

comment:5 Changed 7 years ago by Even Rouault

Milestone: 2.0
Resolution: fixed
Status: assignedclosed

I've reverted the suspicous change. It might have made sense for some particular data production, but without more rationale, in the general case, it is dubious.

trunk r28234 "BMP: backout r17065 change that infered georeferencing based on the resolution information in the BMP header (#3578)"

comment:6 Changed 6 years ago by Even Rouault

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.