Bug report #9397

Project's CRS is not written properly in the project's file

Added by Olivier Dalang about 10 years ago. Updated about 10 years ago.

Category:Project Loading/Saving
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:17995


Hi !

The project's CRS seems to be written in two places in a QGIS file : in the <properties>/<SpatialRefSys> block and in the <mapcanvas>/<destinationsrs> block.

But those two values are not the same !

Steps to reproduce the bug :
1) Create a new file
2) Save it
3) Change the project's CRS using the project's preferences window
4) Save it again.

While the ID and the proj4 strings seem to be ok, the code is EPSG:2056 in the first block and EPSG:4326 in the second.

That may be the cause of a whole lot of other bugs depending on which of those values is read!

Thanks !

                <proj4>+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs</proj4>
                <description>CH1903+ / LV95</description>
            <ProjectCRSProj4String type="QString">+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs</ProjectCRSProj4String>
            <ProjectCrs type="QString">EPSG:4326</ProjectCrs>
            <ProjectCRSID type="int">47</ProjectCRSID>


#1 Updated by Giovanni Manghi about 10 years ago

  • Target version set to Future Release - High Priority
  • Category set to Project Loading/Saving

#2 Updated by Leyan Ouyang about 10 years ago

I updated the CRS properties management in this pull request, this should solve the issue: https://github.com/qgis/QGIS/pull/1104

#3 Updated by Olivier Dalang about 10 years ago

  • % Done changed from 0 to 100

Great, thanks ! I set done to 100% and hope it will be merged soon !

#4 Updated by Marco Hugentobler about 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF