Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#3303 closed defect (worksforme)

gdal-translate does not understand my .IMG files

Reported by: zoltan Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.6.1
Severity: normal Keywords: HFA
Cc:

Description

I have tried both img2tif and gdal_translate to convert 2 satelite images to tiff files, but neither have worked. Gdal_translate does convert the files, but seems to miss the geo referencing parameters in the image. As per discussions (prior to this ticket) I have included hfatest results for both images, and their rrd files. The images are 144MB each, and I can upload them if someone will give me an ftp site to upload to. I will be out of office until Wednesday 6th January. Thanks in advance, Zoltan

Attachments (4)

hfatest-dt_9092_img.txt (34.7 KB ) - added by zoltan 14 years ago.
hfatest -dt results
hfatest-dt_9092_rrd.txt (60.3 KB ) - added by zoltan 14 years ago.
hfatest -dt results
hfatest-dt_9182_rrd.txt (60.4 KB ) - added by zoltan 14 years ago.
hfatest -dt results
hfatest-dt_9182_img.txt (34.6 KB ) - added by zoltan 14 years ago.
hfatest -dt results

Download all attachments as: .zip

Change History (7)

by zoltan, 14 years ago

Attachment: hfatest-dt_9092_img.txt added

hfatest -dt results

by zoltan, 14 years ago

Attachment: hfatest-dt_9092_rrd.txt added

hfatest -dt results

by zoltan, 14 years ago

Attachment: hfatest-dt_9182_rrd.txt added

hfatest -dt results

by zoltan, 14 years ago

Attachment: hfatest-dt_9182_img.txt added

hfatest -dt results

comment:1 by warmerdam, 14 years ago

Component: UtilitiesGDAL_Raster
Keywords: HFA added; translate img removed
Severity: blockernormal
Status: newassigned

I will likely need a file, just one primary .img file should be fine. When you are back we can make arrangements for a place to upload.

comment:2 by warmerdam, 14 years ago

Resolution: worksforme
Status: assignedclosed

I did:

gdal_translate zoltan_9092.img out.tif
gdalinfo out.tif

and I see:

Driver: GTiff/GeoTIFF
Files: out.tif
Size is 6000, 6000
Coordinate System is `'
GCP Projection = GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.2572235629972,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=1, Info=
          (0.5,0.5) -> (27.499813848183,-10.6748866035173,0)
GCP[  1]: Id=2, Info=
          (1200.3,0.5) -> (27.631199748183,-10.7061678035173,0)
GCP[  2]: Id=3, Info=
          (2400.1,0.5) -> (27.762585648183,-10.7374490035173,0)
GCP[  3]: Id=4, Info=
          (3599.9,0.5) -> (27.893971548183,-10.7687302035173,0)
GCP[  4]: Id=5, Info=
          (4799.7,0.5) -> (28.025357448183,-10.8000114035173,0)
GCP[  5]: Id=6, Info=
          (5999.5,0.5) -> (28.156743348183,-10.8312926035173,0)
GCP[  6]: Id=7, Info=
          (0.5,1200.3) -> (27.474245948183,-10.7806310035173,0)
GCP[  7]: Id=8, Info=
          (1200.3,1200.3) -> (27.605631848183,-10.8119122035173,0)
GCP[  8]: Id=9, Info=
          (2400.1,1200.3) -> (27.737017748183,-10.8431934035173,0)
...

so it appears the source image GCPs are preserved in the output image. I *suspect* the client application you are using does not honour TIFFs with GCPs. It is not a formulation that is widely supported.

One workaround is to use gdalwarp to rectify the image.

gdalwarp zoltan_9092.img warped.tif -co PHOTOMETRIC=MINISBLACK

The photometric thing is to avoid the GeoTIFF driver guessing that the 4band input is RGBA and producing an RGBA output file. If that is the appropriate thing to do, then just drop the creation option.

comment:3 by zoltan, 14 years ago

Hi, Yep: 100% correct. The GCPs are not noticed by the software we are using. All images (img & tifs) open correctly in qgis.

I will go via the gdalwarp route.

Thanks & regards, Zoltan

Note: See TracTickets for help on using tickets.