CPNO27 is not an official EPSG code, reference ID in QGIS 2.2 is ZANGI:ZANGI:CPNO27
. The official one is EPSG:22287
Cape/Lo27
The difference is the axis orientation: CPNO21 has +axis=enu
(which is default and can be omitted), while Cape/Lo27 has +axis=wsu
.
Usually, .prj files do not deal with the EPSG codes, but use the full WKT parameters. QGIS has to guess the EPSG codes from them, and sometimes fails and creates a custom CRS from it.
You can override wrong guesses with rightclick -> Set CRS for layer
.
QGIS additionally creates a .qpj file where the EPSG code is stored. If you exchange that, next time QGIS will come up with the right CRS. Unfortunately, this does not work as expected for non-EPSG codes.
Here is the CPNO27 .prj file:
PROJCS["Transverse_Mercator",
GEOGCS["GCS_unnamed ellipse",
DATUM["D_unknown",
SPHEROID["Unknown",6378249.145,293.4663076999908]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",27],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
and the .qpj file:
PROJCS["unnamed",
GEOGCS["unnamed ellipse",
DATUM["unknown",
SPHEROID["unnamed",6378249.145,293.4663076999908],
TOWGS84[-136,-108,-292,0,0,0,0]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",27],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
For the official EPSG:22287 code, the qpj reads:
PROJCS["Cape / Lo27",
GEOGCS["Cape",
DATUM["Cape",
SPHEROID["Clarke 1880 (Arc)",6378249.145,293.4663077,
AUTHORITY["EPSG","7013"]],
TOWGS84[-136,-108,-292,0,0,0,0],
AUTHORITY["EPSG","6222"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4222"]],
PROJECTION["Transverse_Mercator_South_Orientated"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",27],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["Y",WEST],
AXIS["X",SOUTH],
AUTHORITY["EPSG","22287"]]
OK, let's manipulate the last one to meet CPNO27:
PROJCS["South African CRS : Cape_NO_27",
GEOGCS["Cape",
DATUM["Cape",
SPHEROID["Clarke 1880 (Arc)",6378249.145,293.4663077,
AUTHORITY["EPSG","7013"]],
TOWGS84[-136,-108,-292,0,0,0,0],
AUTHORITY["EPSG","6222"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4222"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",27],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["X",EAST],
AXIS["Y",NORTH],
AUTHORITY["ZANGI:ZANGI","CPNO27"]]
This seems to work for me when adding new files to the QGIS project. Old layers may still have the custom CRS stored inside the .qgs project file.