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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)