def test_colorado_montana_overlap_area(): ## Test get_overlap_area() with two non-adjecent state polygon objects with open('./data/colorado.json', 'r') as f_colorado: d_colorado = json.load(f_colorado) json_colorado = json.dumps(d_colorado) with open('./data/montana.json', 'r') as f_montana: d_montana = json.load(f_montana) json_montana = json.dumps(d_montana) result = check_polygon_intersection(json_colorado, json_montana) assert (result == INTERSECTION_FALSE) == True
def test_colorado_wyoming_overlap_area(): ## Test get_overlap_area() with two adjecent state polygon objects with open('./data/colorado.json', 'r') as f_colorado: d_colorado = json.load(f_colorado) json_colorado = json.dumps(d_colorado) with open('./data/wyoming.json', 'r') as f_wyoming: d_wyoming = json.load(f_wyoming) json_wyoming = json.dumps(d_wyoming) result = check_polygon_intersection(json_colorado, json_wyoming) assert (result == INTERSECTION_TRUE) == True
def test_exception_on_invalid_geojson(): ## Test check_polygon_intersection() for raise(InvalidGeoJson) on invalid GeoJSON format with pytest.raises(InvalidGeoJson): result = check_polygon_intersection(NON_POLY, POLY_GOOD)
def test_polygon_NON_intersection(): ## Test check_polygon_intersection() with two polygons that do NOT intersect result = check_polygon_intersection(POLY_1, POLY_2) assert (result == INTERSECTION_FALSE) == True
def test_polygon_intersection(): ## Test check_polygon_intersection() with two polygons that do intersect result = check_polygon_intersection(POLY_1, POLY_1) assert (result == INTERSECTION_TRUE) == True