Opened 11 years ago

Closed 11 years ago

#2562 closed defect (fixed)

VRT Driver and PAM Dataset ignores empty categories (when reading)

Reported by: ftrastour Owned by: Even Rouault
Priority: normal Milestone: 1.5.3
Component: GDAL_Raster Version: 1.5.2
Severity: normal Keywords: VRT Categories
Cc:

Description

When a VRT with categories is read, empty categories are ignored.

This results into an incorrect category to pixel value mapping ( categories are compacted ).

In the attached example, the categories #0 (pixel value 0) and category #15 are empty and ignored ( as reported by gdalinfo ) :

VRT ::

<CategoryNames?>

<Category></Category> <Category>Open</Category> <Category>Sea</Category> <Category>Inland Water</Category> <Category>Mean individual</Category> <Category>Mean collective</Category> <Category>Dense collective</Category> <Category>Building</Category> <Category>Village</Category> <Category>Industrial</Category> <Category>Open in urban</Category> <Category>Forest</Category> <Category>Park</Category> <Category>Dense individual</Category> <Category>Block building</Category> <Category></Category> <Category>Scattered urban</Category>

</CategoryNames?>

gdalinfo::

Categories:

0: Open 1: Sea 2: Inland Water 3: Mean individual 4: Mean collective 5: Dense collective 6: Building 7: Village 8: Industrial 9: Open in urban

10: Forest 11: Park 12: Dense individual 13: Block building 14: Scattered urban

Attachments (1)

clutter2x2.zip (6.1 KB) - added by ftrastour 11 years ago.
vrt file with associated tif

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by ftrastour

Attachment: clutter2x2.zip added

vrt file with associated tif

comment:1 Changed 11 years ago by Even Rouault

Owner: changed from warmerdam to Even Rouault
Status: newassigned

comment:2 Changed 11 years ago by Even Rouault

Milestone: 1.5.3
Resolution: fixed
Status: assignedclosed

Fixed in trunk in r15300 and in branches/1.5 in r15301

comment:3 Changed 11 years ago by ftrastour

Resolution: fixed
Status: closedreopened
Summary: VRT Driver ignores empty categories (when reading)VRT Driver and PAM Dataset ignores empty categories (when reading)

It seems that exactly the same problem appears when reading categories from a PAM File (.aux.xml).

comment:4 Changed 11 years ago by Even Rouault

Resolution: fixed
Status: reopenedclosed

Fixed in trunk in r15305 and in branches/1.5 in r15306. Well, we see here the nice effects of copy & paste ;-)

Note: See TracTickets for help on using tickets.