1 |
# Copyright (c) 2002 by Intevation GmbH |
# Copyright (c) 2002, 2003 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
4 |
# |
# |
54 |
-13.55668830871582, 66.520111083984375]) |
-13.55668830871582, 66.520111083984375]) |
55 |
self.assertEquals(layer.ShapesInRegion((-24.0, 64.0, -23.75, 64.25)), |
self.assertEquals(layer.ShapesInRegion((-24.0, 64.0, -23.75, 64.25)), |
56 |
[613, 726, 838]) |
[613, 726, 838]) |
57 |
|
layer.Destroy() |
58 |
|
|
59 |
def test_polygon_layer(self): |
def test_polygon_layer(self): |
60 |
"""Test Layer with polygon shapes""" |
"""Test Layer with polygon shapes""" |
74 |
-13.495815277099609, 66.563774108886719]) |
-13.495815277099609, 66.563774108886719]) |
75 |
self.assertEquals(layer.ShapesInRegion((-24.0, 64.0, -23.9, 64.1)), |
self.assertEquals(layer.ShapesInRegion((-24.0, 64.0, -23.9, 64.1)), |
76 |
[91, 92, 144, 146, 148, 150, 152, 153]) |
[91, 92, 144, 146, 148, 150, 152, 153]) |
77 |
|
layer.Destroy() |
78 |
|
|
79 |
def test_point_layer(self): |
def test_point_layer(self): |
80 |
"""Test Layer with point shapes""" |
"""Test Layer with point shapes""" |
92 |
-15.12291431427002, 66.36572265625]) |
-15.12291431427002, 66.36572265625]) |
93 |
self.assertEquals(layer.ShapesInRegion((-24.0, 64.0, -23.80, 64.1)), |
self.assertEquals(layer.ShapesInRegion((-24.0, 64.0, -23.80, 64.1)), |
94 |
[0, 1, 2, 3, 4, 5, 27, 28, 29, 30, 31]) |
[0, 1, 2, 3, 4, 5, 27, 28, 29, 30, 31]) |
95 |
|
layer.Destroy() |
96 |
|
|
97 |
def test_empty_layer(self): |
def test_empty_layer(self): |
98 |
"""Test Layer with empty shape file""" |
"""Test Layer with empty shape file""" |
111 |
self.assertEquals(layer.BoundingBox(), None) |
self.assertEquals(layer.BoundingBox(), None) |
112 |
self.assertEquals(layer.LatLongBoundingBox(), None) |
self.assertEquals(layer.LatLongBoundingBox(), None) |
113 |
self.assertEquals(layer.NumShapes(), 0) |
self.assertEquals(layer.NumShapes(), 0) |
114 |
|
layer.Destroy() |
115 |
|
|
116 |
|
|
117 |
class TestLayerLegend(unittest.TestCase, support.SubscriberMixin): |
class TestLayerLegend(unittest.TestCase, support.SubscriberMixin): |
179 |
|
|
180 |
|
|
181 |
if __name__ == "__main__": |
if __name__ == "__main__": |
182 |
unittest.main() |
support.run_tests() |