Bug report #10101
User CRS created when selecting South African CRS : HBK_NO_23 as a CRS for a new shapefile
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Projection Support | ||
Affected QGIS version: | 2.2.0 | Regression?: | No |
Operating System: | Windows 7 and 8 | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | end of life |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 18569 |
Description
When selecting South African CRS : HBK_NO_23 as the CRS for a new shapefile, QGIS creates slightlly different QPJ and PRJ files and creates a new user-specified CRS in the list of CRSes available in the QGIS desktop environment.
Steps followed to reproduce the issue:
Creating user CRSes¶
1. Start a new project in QGIS Desktop.
2. Create a new shapefile and select South African CRS : HBK_NO_23 as the CRS.
3. Look at the layer properties of the newly-created file - no CRS specified.:
4. Close QGIS without saving the project and relaunch QGIS.
5. Select Settings - Custom CRS from the menu; a new user-specified CRS has been added with a definition almost identical to South African CRS : HBK_NO_23. The only difference is that the user-specified CRS doesn’t have an +axis parameter set (values copied from QGIS Desktop Project Properties dialogue box):
South African CRS : HBK_NO_23:
+proj=tmerc +lat_0=0 +lon_0=23 +k=1 +x_0=0 +y_0=0 +axis=enu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
User-specified CRS:
+proj=tmerc +lat_0=0 +lon_0=23 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
6. Load the previously created shapefile and look at its layer properties. Its CRS is now the user-specified one:
QPJ and PRJ files are not identical¶
The shapefile’s .prj and .qpj files have slightly different values for the datum’s degree unit (different number of decimal places and 295 (last three digits) in PRJ replaced with 3 in QPJ:
PRJ
PROJCS["Transverse_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_unknown",SPHEROID["WGS84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",23],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]]
QPJ
PROJCS["unnamed",GEOGCS["WGS 84",DATUM["unknown",SPHEROID["WGS84",6378137,298.257223563],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",23],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]]
I don't think a user-specified CRS should be created when selecting a built-in CRS.
Also, I'm not sure if the differences in the QPJ and PRJ files might create problems when using other GIS software.
History
#1 Updated by Frank Sokolic over 10 years ago
This problem also affects QGIS Master on Ubuntu 14.04 - checked on 2014-04-19.
#2 Updated by Andre Joost over 10 years ago
Related: http://gis.stackexchange.com/questions/90339/why-are-some-layers-saved-with-custom-crs-while-others-use-the-appropriate-epsg and #8487
I solved the problem by manually setting the authority and code parameters at the end of the .qpj file:
AUTHORITY["ZANGI:ZANGI","CPNO27"]]
I suspect that the "ZANGI:ZANGI:xyz" spoils the usual storing of authority and code into the .qpj file. As far as I see from the srs.db, "ZANGI" is inserted as auth_name and "ZANGI:xyz" is stored in auth_id.
I guess that revision 14f639d568fb5b8aba8b96f70f4b4e71253df0d4 was made in a hurry, not looking carefully at the way other srs codes are stored.
Apart from the fact that the National Geo-spatial Information of South Africa does not call itself ZANGI, but NGI: http://www.ngi.gov.za/
So "NGIZA" would sound better to me.
#3 Updated by Jürgen Fischer over 10 years ago
- Category set to Projection Support
#4 Updated by Giovanni Manghi over 7 years ago
- Regression? set to No
- Easy fix? set to No
#5 Updated by Giovanni Manghi almost 6 years ago
- Resolution set to end of life
- Status changed from Open to Closed
End of life notice: QGIS 2.18 LTR
Source:
http://blog.qgis.org/2019/03/09/end-of-life-notice-qgis-2-18-ltr/