Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6854 closed defect (fixed)

Fix SetLinearBinning call in HFA driver to set binning type properly

Reported by: Sam Gillingham Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 2.1.3
Severity: normal Keywords:
Cc:

Description

We have noticed that some parts of the HFA driver are inconsistent when setting the binning type. When setting the STATISTICS_HISTOBINVALUES metadata item the type of the layer (thematic or athematic) is taken into account to set it correctly - see hfaopen.cpp line 2877. This patch fixes another place where the binning type was hardcoded so the SetLinearBinning call can be used safely. Imagine gets confused if the binning type isn't set to direct for thematic and linear for athematic (see https://trac.osgeo.org/gdal/ticket/5066).

There are other places in the HFA driver that probably need this fix, and also change binFunction -> binFunctionType since this is a mistake (see the default data dictionary). Even, are you happy for another patch to be submitted to address these areas?

Attachments (1)

hfadataset.cpp.direct_patch (840 bytes ) - added by Sam Gillingham 7 years ago.
Patch to set the binning type correctly

Download all attachments as: .zip

Change History (4)

by Sam Gillingham, 7 years ago

Attachment: hfadataset.cpp.direct_patch added

Patch to set the binning type correctly

comment:1 by Sam Gillingham, 7 years ago

Component: defaultGDAL_Raster

comment:2 by Even Rouault, 7 years ago

Resolution: fixed
Status: newclosed

In 37965:

HFA: set binning type properly according to layerType being thematic or not (patch by Sam Gillingham, fixes #6854)

comment:3 by Even Rouault, 7 years ago

I've updated your patch against latest trunk and harden it against layerType being NULL.

Please submit other patches (I have no informed opinion on the appropriatness of those changes. I trust you know what you do :-))

Note: See TracTickets for help on using tickets.