#3642 closed defect (fixed)
EPSG Datum Name massage needs to accept "+" character
Reported by: | johncz711 | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.8.0 |
Component: | OGR_SRS | Version: | 1.7.2 |
Severity: | normal | Keywords: | |
Cc: |
Description
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.
Attachments (1)
Change History (3)
by , 14 years ago
Attachment: | MOD_ogr_fromepsg.zip added |
---|
comment:1 by , 14 years ago
Milestone: | → 1.8.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
r20497 /trunk/gdal/ogr/ogr_fromepsg.cpp: EPSGGetPMInfo() : add correct code in order the shortcut for Greenwich to work (#3644)