def test_bounds_from_input_files(): """Read bounds from input files.""" config = MapcheteConfig( os.path.join(SCRIPTDIR, "testdata/files_bounds.mapchete")) test_polygon = Polygon([[3, 2], [4, 2], [4, 1], [3, 1], [2, 1], [2, 4], [3, 4], [3, 2]]) assert config.process_area(10).equals(test_polygon)
def test_read_mapchete_input(): """Read Mapchete files as input files.""" config = MapcheteConfig( os.path.join(SCRIPTDIR, "testdata/mapchete_input.mapchete")) area = config.process_area(5) testpolygon = "POLYGON ((3 2, 3.5 2, 3.5 1.5, 3 1.5, 3 1, 2 1, 2 4, 3 4, 3 2))" assert area.equals(loads(testpolygon))
def test_override_bounds(): """Override bounds when construcing configuration.""" config = MapcheteConfig(os.path.join(SCRIPTDIR, "testdata/zoom.mapchete"), bounds=[3, 2, 3.5, 1.5]) test_polygon = Polygon([[3, 1.5], [3, 2], [3.5, 2], [3.5, 1.5], [3, 1.5]]) assert config.process_area(5).equals(test_polygon)
def test_read_bounds(): """Read bounds from config file.""" config = MapcheteConfig(os.path.join(SCRIPTDIR, "testdata/zoom.mapchete")) test_polygon = Polygon([[3, 1.5], [3, 2], [3.5, 2], [3.5, 1.5], [3, 1.5]]) assert config.process_area(5).equals(test_polygon)