qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.29k stars 2.96k forks source link

User CRS created when selecting South African CRS : HBK_NO_23 as a CRS for a new shapefile #18569

Closed qgib closed 5 years ago

qgib commented 10 years ago

Author Name: pinghanling - (pinghanling -) Original Redmine Issue: 10101 Affected QGIS version: 2.2.0 Redmine category:projection_support


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:

  1. Creating user CRSes

  2. Start a new project in QGIS Desktop.

  3. Create a new shapefile and select South African CRS : HBK_NO_23 as the CRS.

  4. Look at the layer properties of the newly-created file - no CRS specified.:

!QGIS1.png!

  1. Close QGIS without saving the project and relaunch QGIS.
  2. 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

!QGIS2.png!

  1. Load the previously created shapefile and look at its layer properties. Its CRS is now the user-specified one:

!QGIS3.png!

  1. 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.


qgib commented 10 years ago

Author Name: Frank Sokolic (Frank Sokolic)


This problem also affects QGIS Master on Ubuntu 14.04 - checked on 2014-04-19.

qgib commented 10 years ago

Author Name: Andre Joost (Andre Joost)


Related: http://gis.stackexchange.com/questions/90339/why-are-some-layers-saved-with-custom-crs-while-others-use-the-appropriate-epsg and #17252

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.

qgib commented 10 years ago

Author Name: Jürgen Fischer (@jef-n)


qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 5 years ago

Author Name: Giovanni Manghi (@gioman)


End of life notice: QGIS 2.18 LTR

Source: http://blog.qgis.org/2019/03/09/end-of-life-notice-qgis-2-18-ltr/