Changeset 7858 for trunk/anuga_core/source/anuga/geometry/test_polygon.py
 Timestamp:
 Jun 18, 2010, 4:43:10 PM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/anuga_core/source/anuga/geometry/test_polygon.py
r7841 r7858 8 8 9 9 from polygon import * 10 from polygon import _poly_xy 11 from polygon_function import Polygon_function 10 12 from anuga.coordinate_transforms.geo_reference import Geo_reference 11 13 from anuga.geospatial_data.geospatial_data import Geospatial_data … … 1570 1572 # Simplest case: Polygon is the unit square 1571 1573 polygon = [[0,0], [1,0], [1,1], [0,1]] 1572 x, y = poly_xy(polygon)1574 x, y = _poly_xy(polygon) 1573 1575 assert len(x) == len(polygon)+1 1574 1576 assert len(y) == len(polygon)+1 … … 1584 1586 # Arbitrary polygon 1585 1587 polygon = [[1,5], [1,1], [100,10], [1,10], [3,6]] 1586 x, y = poly_xy(polygon)1588 x, y = _poly_xy(polygon) 1587 1589 assert len(x) == len(polygon)+1 1588 1590 assert len(y) == len(polygon)+1 … … 1605 1607 polygon1 = [[0,0], [1,0], [1,1], [0,1]] 1606 1608 polygon2 = [[1,1], [2,1], [3,2], [2,2]] 1607 v = plot_polygons([polygon1, polygon2], figname='test1') 1608 assert len(v) == 4 1609 assert v[0] == 0 1610 assert v[1] == 3 1611 assert v[2] == 0 1612 assert v[3] == 2 1609 plot_polygons([polygon1, polygon2], figname='test1') 1613 1610 1614 1611 # Another case 1615 1612 polygon3 = [[1,5], [10,1], [100,10], [50,10], [3,6]] 1616 1613 v = plot_polygons([polygon2,polygon3], figname='test2') 1617 assert len(v) == 4 1618 assert v[0] == 1 1619 assert v[1] == 100 1620 assert v[2] == 1 1621 assert v[3] == 10 1622 1623 os.remove('test1.png') 1624 os.remove('test2.png') 1614 1615 for file in ['test1.png', 'test2.png']: 1616 assert os.access(file, os.R_OK) 1617 os.remove(file) 1618 1625 1619 1626 1620 def test_inside_polygon_geospatial(self):
Note: See TracChangeset
for help on using the changeset viewer.