Bug report #3547
On loading a layer: CRS behaviour does not work as expected for shapefiles and geotiffs no created by QGIS
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | nobody - | ||
Category: | Projection Support | ||
Affected QGIS version: | Regression?: | No | |
Operating System: | Windows | Easy fix?: | No |
Pull Request or Patch supplied: | Resolution: | duplicate | |
Crashes QGIS or corrupts data: | Copied to github as #: | 13607 |
Description
This ticket merges #3529 and #3537. Both tickets have now been closed.
Behaviour:
When loading a shapefile not created by QGIS (e.g. not having a .qpj file, but only a .prj) or when loading a geotiff file (having a CRS meta block, as reported by GDAL) into QGIS their respective CRS (in the .prj file for the shapefile, and in the meta block for the geotiff) are ignored by QGIS.
Explanation:
On loading a layer that do not have a CRS into QGIS there are three options: 1) ask user, 2) use project default CRS, and, 3) use QGIS default CRS.
One of those options should only be active if the loaded layer does not have a CRS.
For shapefile, QGIS does not recognise the .prj file. QGIS needs the qpj to recognise that the layer has a CRS.
For geotiff, QGIS does not recognise the CRS in the meta block of the file.
- When option 1) is in effect, QGIS asks the user for a CRS.
- When option 2) is on, QGIS silently sets the CRS of the shapefile or geotiff to the project CRS.
- When option 3) is on, QGIS silently sets the CRS of the shapefile or geotiff to the default CRS.
Thus, when options 2) or 3) are active, the layer is located at the wrong place, if its "true" CRS is different from the project or default CRS respectively.
When option 1) is active, it is a pain to be asked for a CRS.
History
#1 Updated by Jürgen Fischer over 13 years ago
depends on the .prj. If your .prj exactly matches a CRS in QGIS's srs database it will accept it otherwise it will act as if no .prj is present. That behaviour was changed in 83982440 (SVN r15362) - QGIS will now add the CRS as custom CRS.
#2 Updated by Jürgen Fischer over 13 years ago
- Resolution set to duplicate
- Status changed from Open to Closed
should be fixed. See also #3620