Opened 21 months ago

Last modified 20 months ago

#6079 reopened defect

img files (HFA) are created with simplified prj strings

Reported by: ccjklppp Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: 2.0.1
Severity: normal Keywords:
Cc:

Description

when creating img files (HFA driver), the files are created with simplified prj strings (i.e. a prj with no authority codes). for example: img file created by gdalwarp with epsg 4326, contains the following prj (read by gdalinfo):

GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]

On the contrary, when I use erdas imagine to create an img file (from the same source), the output contains the following prj (read by gdalinfo):

GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]

Attachments (3)

input.tif (29.7 KB) - added by ccjklppp 21 months ago.
output-ERDAS14.img (14.5 KB) - added by ccjklppp 21 months ago.
output-GDAL.img (59.3 KB) - added by ccjklppp 21 months ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 21 months ago by ccjklppp

Milestone: 2.0.1

comment:2 Changed 21 months ago by Even Rouault

Could you attach a file generated by ERDAS Imagine that is reported with AUTHORITY["EPSG","4326"] by gdalinfo ?

Changed 21 months ago by ccjklppp

Attachment: input.tif added

Changed 21 months ago by ccjklppp

Attachment: output-ERDAS14.img added

Changed 21 months ago by ccjklppp

Attachment: output-GDAL.img added

comment:3 Changed 21 months ago by ccjklppp

I added 3 files for example (input, ouputs - erdas,gdal)

comment:4 Changed 21 months ago by Even Rouault

Component: defaultGDAL_Raster
Resolution: fixed
Status: newclosed

trunk r29763, branches/2.0 r29764 "HFA: when reading projection, preserve EPSG code if AutoIdentifyEPSG() identified the SRS, even if a PE string is present (#6079)"

comment:5 Changed 20 months ago by ccjklppp

Resolution: fixed
Status: closedreopened

It seems that the repair that was performed fixed only some coordinate systems such as Wgs84, Wgs72... The prj written for other coordinate systems such as Ed1950 (EPSG: 4230) is still as before the change (without EPSG code in the output header)

comment:6 Changed 20 months ago by ccjklppp

Milestone: 2.0.12.0.2
Version: 2.0.02.0.1

comment:7 in reply to:  5 Changed 20 months ago by Even Rouault

Milestone: 2.0.2

Replying to ccjklppp:

It seems that the repair that was performed fixed only some coordinate systems such as Wgs84, Wgs72... The prj written for other coordinate systems such as Ed1950 (EPSG: 4230) is still as before the change (without EPSG code in the output header)

Yes, this is a limitation of the Imagine coordinate system format. It doesn't store EPSG codes. So only a few codes can be retrieved back the AutoIdentifyEPSG() method. A much more involved method would be needed to identify the EPSG code from the definitions of the EPSG database. I'm removing the target milestone as, personaly, I'm not planning to tackle that without appropriate funding. If you are interested, you can contact me at contact@…

Note: See TracTickets for help on using tickets.