Ticket #2562 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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

Reported by: ftrastour Owned by: 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

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

Change History

Changed 5 years ago by ftrastour

vrt file with associated tif

Changed 5 years ago by rouault

  • owner changed from warmerdam to rouault
  • status changed from new to assigned

Changed 5 years ago by rouault

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone set to 1.5.3

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

Changed 5 years ago by ftrastour

  • status changed from closed to reopened
  • resolution fixed deleted
  • summary changed from VRT Driver ignores empty categories (when reading) to 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).

Changed 5 years ago by rouault

  • status changed from reopened to closed
  • resolution set to fixed

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.