File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -55,12 +55,16 @@ void QgsDistanceArea::setSourceSRS(long srsid)
55
55
56
56
void QgsDistanceArea::setProjectAsSourceSRS ()
57
57
{
58
- int projEnabled = QgsProject::instance ()->readNumEntry (" SpatialRefSys" ," /ProjectionsEnabled" ,0 );
59
- long srsid = GEOSRS_ID;
60
- if (projEnabled)
61
- {
62
- srsid = QgsProject::instance ()->readNumEntry (" SpatialRefSys" ," /ProjectSRSID" ,GEOSRS_ID);
63
- }
58
+ // This function used to only get the /ProjectSRSID if on-the-fly
59
+ // projection was enabled (and used a default value in all other
60
+ // cases). However, even if it was not, a valid value for
61
+ // /ProjectSRSID is most likely available, and we now use it in all
62
+ // cases (as it gives correct distances and areas even when
63
+ // on-the-fly projection is turned off). The default of GEOSRS_ID
64
+ // is still applied if all else fails.
65
+
66
+ int srsid = QgsProject::instance ()->readNumEntry (" SpatialRefSys" ," /ProjectSRSID" ,GEOSRS_ID);
67
+ 0
64
68
setSourceSRS (srsid);
65
69
}
66
70
You can’t perform that action at this time.
0 commit comments