Ticket #3642 (closed defect: fixed)
EPSG Datum Name massage needs to accept "+" character
|Reported by:||johncz711||Owned by:||warmerdam|
When defining a Swiss coordinate system using the "CH1903+" datum (defining by EPSG code), the "+" in the datum name is massaged into an underscore which, because it is trailing, is then removed. The result is the datum name "CH1903", which already exists as a different datum.
This may be resolved by changing the conditional statement within the first for loop of the OGREPSGDatumNameMassage function (in ogr_fromepsg.cpp) as follows:
if( pszDatum[i] != '+'
&& !(pszDatum[i] >= 'A' && pszDatum[i] <= 'Z') && !(pszDatum[i] >= 'a' && pszDatum[i] <= 'z') && !(pszDatum[i] >= '0' && pszDatum[i] <= '9') )
pszDatum[i] = '_';
Note that this change makes the conditional statement agree with the one found in the similar function MorphNameToESRI in ogr_srs_esri.cpp.
A suitably modified copy of ogr_fromepsg.cpp is in the attached zip.
I have successfully used this suggested fix in a subset of OGR code recently added to my (non-ESRI-based) platform for the sole purpose of creating WKT and writing it as .prj files.