[QGIS-Developer] hasCrsTransformEnabled removed?

Nyall Dawson nyall.dawson at gmail.com
Thu May 25 02:33:20 PDT 2017


On 25 May 2017 at 19:26, Radim Blazek <radim.blazek at gmail.com> wrote:
> Hi,
>
> I found in http://qgis.org/api/api_break.html:
> setCrsTransformEnabled(), hasCrsTransformEnabled(),
> hasCrsTransformEnabledChanged() were removed. CRS transformation is
> now always enabled.
>
> But in Project Properties CRS there is now "No projection" checkbox
> instead of "Enable on the fly reprojection" in QGIS2, so basically the
> same, inverted. Which method to use to get 'No projection' state and
> which signal is emitted when it is changed?
>
> QgsProject().instance().crs().isValid() or
> QgsProject().instance().crs() == NULL?
> QgsProject().instance().crsChanged()?

"No projection" is subtly different to OTF off. No projection is
basically a "non earth" mode, where coordinates are treated exactly as
they are and all measurements become unitless.

QgsProject().instance().crs().isValid() will return false if this mode
is turned on. QgsProject().instance().crsChanged() will be emitted
when it's switched on or off.

Nyall


More information about the QGIS-Developer mailing list