[Qgis-developer] Options - CRS for new layers bug

Juraj Komacka komackaj at gmail.com
Fri Jan 30 23:17:53 PST 2015


Hi all,

I've tracked down the bug reported at https://hub.qgis.org/issues/11889,
tested against commit fe27b63.

When creating new layer, QgsCoordinateReferenceSystem instance is created
and initialized from QSettings option "/Projections/layerDefaultCrs" with
default value for fallback.  The problem is, that value is set in
/src/app/qgsoptions.cpp:1198 always from LayerDefaultCombo - labeled as
"Use a default CRS". You can verify easily - select some CRS in that combo,
select "Use project CRS" radio button, set different CRS for project, and
create new shapefile layer - it will use value from disabled "Use a default
CRS" combo.

I believe setting /Projections/layerDefaultCrs should be handled in the
block of code before - between lines 1185 and 1196 - from correct combo
according to selected radio. I will be able to make a PR on GitHub, but I
am not sure what value to set when prompt option is chosen - maybe
GEO_EPSG_CRS_AUTHID or project CRS? I am quite new in this codebase, can
anyone offer a feedback on this to me?

Reported bug is also affecting creation of new layers of all types
(SpatialLite, Scratch) and will be solved as well, because the CRS
initialization pattern is the same.

Looking forward to your opinions,
Juraj Komacka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150131/dd80bc7e/attachment.html>


More information about the Qgis-developer mailing list