def test_modelernotinorder(self):
     outputs = processing.runalg("modeler:notinorder", raster(), None)
     output = outputs["CAREA_ALG0"]
     self.assertTrue(os.path.isfile(output))
     dataset = gdal.Open(output, GA_ReadOnly)
     strhash = hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash, -1557050506)
Exemple #2
0
 def test_gdalogrsieve(self):
     outputs = processing.runalg('gdalogr:sieve', raster(), 2, 0, None)
     output = outputs['dst_filename']
     self.assertTrue(os.path.isfile(output))
     dataset = gdal.Open(output, GA_ReadOnly)
     strhash = hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash, -1353696889)
Exemple #3
0
 def test_gdalogrsieve(self):
     outputs = processing.runalg('gdalogr:sieve', raster(), 2, 0, None)
     output = outputs['dst_filename']
     self.assertTrue(os.path.isfile(output))
     dataset = gdal.Open(output, GA_ReadOnly)
     strhash = hash(unicode(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash, -1353696889)
 def test_modelersimplemodel(self):
     outputs = processing.runalg("modeler:simplemodel", raster(), None)
     output = outputs["SLOPE_ALG0"]
     self.assertTrue(os.path.isfile(output))
     dataset = gdal.Open(output, GA_ReadOnly)
     strhash = hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash, 1891122097)
Exemple #5
0
 def test_sagametricconversions(self):
     outputs=processing.runalg("saga:metricconversions",raster(),0,None)
     output=outputs['CONV']
     self.assertTrue(os.path.isfile(output))
     dataset=gdal.Open(output, GA_ReadOnly)
     strhash=hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash,-2137931723)
Exemple #6
0
 def test_sagasortgrid(self):
     outputs=processing.runalg("saga:sortgrid",raster(),True,None)
     output=outputs['OUTPUT']
     self.assertTrue(os.path.isfile(output))
     dataset=gdal.Open(output, GA_ReadOnly)
     strhash=hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash,1320073153)
Exemple #7
0
 def test_modelernotinorder(self):
     outputs = processing.runalg('modeler:notinorder', raster(), None)
     output = outputs['CAREA_ALG0']
     self.assertTrue(os.path.isfile(output))
     dataset = gdal.Open(output, GA_ReadOnly)
     strhash = hash(unicode(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash, -1557050506)
Exemple #8
0
 def test_SagaRasterAlgorithmWithUnsupportedOutputFormat(self):
     outputs=processing.runalg("saga:convergenceindex",raster(),0,0,getTempFilename("img"))
     output=outputs['RESULT']
     self.assertTrue(os.path.isfile(output))
     dataset=gdal.Open(output, GA_ReadOnly)
     strhash=hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash, 485390137)
Exemple #9
0
 def test_gdalogrmerge(self):
     outputs=processing.runalg("gdalogr:merge",raster(),False,False,None)
     output=outputs['OUTPUT']
     self.assertTrue(os.path.isfile(output))
     dataset=gdal.Open(output, GA_ReadOnly)
     strhash=hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash,-1353696889)
Exemple #10
0
 def test_modelersimplemodel(self):
     outputs = processing.runalg('modeler:simplemodel', raster(), None)
     output = outputs['SLOPE_ALG0']
     self.assertTrue(os.path.isfile(output))
     dataset = gdal.Open(output, GA_ReadOnly)
     strhash = hash(unicode(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash, 1891122097)
Exemple #11
0
 def test_gdalogrwarpreproject(self):
     outputs=processing.runalg("gdalogr:warpreproject",raster(),"EPSG:23030","EPSG:4326",0,0,"",None)
     output=outputs['OUTPUT']
     self.assertTrue(os.path.isfile(output))
     dataset=gdal.Open(output, GA_ReadOnly)
     strhash=hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash,-2021328784)
Exemple #12
0
 def test_gdalogrsieveWithUnsupportedOutputFormat(self):
     outputs=processing.runalg("gdalogr:sieve",raster(),2,0, ProcessingUtils.getTempFilename("img"))
     output=outputs['dst_filename']
     self.assertTrue(os.path.isfile(output))
     dataset=gdal.Open(output, GA_ReadOnly)
     strhash=hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash,-1353696889)
Exemple #13
0
 def test_sagasortgrid(self):
     outputs = processing.runalg('saga:sortgrid', raster(), True, None)
     output = outputs['OUTPUT']
     self.assertTrue(os.path.isfile(output))
     dataset = gdal.Open(output, GA_ReadOnly)
     strhash = hash(unicode(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash, 1320073153)
Exemple #14
0
 def test_sagametricconversions(self):
     outputs=processing.runalg("saga:metricconversions",raster(),0,None)
     output=outputs['CONV']
     self.assertTrue(os.path.isfile(output))
     dataset=gdal.Open(output, GA_ReadOnly)
     strhash=hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash,-2137931723)
Exemple #15
0
 def test_SagaRasterAlgorithmWithUnsupportedOutputFormat(self):
     outputs=processing.runalg("saga:convergenceindex",raster(),0,0,ProcessingUtils.getTempFilename("img"))
     output=outputs['RESULT']
     self.assertTrue(os.path.isfile(output))
     dataset=gdal.Open(output, GA_ReadOnly)
     strhash=hash(str(dataset.ReadAsArray(0).tolist()))
     self.assertEqual(strhash, 485390137)