Bug report #1604

Projection recognition fails when a .qml file exists

Added by Otto Dassau over 15 years ago. Updated about 15 years ago.

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

Description

I have two shape files showing graticules, both projected in EPSG:4326 and both shapefiles provide a .prj file with the same content:

cat graticule.prj:
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223
563]],PRIMEM[[Greenwich"0]UNIT["Degree]]

cat graticule_small.prj:
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223
563]],PRIMEM[[Greenwich"0]UNIT["Degree]]

when I load the two files in QGIS (svn trunk from today) only for the
graticule.shp the projection is recognized and displayed in the "General" tab of the layer properties dialog. The projection of the other shape file
graticule_small.shp is not recognized.

AFAICS it seems, that the projection is not recognized when I change the symbology and save it as graticule_small.qml. When I delete the *.qml file, the projection is recognized again correctly. This happens in QGIS head and in the current stable release.

This means every time I want to use "OTF projection" support for a shape with a saved style file (.qml) I have to define a CRS first before it works, although a correct .prj file exists.

I put the two shapefiles here for testing:
http://www.nature-consult.de/dassau/muell/projrecog.zip

regards,
Otto

Associated revisions

Revision 39d1f26f
Added by Magnus Homann about 15 years ago

Always set coordinate system, independent of any symbology style settings. Fixes #1604

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11406 c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision e028bc75
Added by Magnus Homann about 15 years ago

Always set coordinate system, independent of any symbology style settings. Fixes #1604

git-svn-id: http://svn.osgeo.org/qgis/trunk@11406 c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Giovanni Manghi over 15 years ago

Hi,

I replicated this using the qgis sample dataset (i.e. "airports" and "alaska" shapefiles). Used qgis 1.2 from trunk under Ubuntu 9.04

#2 Updated by Magnus Homann about 15 years ago

Interesting. Can be it an OGR problem?

#3 Updated by Giovanni Manghi about 15 years ago

Note:

it happens only if the .qml has the same name of the .shp file, so the .qml is loaded together with the shape/project.

In these cases the field in the general tab where usually the crs string appears is blank.

#4 Updated by Magnus Homann about 15 years ago

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

Fixed in e028bc75 (SVN r11407).

Also available in: Atom PDF