id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 4673,MorphFromESRI() compares SPHEROID names instead of parameter values,etourigny,etourigny,"ESRI WKT .prj files do not include TOWGS84 parameters, and gdal-1.9 does not add TOWGS84 parameters to the generated OSR definition. An attempt to correct this has been implemented in MorphFromESRI() with an optional capability to add missing TOWGS84 parameters though GDAL_FIX_ESRI_WKT config option (see #4345). Since gdal-1.9 there have been a number of regressions in software like qgis, in which certain .prj files are are not assigned correct towgs84 parameters, even with GDAL_FIX_ESRI_WKT=TOWGS84 - such as the release-blocking issue at http://hub.qgis.org/issues/5598. This particular problem is due to the fact that the code looks for matching SPHEROID node names, rather than parameters (semi_major, inv_flattening). The following file corresponds to EPSG:4131 but TOWGS84 fixing does not work, because of a mis-match in SPHEROID name - ""Everest 1830 (1937 Adjustment)"" vs. ""Everest_Adjustment_1937"" {{{ $ cat tmp1.prj GEOGCS[""GCS_Indian_1960"",DATUM[""D_Indian_1960"",SPHEROID[""Everest_Adjustment_1937"",6377276.345,300.8017]],PRIMEM[""Greenwich"",0.0],UNIT[""Degree"",0.0174532925199433]] $ gdalsrsinfo EPSG:4131 PROJ.4 : '+proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=198,881,317,0,0,0,0 +no_defs ' OGC WKT : GEOGCS[""Indian 1960"", DATUM[""Indian_1960"", SPHEROID[""Everest 1830 (1937 Adjustment)"",6377276.345,300.8017, AUTHORITY[""EPSG"",""7015""]], TOWGS84[198,881,317,0,0,0,0], AUTHORITY[""EPSG"",""6131""]], PRIMEM[""Greenwich"",0, AUTHORITY[""EPSG"",""8901""]], UNIT[""degree"",0.0174532925199433, AUTHORITY[""EPSG"",""9122""]], AUTHORITY[""EPSG"",""4131""]] tourigny@supernova: /data/research/work/qgis/issues/5598 $ GDAL_FIX_ESRI_WKT=TOWGS84 gdalsrsinfo tmp1.prj PROJ.4 : '+proj=longlat +a=6377276.345 +b=6356075.41314024 +no_defs ' OGC WKT : GEOGCS[""GCS_Indian_1960"", DATUM[""Indian_1960"", SPHEROID[""Everest_Adjustment_1937"",6377276.345,300.8017]], PRIMEM[""Greenwich"",0.0], UNIT[""Degree"",0.0174532925199433]] }}} An easy (but short-sighted) fix is to add the proper mapping in ogr_srs_esri.cpp {{{ static const char *apszSpheroidMapping[] = { ""WGS_84"", ""WGS_1984"", ""WGS_72"", ""WGS_1972"", ""GRS_1967_Modified"", ""GRS_1967_Truncated"", ""Krassowsky_1940"", ""Krasovsky_1940"", +""Everest_1830_1937_Adjustment"", ""Everest_Adjustment_1937"", NULL, NULL }; }}} A better and permanent fix is to compare SPHEROID nodes based on parameters rather than node names. This might be worth including in 1.9.1, but it is probably too late. ",defect,closed,normal,closed_because_of_github_migration,OGR_SRS,1.9.0,normal,wontfix,"esri, wkt, towgs84, spheroid",