Opened 12 years ago

Closed 12 years ago

#3252 closed defect (fixed)

Reading additional metadata, SkipFactor and IgnoredValues

Reported by: gaopeng Owned by: warmerdam
Priority: normal Milestone: 1.7.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: HFA
Cc:

Description

Attached IMG image contains metadata SkipFactorX, SkipFactorY, and IgnoredValues?. Could these metadata can be read and converted to metadata item as named.

Attachments (2)

skip.zip (2.5 KB) - added by gaopeng 12 years ago.
dem10.img (14.1 KB) - added by gaopeng 12 years ago.
The img has ignore values 0, 8, and 9

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by gaopeng

Attachment: skip.zip added

comment:1 Changed 12 years ago by warmerdam

Component: defaultGDAL_Raster
Keywords: HFA added
Status: newassigned

comment:2 Changed 12 years ago by warmerdam

Gao,

This image has these values in both the HistogramParameters? and StatisticsParameters? nodes. Which did you want exposed?

    HistogramParameters(Eimg_StatisticsParameters840) @ 1022 + 852 @ 1150
    + LayerNames = (no values)
    + BASEDATA(ExcludedValues): 1x1 of u8
    + ExcludedValues =     + 0
    + AOIname = 
    +     string = (no values)
    + SkipFactorX = 1
    + SkipFactorY = 1
...
    StatisticsParameters(Eimg_StatisticsParameters840) @ 2002 + 852 @ 2130
    + LayerNames = (no values)
    + BASEDATA(ExcludedValues): 1x1 of u8
    + ExcludedValues =     + 0
    + AOIname = 
    +     string = (no values)
    + SkipFactorX = 1
    + SkipFactorY = 1
...

comment:3 Changed 12 years ago by gaopeng

The ones for Statistics will be fine.

comment:4 Changed 12 years ago by warmerdam

Milestone: 1.7.0
Resolution: fixed
Status: assignedclosed

I have added support for reading the skipx,skipy and excludedvalues items as metadata STATISTICS_SKIPFACTORX, STATISTICS_SKIPFACTORY and STATISTICS_EXCLUDEDVALUE.

Note that unlike some of the histogram related metadata, these values are not written to new datasets if present in the source dataset of a CopyCreate?().

Changes are in trunk (r18114) and 1.6-esri branch (r18115). There is also a limited test in the test suite now (r18113).

comment:5 Changed 12 years ago by gaopeng

The STATISTICS_EXCLUDEDVALUE can contain multiple values, e.g. 0,1. Can it be renamed to STATISTICS_EXCLUDEDVALUES?

comment:6 Changed 12 years ago by warmerdam

Resolution: fixed
Status: closedreopened

Gao,

Yes, but the current implementation will only capture one value. Could you provide a sample data file with more than one exclude value?

Changed 12 years ago by gaopeng

Attachment: dem10.img added

The img has ignore values 0, 8, and 9

comment:7 Changed 12 years ago by warmerdam

Resolution: fixed
Status: reopenedclosed

I have renamed the metadata item to STATISTICS_EXCLUDEDVALUES, added support for multiple values and also corrected so the values are fetched as double rather than integers. The dem10.img file now reports:

    STATISTICS_SKIPFACTORX=1
    STATISTICS_SKIPFACTORY=1
    STATISTICS_EXCLUDEDVALUES=0,8,9

The changes are in trunk with a test (r18157), and in 1.6-esri without a test (r18158).

Note: See TracTickets for help on using tickets.