Opened 15 years ago
Closed 15 years ago
#3123 closed defect (fixed)
Failure to load new Surfer Grid Format
Reported by: | whatnick | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | 1.5.4 |
Severity: | normal | Keywords: | GS7BG |
Cc: | adam@… |
Description
Surfer Demo 9.x saves .grd files which fail to be read due to "version mismatch"
Attachments (1)
Change History (6)
by , 15 years ago
Attachment: | merged_ndvi.grd added |
---|
follow-up: 2 comment:1 by , 15 years ago
Cc: | added |
---|---|
Component: | default → GDAL_Raster |
Keywords: | GS7BG added |
Status: | new → assigned |
The file is recognised by the GS7BG (Golden Surfer 7 Binary Grid) driver but it has a major version of 2 instead of 1 in the file so the reading fails. I have found I can comment out this section of code:
if(nVersion != 1) { delete poDS; CPLError( CE_Failure, CPLE_FileIO, "Incorrect file version.\n" ); return NULL; }
and then file access appears to work, but it is unclear to me what the risks are to removing this check.
I'm adding Adam Guernsey who originally implemented the driver as a cc: in case he has any opinion on how to proceed.
follow-up: 3 comment:2 by , 15 years ago
Replying to warmerdam:
The file is recognised by the GS7BG (Golden Surfer 7 Binary Grid) driver but it has a major version of 2 instead of 1 in the file so the reading fails. I have found I can comment out this section of code:
if(nVersion != 1) { delete poDS; CPLError( CE_Failure, CPLE_FileIO, "Incorrect file version.\n" ); return NULL; }and then file access appears to work, but it is unclear to me what the risks are to removing this check.
I'm adding Adam Guernsey who originally implemented the driver as a cc: in case he has any opinion on how to proceed.
Where is the said version 2 - can I fiddle it by hand and use the file ?
comment:3 by , 15 years ago
Ok used a hex editor to change the 8th byte from 02 to 01 and now all is peachy ... may be the check should accept 01 and 02.
comment:4 by , 15 years ago
Looking at file format details from the latest Demo version of Surfer (9.5.510) it appears the only difference between the two versions is the following change:
If the version field is 1, then any value >= BlankValue will be blanked using Surfer’s blanking value, 1.70141e+038.
If the version field is 2, then any value == BlankValue will be blanked using Surfer’s blanking value, 1.70141e+038.
So it seems just allowing version 2 is not the only change needed.
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Surfer Grid