Opened 7 months ago

Closed 7 months ago

Last modified 7 months 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 months ago.
Patch to set the binning type correctly

Download all attachments as: .zip

Change History (4)

Changed 7 months ago by Sam Gillingham

Attachment: hfadataset.cpp.direct_patch added

Patch to set the binning type correctly

comment:1 Changed 7 months ago by Sam Gillingham

Component: defaultGDAL_Raster

comment:2 Changed 7 months ago by Even Rouault

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 Changed 7 months ago by Even Rouault

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.