Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3819 closed defect (fixed)

can't open .img files (ERROR 1: Unknown base item type : 4)

Reported by: hairymapper Owned by: warmerdam
Priority: normal Milestone: 1.7.3
Component: GDAL_Raster Version: 1.7.2
Severity: normal Keywords: HFA
Cc:

Description

When attempting to open an ERDAS file created by ArcGIS (.img) gdal.Open() returns the following error:

ERROR 1: Unknown base item type : 4

This has been discussed here: http://www.mail-archive.com/gdal-dev@lists.osgeo.org/msg06843.html

and is evident in gdal_translate here: http://www.mail-archive.com/gdal-dev@lists.osgeo.org/msg04124.html

This is reportedly something to do with the BASEDATA object in the file.

Is there a fix / workaround? What further information (sample files?) would be useful?

lib-gdal 1.7.2, python-gdal 1.7.2 in Ubuntu 9.10 (32-bit)

Many thanks.

Attachments (2)

uib_sca_2000M03.img.xml (946 bytes) - added by hairymapper 9 years ago.
Imagine image generated using ArcGIS spatial analyst (.img.xml)
uib_sca_2000M03.img.vat.dbf (231 bytes) - added by hairymapper 9 years ago.
Imagine image generated using ArcGIS spatial analyst (.img.vat.dbf)

Download all attachments as: .zip

Change History (10)

comment:1 Changed 9 years ago by Even Rouault

Yes, as Frank mentionned in the two emails, sample files would be useful to debug this issue.

Changed 9 years ago by hairymapper

Attachment: uib_sca_2000M03.img.xml added

Imagine image generated using ArcGIS spatial analyst (.img.xml)

Changed 9 years ago by hairymapper

Attachment: uib_sca_2000M03.img.vat.dbf added

Imagine image generated using ArcGIS spatial analyst (.img.vat.dbf)

comment:2 Changed 9 years ago by hairymapper

I've now attached the IMAGINE image file's .xml and .dbf files generated by ArcGIS' Spatial Analyst. I can't attach the image file as it's too large (~6mb), are these enough? This only seems to occur for us with some IMAGINE image files created by Arc's Spatial Analyst. Thanks.

comment:3 Changed 9 years ago by Even Rouault

No, those .xml and .dbf files are ArcGIS internal stuff not recognized by GDAL. Only the .img is the exchange file... You can perhaps try posting it on filebin.ca or another upload site.

comment:4 Changed 9 years ago by hairymapper

OK, thanks for letting me know. You can download the image file from here: http://filebin.ca/skvcex/uib_sca_2000M03.img Really appreciated the help.

comment:5 Changed 9 years ago by warmerdam

Keywords: HFA added; gdal.Open .img ERROR1: Unkown base item type: 4 removed
Milestone: 1.8.0
Priority: highnormal
Status: newassigned

I have the file and have reproduced the problem. It should be straight forward to correct.

comment:6 Changed 9 years ago by warmerdam

Summary: GDAL (Python) gdal.Open() can't open .img files (ERROR 1: Unknown base item type : 4)can't open .img files (ERROR 1: Unknown base item type : 4)

comment:7 Changed 9 years ago by warmerdam

Milestone: 1.8.01.7.3
Resolution: fixed
Status: assignedclosed

Fixed in trunk (r21076) and 1.7 (r21077). I just needed to add support for the EPT_s8 (signed eight bit) values in BASEDATA, as used for the nodata value for this signed 8bit file.

comment:8 Changed 9 years ago by hairymapper

Just to confirm and say thanks - updated GDAL to 1.7.3 from the ubuntugis-unstable PPA and our files are being read without errors.

Note: See TracTickets for help on using tickets.