Opened 13 years ago

Closed 13 years ago

Last modified 13 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 13 years ago.
Imagine image generated using ArcGIS spatial analyst (.img.xml)
uib_sca_2000M03.img.vat.dbf (231 bytes ) - added by hairymapper 13 years ago.
Imagine image generated using ArcGIS spatial analyst (.img.vat.dbf)

Download all attachments as: .zip

Change History (10)

comment:1 by Even Rouault, 13 years ago

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

by hairymapper, 13 years ago

Attachment: uib_sca_2000M03.img.xml added

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

by hairymapper, 13 years ago

Attachment: uib_sca_2000M03.img.vat.dbf added

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

comment:2 by hairymapper, 13 years ago

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 by Even Rouault, 13 years ago

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 by hairymapper, 13 years ago

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 by warmerdam, 13 years ago

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 by warmerdam, 13 years ago

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 by warmerdam, 13 years ago

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 by hairymapper, 13 years ago

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.