DriesLanduyt / PMAT

QGIS plug-in: Probabilistic Map Algebra Tool
3 stars 3 forks source link

Unknown error #8

Closed charlielangan closed 6 years ago

charlielangan commented 6 years ago

Attempting to use a simple BBN a received the following error message:

An unknown error has occured. To detect the error, reread the user manual, check the intermediate results (C:\Users\r02cl13\Dropbox\Phd\Activities\ES Supply Mapping\models\BBN_model\spatial_maps\inputs) or dig into the code and interprete the python error below:

Traceback (most recent call last): File "C:/PROGRA~1/QGISWI~1/apps/qgis/./python/plugins\PMAT\probabilistic_map_algebra_tool.py", line 479, in run try: outputmaps = self.main() File "C:/PROGRA~1/QGISWI~1/apps/qgis/./python/plugins\PMAT\probabilistic_map_algebra_tool.py", line 523, in main halt = self.reshape() File "C:/PROGRA~1/QGISWI~1/apps/qgis/./python/plugins\PMAT\probabilistic_map_algebra_tool.py", line 700, in reshape refs = [self.getReference (i,size = True) for i in self.inputmaps] File "C:/PROGRA~1/QGISWI~1/apps/qgis/./python/plugins\PMAT\probabilistic_map_algebra_tool.py", line 754, in getReference G = data.GetGeoTransform() AttributeError: 'NoneType' object has no attribute 'GetGeoTransform'

Can you help identify what the issue is?

DriesLanduyt commented 6 years ago

Hi Charlie,

For some reason your input maps can't be loaded correctly. I would start with checking these. Maybe you did not convert them correctly to a Geotiff type? Hope this helps!

Regards, Dries

charlielangan commented 6 years ago

Hi Dries, All the input rasters were printed as Geotifs from a raster stack in r. They all look fine when viewing them the in Qgis. Any other suggestions? Cheers Charlie

DriesLanduyt commented 6 years ago

Hi Charlie, If you send me one of your inputfiles I can run a manual check if you want.

charlielangan commented 6 years ago

Great- Thats very kind. Find attached (hopefully) WF_maps.zip Water_flux_F.neta.zip

DriesLanduyt commented 6 years ago

Hi Charlie, I'm sorry but I can't reproduce the error. I suspected the code below would return an error but it doesn't on my computer ...

import os
from osgeo import gdal
from osgeo import gdalconst
os.chdir("D:/Users/dlanduyt/Desktop/WF_maps")
map = gdal.Open("AMT.tif", gdalconst.GA_ReadOnly)
map.GetGeoTransform()
charlielangan commented 6 years ago

SO do you think its a problem with my installation of QGIS/ PMAT?

DriesLanduyt commented 6 years ago

Don't have a clue actually. Have you tried running the example?

charlielangan commented 6 years ago

Yes- its seems to work fine.

DriesLanduyt commented 6 years ago

Last possible check: Can you replace your plugin version with the one attached? Reopen QGIS and run the plugin while the QGIS python console is open. The directories that will be printed in the console should be your input map directory. I suspect that this will not be the case on your computer. PMAT.zip

leilamac commented 6 years ago

I experienced the same error message and since there is no resolution mentioned here, wanted to record that it appears to have arisen from the input rasters and the Netica BN being in different folders. I shifted the Netica BN file into the same folder as the input .tif files and now it is running fine.

DriesLanduyt commented 6 years ago

Thanks a lot for sharing! Haven't thought about this possibility, although it's probably often the case that maps and networks are stored in different folders. I'll adapt the instructions accordingly! best regards, Dries