Opened 7 years ago

Closed 6 years ago

#3969 closed defect (fixed)

Unable to update projection in specific HFA datasets

Reported by: rprinceley Owned by: warmerdam
Priority: normal Milestone: 1.8.1
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: HFA
Cc: gaopeng, ajain

Description

HFASetProParameters fails to update projection entry in files similar to the one attached.

PROJCS["World_Robinson",GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563]],
PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],
PROJECTION["Robinson"],PARAMETER["False_Easting",0.0],
PARAMETER["False_Northing",0.0],
PARAMETER["longitude_of_center",0.0],UNIT["Meter",1.0]]

Attachments (2)

testworld.img (65.1 KB) - added by rprinceley 7 years ago.
testworld2.img (65.6 KB) - added by rprinceley 6 years ago.

Download all attachments as: .zip

Change History (10)

Changed 7 years ago by rprinceley

Attachment: testworld.img added

comment:1 Changed 7 years ago by rprinceley

Cc: ajain added

comment:2 Changed 7 years ago by warmerdam

Keywords: HFA added
Status: newassigned

comment:3 Changed 7 years ago by warmerdam

Resolution: fixed
Status: assignedclosed

HFASetProParameters() had a similar issue with needing the entry reinitialized to zeros as we encountered with the RRDNamesList recently. I have applied the change to HFASetProParameters and HFASetDatum() and now the operation seems to work properly.

Change applied in trunk (r21757) and 1.8 branch (r21758).

comment:4 Changed 7 years ago by rprinceley

Resolution: fixed
Status: closedreopened

Some projection strings sill don't work - updating from world mercator to ESRI Sphere_Aitoff fails (if you clear projection and reopen dataset, this works).

PROJCS["Sphere_Aitoff",GEOGCS["GCS_Sphere",DATUM["Sphere",
SPHEROID["Sphere",6371000.0,0.0]],PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],PROJECTION["Aitoff"],
PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",0.0],UNIT["Meter",1.0]]

comment:5 Changed 7 years ago by warmerdam

Resolution: fixed
Status: reopenedclosed

In trunk Aitoff is supported properly *but* in this case writing the PE string equivelent was not triggered and the code did not clear the old PE String definition. So the change was to ensure that if we don't write a PE string that we do clear the old PE string. This is done in trunk (r21763) and 1.8 branch (r21764).

Note that 1.8 branch does not support Aitoff projection. This was recently incorporated in trunk as part of merging 1.6-esri changes and rectifying the projections support with definitions from Erdas. We should likely consider migrating those changes into 1.8 branch once we are confident in them.

So the Aitoff definition will sort-of work in 1.8 but only because it is written as a PE string.

comment:6 Changed 7 years ago by rprinceley

Thanks, that is all we need for now in 1.8.

I have started merging some of the projection code from trunk into our 1.8 branch, will get back after testing.

Changed 6 years ago by rprinceley

Attachment: testworld2.img added

comment:7 Changed 6 years ago by rprinceley

Resolution: fixed
Status: closedreopened

Found another case - for testworld2.img, HFAEntry::MakeData?() returns NULL in HFASetProParameters().

SR specified:

PROJCS["World_Aitoff",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Aitoff"],PARAMETER["False_Easting",0.0],
PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],
UNIT["Meter",1.0],AUTHORITY["ESRI",54043]]

comment:8 Changed 6 years ago by warmerdam

Resolution: fixed
Status: reopenedclosed

Problem reproduced. It turns out of MakeData?() was called with a smaller value it would just return pabyData but if the data had not already been loaded it was NULL. The fix is to call LoadData?() in this case to populate the buffer. Fixed in trunk (r22537), 1.8 (r22538) and 1.8-esri (r22539).

Note: See TracTickets for help on using tickets.