Opened 13 years ago

Closed 13 years ago

#3547 closed bug (duplicate)

On loading a layer: CRS behaviour does not work as expected for shapefiles and geotiffs no created by QGIS

Reported by: benoitrsa Owned by: nobody
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: Projection Support Version: Trunk
Keywords: CRS, Projection, load, default, Shapefile, PRJ, QPJ, geotiff Cc:
Must Fix for Release: Yes Platform: Windows
Platform Version: WinXP, Win7, Mac OS X Awaiting user input: no

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.

Change History (2)

comment:1 by jef, 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 r15361 - QGIS will now add the CRS as custom CRS.

comment:2 by jef, 13 years ago

Resolution: duplicate
Status: newclosed

should be fixed. See also #3620

Note: See TracTickets for help on using tickets.