Ejemplo n.º 1
0
    def test_create_split_polygons(self):
        ge = GeometrySplitter(self.fixture_polygon_with_hole)
        spolygons = ge.create_split_polygons(list(ge.iter_interiors())[0])
        self.assertEqual(len(spolygons), 4)

        actual = [sp.bounds for sp in spolygons]
        desired = [(1.999999, 9.999999, 3.0, 13.0), (3.0, 9.999999, 4.000001, 13.0),
                   (3.0, 13.0, 4.000001, 20.000001), (1.999999, 13.0, 3.0, 20.000001)]
        self.assertEqual(actual, desired)
Ejemplo n.º 2
0
 def test_create_split_vector_dict(self):
     ge = GeometrySplitter(self.fixture_polygon_with_hole)
     desired = [{
         'rows': (9.999999, 13.0, 20.000001),
         'cols': (1.999999, 3.0, 4.000001)
     }]
     actual = list(
         [ge.create_split_vector_dict(i) for i in ge.iter_interiors()])
     self.assertEqual(actual, desired)
Ejemplo n.º 3
0
    def test_create_split_polygons(self):
        ge = GeometrySplitter(self.fixture_polygon_with_hole)
        spolygons = ge.create_split_polygons(list(ge.iter_interiors())[0])
        self.assertEqual(len(spolygons), 4)

        actual = [sp.bounds for sp in spolygons]
        desired = [(1.999999, 9.999999, 3.0, 13.0),
                   (3.0, 9.999999, 4.000001, 13.0),
                   (3.0, 13.0, 4.000001, 20.000001),
                   (1.999999, 13.0, 3.0, 20.000001)]
        self.assertEqual(actual, desired)
Ejemplo n.º 4
0
 def test_iter_interiors(self):
     ge = GeometrySplitter(self.fixture_polygon_with_hole)
     actual = list([g.bounds for g in ge.iter_interiors()])
     self.assertEqual(actual, [(2.5, 10.5, 3.5, 15.5)])
Ejemplo n.º 5
0
 def test_create_split_vector_dict(self):
     ge = GeometrySplitter(self.fixture_polygon_with_hole)
     desired = [{'rows': (9.999999, 13.0, 20.000001), 'cols': (1.999999, 3.0, 4.000001)}]
     actual = list([ge.create_split_vector_dict(i) for i in ge.iter_interiors()])
     self.assertEqual(actual, desired)
Ejemplo n.º 6
0
 def test_iter_interiors(self):
     ge = GeometrySplitter(self.fixture_polygon_with_hole)
     actual = list([g.bounds for g in ge.iter_interiors()])
     self.assertEqual(actual, [(2.5, 10.5, 3.5, 15.5)])