Me gustaría utilizar el plugin Gridsplitter en la consola. Tengo el siguiente código para hacerlo:
from qgis.core import *
import qgis.utils
import imp
gridSplitterPath = "C:/Users/Mossy/.qgis2/python/plugins/gridSplitter/gridSplitter.py"
outputpath = "C:/Users/Mossy/Desktop/NewFolder/Output"
cutlayerpath = "C:/Users/Mossy/Desktop/NewFolder/InputData/cutlayer.shp"
layertocutpath = "C:/Users/Mossy/Desktop/NewFolder/InputData/layertocut.tif"
iface = qgis.utils.iface
module = imp.load_source("gridSplitter",gridSplitterPath)
mySplitter = module.gridSplitter(iface)
mySplitter.outputfolder = outputpath
mySplitter.layertocut = QgsRasterLayer(layertocutpath,"laytocut")
mySplitter.cutlayeris = True
mySplitter.cutlayer = QgsVectorLayer(cutlayerpath,"cutlay", "ogr")
mySplitter.pref = "cut_"
mySplitter.subfolderis = False
mySplitter.tileindexis = True
mySplitter.operate()
Sin embargo, me aparece el siguiente error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "c:/users/Mossy/appdata/local/temp/tmpqc7_fe.py", line 23, in <module>
mySplitter.operate()
File "C:/Users/Mossy/.qgis2/python/plugins/gridSplitter/gridSplitter.py", line 206, in operate
self.layertocutcrs= layertocut.crs()
AttributeError: 'NoneType' object has no attribute 'crs'
¿Alguien sabe cómo resolver este problema?
1 votos
Dice en la consola.