Ticket #2562 (closed defect: fixed)
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 ::
<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

