Bug report #4109

Save-as to "original CRS" incorrectly reprojects if OTF reprojection is disabled

Added by Alister Hood almost 13 years ago. Updated over 12 years ago.

Status:Closed
Priority:High
Assignee:-
Category:GUI
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 #:14091

Description

With on-the-fly reprojection disabled, right-click on a shape file with a CRS (defined in a .prj file) that does not match the project CRS, and choose "Save as". Save to the "original CRS". Open the new file - you will see that it has been reprojected from the layer's original CRS into the project CRS.
This does not make sense. It should either:
- not be reprojected and the new .prj file should have the same CRS as the old .prj file (this is what happens when on-the-fly reprojection is enabled), or
- not be reprojected and the new .prj file should have the project CRS.

I'm not really sure which would be better - maybe there should be a choice: "This project has on-the-fly reprojection disabled and the original layer CRS does not match the project CRS. Would you like to treat the original layer as being in the project CRS?"

Perhaps there should also be a choice if the user has done "Set layer CRS": "The user-defined layer CRS does not match the CRS defined in the .prj file. Which CRS would you like to treat the original layer as being in?"

N.B. I am running trunk - I'm not sure if this bug is also present in 1.7.

test_orig.zip (1.56 KB) Alister Hood, 2012-02-02 08:10 PM

Associated revisions

Revision 3f50017a
Added by Jürgen Fischer over 12 years ago

vector layer save as: replace 'original crs' with 'layer crs' and 'project crs' - OTFR doesn't matter anymore (fixes #4109)

Revision b3807b72
Added by Jürgen Fischer over 12 years ago

vector layer save as: replace 'original crs' with 'layer crs' and 'project crs' - OTFR doesn't matter anymore (fixes #4109)

History

#1 Updated by Giovanni Manghi over 12 years ago

  • Target version set to Version 1.7.4

#2 Updated by Giovanni Manghi over 12 years ago

  • Status changed from Open to Feedback
  • Affected QGIS version set to master
  • Crashes QGIS or corrupts data set to No

I have tested both master and 1.7.3 under Windows and Linux and I cannot replicate the issue. Please check again and report back.

#3 Updated by Alister Hood over 12 years ago

Giovanni Manghi wrote:

I have tested both master and 1.7.3 under Windows and Linux and I cannot replicate the issue. Please check again and report back.

Yes, you're right, but I now find that it occurs with on-the-fly reprojection ENABLED. This doesn't really make sense either, although it would be nice to have a quick choice between saving to the original layer CRS or the original project CRS.

It might actually make sense to have another dialogue, "You have selected to save to the original CRS, but the original layer CRS does not match the project CRS. Which CRS would you like to save to?". This would prevent people getting confused by saving to the wrong CRS.

#4 Updated by Giovanni Manghi over 12 years ago

Alister Hood wrote:

Giovanni Manghi wrote:

I have tested both master and 1.7.3 under Windows and Linux and I cannot replicate the issue. Please check again and report back.

Yes, you're right, but I now find that it occurs with on-the-fly reprojection ENABLED. This doesn't really make sense either, although it would be nice to have a quick choice between saving to the original layer CRS or the original project CRS.

It might actually make sense to have another dialogue, "You have selected to save to the original CRS, but the original layer CRS does not match the project CRS. Which CRS would you like to save to?". This would prevent people getting confused by saving to the wrong CRS.

Regardless of having OTFR enabled or disabled I can always "save as..." a vector in the CRS I choose in the dialog. If you are still having problems it might be something related to a specific dataset? Try attach a sample.

#5 Updated by Alister Hood over 12 years ago

Regardless of having OTFR enabled or disabled I can always "save as..." a vector in the CRS I choose in the dialog

Perhaps you misunderstand. Don't choose a CRS. Use the default "Original CRS" setting.

#6 Updated by Alister Hood over 12 years ago

Here is a sample in "New Zealand Transverse Mercator 2000".
Load the file. Enable OTFR and change the project CRS to "New Zealand Map Grid".
Right-click on the file and choose "Save as". Use the default "Original CRS" setting.
Load the new file - you will see it is in NZMG.

#7 Updated by Jürgen Fischer over 12 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

#8 Updated by Alister Hood over 12 years ago

Thanks, that dialog has suddenly become much nicer ;)

Also available in: Atom PDF