Changes between Initial Version and Version 1 of Ticket #5467


Ignore:
Timestamp:
May 14, 2014, 2:02:53 AM (10 years ago)
Author:
wilsonwaters
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5467

    • Property Owner changed from Even Rouault to warmerdam
    • Property Component JavaBindingsGDAL_Raster
  • Ticket #5467 – Description

    initial v1  
    22
    33This is the process causing the corruption in ENVIDataset:
    4 1) open envi file in read/write mode uses OPEN_EXISTING flag on .hdr
    5 2) ENVIDataset::Open() doesn't understand "Arbitrary" projection so generates a "LOCAL_CS" projection string
    6 3) close dataset causing ENVIDataset::FlushCache() to be called
    7 4) FlushCache() re-writes hdr file as the bHeaderDirty was set in the Open() function. map info field is omitted for some reason?
    8 5) FlushCache() overwrites the old hdr file without clearing first causing trailing data in the file
    94
    10 As far as I can tell there are four bugs in the ENVIDataset related to this
    11 1) ENVIDataset::ProcessMapinfo() Doesn't understand the "Arbitrary" projection and defaults to LOCAL_CS - which is probably ok, but;
    12 2) ENVIDataset::WriteProjectionInfo fails to write map info field when projection is LOCAL_CS
    13 3) ENVIDataset::Open() causes bHeaderDirty to be set (should only happen when something external updates the image?)
    14 4) ENVIDataset::FlushCache() should truncate existing file before overwriting
     5 1. open envi file in read/write mode uses OPEN_EXISTING flag on .hdr
     6 1. ENVIDataset::Open() doesn't understand "Arbitrary" projection so generates a "LOCAL_CS" projection string
     7 1. close dataset causing ENVIDataset::FlushCache() to be called
     8 1. FlushCache() re-writes hdr file as the bHeaderDirty was set in the Open() function. map info field is omitted for some reason?
     9 1. FlushCache() overwrites the old hdr file without clearing first causing trailing data in the file
     10
     11As far as I can tell there are four bugs in the ENVIDataset related to this:
     12
     13 1. ENVIDataset::ProcessMapinfo() Doesn't understand the "Arbitrary" projection and defaults to LOCAL_CS - which is probably ok, but;
     14 1. ENVIDataset::WriteProjectionInfo fails to write map info field when projection is LOCAL_CS
     15 1. ENVIDataset::Open() causes bHeaderDirty to be set (should only happen when something external updates the image?)
     16 1. ENVIDataset::FlushCache() should truncate existing file before overwriting
    1517
    1618We're using GDAL 1.11 on windows, though I think the behaviour would be the same on any OS.
     19
     20The attached patch fixes the issues for me, though my experience of GDAL is limited so I would suggest it would need to be reviewed before being used.