Skip to content

Instantly share code, notes, and snippets.

Last active November 26, 2021 17:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Spinning globe
# QGIS spinning globe export.
# Run first
# Uses the GISPO globe plugin:
import time
from PyQt5.QtGui import *
mapCanvas = iface.mapCanvas()
vLayer = iface.activeLayer()
def spin(seconds):
"""Pause for set amount of seconds, replaces time.sleep so program doesn't stall"""
time_end = time.time() + seconds
while time.time() < time_end:
c = 100
change_globe_origo(0, 180)
# after running the above line, you should do a zoom to layer, and copy the resulting scale to the below line and into the loop.
# I copy this in seperately:
for i in range(180, -180, -10):
c += 1
change_globe_origo(0, i)
mapCanvas.saveAsImage('C:/path/path/globe/' + str(c) + '.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment