Bug report #8058

No update of CRS cache when modifying a custom CRS

Added by Leyan Ouyang over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Marco Hugentobler
Category:Projection Support
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16899

Description

In 1.8, if I update a custom CRS, I can directly use the new value for this CRS, while in master, I have to restart QGIS to be able to use the updated parameters. They are displayed when I choose the CRS, but not used during the actual transformation, which is a severe regression in my opinion as it makes the whole custom CRS management very confusing.

This is due to the recent use of a cache to store CRS parameters (since commit 8dc0135). There is currently no way to update the cache, short of restarting QGIS.

I tried to write a simple updateCRSCache function, but it isn't giving the expected result. The CRS seems updated in the debug output, but nothing is redrawn. Here is what I wrote so far: https://github.com/leyan/Quantum-GIS/commits/custom_CRS

History

#1 Updated by Marco Hugentobler over 6 years ago

The updateCRSCache function is fine. However, there is also a crs transform cache that copies the crs and that needs to be updated as well (sorry, the crs / transform cache have mainly been made with the server usage in mind...). It should now work after 406144511982b479b74133fd74c805f10a9dbc63, please test.

#2 Updated by Leyan Ouyang over 6 years ago

This works for me. Actually the behavior is not exactly the same, as the layers are reprojected automatically as soon as they are redrawn. Previously, the CRS had to be selected again for each layer before the new parameters can be used. I think the new behavior is better and that is a change I was planning to add anyway.

I added a pull request to deal with deleted custom CRS: https://github.com/qgis/Quantum-GIS/pull/661

The whole custom CRS management still is a bit flaky, with a bad UI (I know, I did it ;) ) and a lot of things that should be more robust. Anyway, this was already the case in 1.8 so no regression there, I guess improvements will have to wait for the next version.

#3 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Open to Feedback

can this be closed?

#4 Updated by Marco Hugentobler over 6 years ago

I added a pull request to deal with deleted custom CRS

Applied. It would also be possible to just delete the crs cache entry for update and delete (if the crs is not cached, the entry will be created on next usage).

The whole custom CRS management still is a bit flaky, with a bad UI (I know, I did it ;) ) and a lot of things that should be more >robust. Anyway, this was already the case in 1.8 so no regression there, I guess improvements will have to wait for the next version.

I agree. It will be greatly appreciated if you improve custom crs handling and ui for the next version.

Thanks for your input and patches,
Marco

#5 Updated by Leyan Ouyang over 6 years ago

  • Status changed from Feedback to Closed

Yes, can be closed for me, the main issue is solved.

Also available in: Atom PDF