Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#967 closed defect (fixed)

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

Reported by: msieczka Owned by: nobody
Priority: major: does not work as expected Milestone:
Component: Projection Support Version: Trunk
Keywords: Cc:
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: no

Description

  1. start qgis
  1. define projection different than default ll/WGS84 (eg. EPSG:2180), set units (meters in EPSG:2180 case), apply, ok
  1. create new shapefile, save it
  1. the shapefile's CS is wrong - still ll/WGS84:
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]

It should be:

PROJCS["ETRS89 / Poland CS92",GEOGCS["ETRS89",DATUM["European_Terrestrial_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6258"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4258"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",19],PARAMETER["scale_factor",0.9993],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.

Attachments (1)

dump.jpg (49.9 KB ) - added by homann 15 years ago.
Settings -> Options…

Download all attachments as: .zip

Change History (12)

comment:1 by msieczka, 16 years ago

Priority: critical: causes crash or data corruptionmajor: does not work as expected
Type: bugdefect

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.

comment:2 by msieczka, 16 years ago

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

comment:3 by msieczka, 16 years ago

Summary: corrupted prj in new shapefileCRS of a new shapefile doesn't match CRS of the current project, but the global default one

in reply to:  1 comment:4 by msieczka, 16 years ago

Platform: DebianAll
Summary: CRS of a new shapefile doesn't match CRS of the current project, but the global default oneCRS of a new shapefile doesn't match CRS of the project

Replying to 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*.

comment:5 by homann, 15 years ago

Resolution: invalid
Status: newclosed

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

in reply to:  5 ; comment:6 by msieczka, 15 years ago

Resolution: invalid
Status: closedreopened

Replying to 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?

in reply to:  6 ; comment:7 by homann, 15 years ago

Resolution: invalid
Status: reopenedclosed

Replying to msieczka:

Replying to 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.

in reply to:  7 comment:8 by msieczka, 15 years ago

Resolution: invalid
Status: closedreopened

Replying to homann:

Replying to msieczka:

Replying to 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.

by homann, 15 years ago

Attachment: dump.jpg added

Settings -> Options...

comment:9 by homann, 15 years ago

Resolution: fixed
Status: reopenedclosed

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.

in reply to:  9 comment:10 by msieczka, 15 years ago

Replying to 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.

comment:11 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.