def test_calgary_census_full_extent(self): self.assertEqual( convert_polygons_to_raster( "test_data/calgary_census.shp", "test_data/calgary_census_full_ext.tif", "Pid", 100 ), 1, )
def test_010012_L2_user_extent(self): self.assertEqual( convert_polygons_to_raster( "test_data/010012.shp", "test_data/010012_user_ext_L2.tif", "ID_L2", 0.5, 635315, 635829, 5713674, 5714098, ), 1, )
def test_calgary_census_bad_user_extent(self): self.assertEqual( convert_polygons_to_raster( "test_data/calgary_census.shp", "test_data/calgary_census_user_ext.tif", "Pid", 10, 710896, 698110, 5653301, 5673054, ), 0, )
def test_simple_rectangle_full_extent_even_cell_size(self): self.assertEqual( convert_polygons_to_raster("test_data/simple_square.shp", "test_data/simple_square_ext8m_c1m.tif", "id", 1), 1, )
def test_010012_L2_full_extent(self): self.assertEqual( convert_polygons_to_raster("test_data/010012.shp", "test_data/010012_full_ext_L2.tif", "ID_L2", 1), 1 )
def test_shapefile_points(self): self.assertEqual(convert_polygons_to_raster("test_data/points.shp", "no_output.tif", "Pid", 100), 0)
def test_invalid_id_field(self): self.assertEqual(convert_polygons_to_raster("test_data/calgary_census.shp", "no_output.tif", "uid", 100), 0)
def test_invalid_shapefile(self): self.assertEqual(convert_polygons_to_raster("test_data/nofile.shp", "no_output.tif", "Pid", 100), 0)