DriesLanduyt / PMAT

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

Run error related with rasters #4

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hello. I´m using QGis2.10.1 (pisa) and 5.24 Netica version.

When I try to run the PMAT I obtain the following error: "Raster basis of input maps differs" All the rasters are geotiff, in the same projection, with the same names as the nodes name and I did the leg files too.

I attach the folder I´m usung,

Thanks a lot.

Ricardo Moreno BN.zip

DriesLanduyt commented 7 years ago

Just checked the .tif files you provide and there are slight differences among the rasters you use. You can check this yourself by running the following code in your python console within QGIS

import os
os.chdir("Path_to_inputmap_directory")
from osgeo import gdal
from osgeo import gdalconst
dataset = gdal.Open('inputmap1.tif',gdal.GA_ReadOnly)
dataset.GetGeoTransform()

This code yields the following output:

(496242.90684317605, 10.0, 0.0, 4097558.7344859336, 0.0, -10.0)
(496242.90684317605, 10.0, 0.0, 4097558.7344859336, 0.0, -10.0)
(496242.93485421326, 10.0, 0.0, 4097558.7506889454, 0.0, -10.0)

As you can see, the first and fourth element of the last array (for mucv_07et89.tif) deviate from the other arrays. These elements refer to the geographic location of the upper left raster cell in your .tif files. This difference is quite small, however, as I haven't implemented ways to deal with offsets, my plugin is quite sensitive to this.

To eliminate this offset, I suggest using the Align Rasters... tool within QGIS which can be found under Raster

ghost commented 7 years ago

Thank you very much. It worked fine! Ricardo.