示例#1
0
 def test_flow_properties_02(self):
     # Testing an empty Flow object
     dem = DEM()
     fd = Flow()
     computed = (fd.get_size(), fd.get_dims(), fd.get_ncells(), fd.get_projection(), fd.get_cellsize(), fd.get_geotransform())
     expected = (dem.get_size(), dem.get_dims(), dem.get_ncells(), dem.get_projection(), dem.get_cellsize(), dem.get_geotransform())
     self.assertEqual(computed, expected)    
示例#2
0
 def test_flow_properties_01(self):
     files = ["small", "small25", "morocco", "tunez", "jebja30"]
     for file in files:
         dem = DEM(infolder + "/{0}.tif".format(file))
         fd = Flow(infolder +  "/{0}_fd.tif".format(file))
         computed = (fd.get_size(), fd.get_dims(), fd.get_ncells(), fd.get_projection(), fd.get_cellsize(), fd.get_geotransform())
         expected = (dem.get_size(), dem.get_dims(), dem.get_ncells(), dem.get_projection(), dem.get_cellsize(), dem.get_geotransform())
         self.assertEqual(computed, expected)
示例#3
0
 def test_create_load(self):
     dem_files = ['tunez', 'tunez2', 'small25']
     for filename in dem_files:
         fd = Flow("data/fd_{0}.tif".format(filename))
         st = Network(fd, 1000)
         computed = [
             st.get_dims(),
             st.get_size(),
             st.get_ncells(),
             st.get_cellsize(),
             st.get_geotransform(),
             st.get_projection()
         ]
         expected = [
             fd.get_dims(),
             fd.get_size(),
             fd.get_ncells(),
             fd.get_cellsize(),
             fd.get_geotransform(),
             fd.get_projection()
         ]
         self.assertTrue(computed, expected)