Bug report #967

CRS of a new shapefile doesn't match CRS of the project

Added by Maciej Sieczka - almost 17 years ago. Updated over 15 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Projection Support
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11026

Description

1. start qgis

2. define projection different than default ll/WGS84 (eg. EPSG:2180), set units (meters in EPSG:2180 case), apply, ok

3. create new shapefile, save it

4. the shapefile's CS is wrong - still ll/WGS84:

GEOGCS[[GCS_WGS_1984"DATUM["D_WGS_1984"SPHEROID["WGS_1984"6378137298257223563]]PRIMEM["Greenwich"0]UNIT["Degree]]

It should be:

PROJCS[[ETRS89  Poland CS92"GEOGCS["ETRS89"DATUM["European_Terrestrial_Reference_System_1989"SPHEROID["GRS 1980"6378137298257222101AUTHORITY["EPSG""7019"]]AUTHORITY["EPSG""6258"]]PRIMEM["Greenwich"0AUTHORITY["EPSG""8901"]]UNIT["degree"001745329251994328AUTHORITY["EPSG""9122"]]AUTHORITY["EPSG""4258"]]UNIT["metre"1AUTHORITY["EPSG""9001"]]PROJECTION["Transverse_Mercator"]PARAMETER["latitude_of_origin"0]PARAMETER["central_meridian"19]PARAMETER["scale_factor"09993]PARAMETER["false_easting"500000]PARAMETER["false_northing"-5300000]AUTHORITY["EPSG""2180]]

QGIS SVN r8189, GDAL 1.5.0 + SVN r13925, QT 4.3.4, Debian testing.

dump.jpg - Settings -> Options... (49.9 KB) Magnus Homann, 2008-10-28 01:25 PM

History

#1 Updated by Maciej Sieczka - almost 17 years ago

I thought more about it. Now I understand what's going on I guess - QGIS does not force the CS of a project on a newly created shapefile, but the global default one defined in Settings > Options > Projection. I'd rather expect the project settings to take over, but not really sure as I think of it. It should be discussed which would be correct.

BTW, the title of the Settings > Options > Projection tab is wrong. It should be "Coordinate system"; a "projection" is just a part of a CS; as well as there are un-projected CSs like EPSG:4326.

#2 Updated by Maciej Sieczka - almost 17 years ago

Regarding the latter note: same applies to Project properties. And the "on the fly projection" should be "on the fly re-projection".

#3 Updated by Maciej Sieczka - over 16 years ago

Replying to [comment:1 msieczka]:

I thought more about it. Now I understand what's going on I guess - QGIS does
not force the CS of a project on a newly created shapefile, but the global
default one defined in Settings > Options > Projection. I'd rather expect
the project settings to take over, but not really sure as I think of it. It
should be discussed which would be correct.

This problem is not limited to creating shapefiles with "New Vector layer" tool. For example the Graticule Creator, Add Delimited Text Layer plugins have the same problem too.

I would expect that a newly created shapefile has the CRS that I have currently set for my project. Using the global default CRS defined in dialog "When layer is loaded that has no CRS" seems a defect to me. That setting is for existing layers, at their load time, not for newly created shapefiles.

#4 Updated by Magnus Homann about 16 years ago

  • Status changed from Open to Closed
  • Resolution set to invalid

You can select if the CRS of the new layer should be the global default, the project CRS or if it should ask for it. You do the selection in Settings -> Options...

#5 Updated by Maciej Sieczka - about 16 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (invalid)

Replying to [comment:5 homann]:

You can select if the CRS of the new layer should be the global default, the project CRS or if it should ask for it. You do the selection in Settings -> Options...

Reopening because this setting is explicitely for dealing with layers which miss CRS data at their load time. It is bogus that this setting impacts CRS info of layers newly created in QGIS. A newly created layer in QGIS should have the same CRS as the project, not as the global setting for layer's with invalid CRS data. It is easy to imagine you might want to have the global CRS different than you project CRS. What then?

#6 Updated by Magnus Homann about 16 years ago

  • Status changed from Feedback to Closed
  • Resolution set to invalid

Replying to [comment:6 msieczka]:

Replying to [comment:5 homann]:

You can select if the CRS of the new layer should be the global default, the project CRS or if it should ask for it. You do the selection in Settings -> Options...

Reopening because this setting is explicitely for dealing with layers which miss CRS data at their load time.

If you create a new layer, it does not have a CRS when you load it (after creation). It is created on disk and then loaded.

It is bogus that this setting impacts CRS info of layers newly created in >QGIS. A newly created layer in QGIS should have the same CRS as the >project, not as the global setting for layer's with invalid CRS data.

There is a radio button so you can mimic the behaviour you want. Do you feel better if we add "and new layers" to that text?

It is easy to imagine you might want to have the global CRS different than >you project CRS. What then?

Set them differently.

#7 Updated by Maciej Sieczka - about 16 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (invalid)

Replying to [comment:7 homann]:

Replying to [comment:6 msieczka]:

Replying to [comment:5 homann]:

You can select if the CRS of the new layer should be the global default, the project CRS or if it should ask for it. You do the selection in Settings -> Options...

Reopening because this setting is explicitely for dealing with layers which miss CRS data at their load time.

If you create a new layer, it does not have a CRS when you load it (after creation). It is created on disk and then loaded.

These are internals of how QGIS deals with creating new layers. User doesn't know and shouldn't. Look at it from the user's point of view please. If he sets a CRS for his project, he is right to expect a newly created layer has the same CRS as hish project, not as some global setting.

It is bogus that this setting impacts CRS info of layers newly created in >QGIS. A newly created layer in QGIS should have the same CRS as the >project, not as the global setting for layer's with invalid CRS data.

There is a radio button so you can mimic the behaviour you want. Do you feel better if we add "and new layers" to that text?

My main point is that CRS setting for a newly created layer should rather depend on project's CRS than a global one. And, moreover, that global setting is explicitely for dealing with existing layers which miss CRS. It is counter-intuitive and counter-productive to use this setting for 2 different things - managing CRS of newly created layers and managing CRS of existing layers that miss CRS data.

It is easy to imagine you might want to have the global CRS different than >you project CRS. What then?

Set them differently.

You're missing my point or I'm putting it wrong. Again: even if I set global and project's CRS different, a newly created layer still carries the CRS from the global setting instead of project's CRS.

#8 Updated by Magnus Homann about 16 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed

The functionality you are asking for is already in place.

See the screen dump, selctiong the middle radio button sets all new layers and layers without any CRS to the project CRS, not the global CRS.

Please use qgis-user for more support on the functionality of QGIS.

#9 Updated by Maciej Sieczka - about 16 years ago

Replying to [comment:9 homann]:

The functionality you are asking for is already in place.

See the screen dump, selctiong the middle radio button sets all new layers and layers without
any CRS to the project CRS, not the global CRS.

Please use qgis-user for more support on the functionality of QGIS.

What do you I'm dumb, first time user or what? Jesus god. Be my guest.

#10 Updated by Anonymous over 15 years ago

Milestone Version 1.0.0 deleted

Also available in: Atom PDF