2

I am using QGIS 2.18.

Is there a way to enable the 'on the fly' transformation project setting from the python console?

1

Try this:

# Specify destination CRS. 4326: PostgisCrsId for WGS84
CRS = QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.PostgisCrsId)

render = iface.mapCanvas().mapRenderer()
render.setDestinationCrs(CRS) # Set Destination CRS
render.setProjectionsEnabled(True) # Enable OTF

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.