Beispiel #1
0
 def test_write_collection_points(self):
     mp = Multipoint([p.vertex for p in self.points])
     mp0 = copy(mp)
     mp1 = copy(mp.shift((4, 2)))
     mp2 = copy(mp.shift((-2, 3)))
     shp.write_shapefile([mp0, mp1, mp2], "data/points_collection")
     return
Beispiel #2
0
 def test_write_collection_multipoint(self):
     mp = Multipoint(self.points)
     mp0 = copy(mp)
     mp1 = copy(mp.shift((4, 2)))
     mp2 = copy(mp.shift((-2, 3)))
     shp.write_shapefile(os.path.join(TESTDIR, "data/mp_collection.shp"),
                         mp0, mp1, mp2)
     for fnm in ("mp_collection.shx", "mp_collection.shx", "mp_collection.dbf", "mp_collection.prj"):
         self.assertTrue(os.path.isfile(os.path.join(TESTDIR, "data", fnm)))
Beispiel #3
0
 def test_write_collection_multipoint(self):
     mp = Multipoint([p.vertex for p in self.points])
     mp0 = copy(mp)
     mp1 = copy(mp.shift((4, 2)))
     mp2 = copy(mp.shift((-2, 3)))
     shp.write_shapefile(os.path.join(TESTDIR, "data/mp_collection.shp"),
                         mp0, mp1, mp2)
     for fnm in ("mp_collection.shx", "mp_collection.shx",
                 "mp_collection.dbf", "mp_collection.prj"):
         self.assertTrue(os.path.isfile(os.path.join(TESTDIR, "data", fnm)))
Beispiel #4
0
 def test_multipoint_shift(self):
     vertices = [(a - 1, b + 2, c - 0.5) for (a, b, c) in self.vertices]
     mp = Multipoint(vertices, data=self.data)
     mp_shifted = mp.shift((1, -2, 0.5))
     self.assertEqual(mp_shifted, self.mp)
     return
Beispiel #5
0
 def test_multipoint_shift_inplace(self):
     vertices = [(a - 1, b + 2, c - 0.5) for (a, b, c) in self.vertices]
     mp = Multipoint(vertices, data=self.data)
     mp.shift((1, -2, 0.5), inplace=True)
     self.assertEqual(mp, self.mp)
Beispiel #6
0
 def test_multipoint_shift(self):
     vertices = [(a-1,b+2,c-0.5) for (a,b,c) in self.vertices]
     mp = Multipoint(vertices, data=self.data)
     mp_shifted = mp.shift((1, -2, 0.5))
     self.assertEqual(mp_shifted, self.mp)
     return
Beispiel #7
0
 def test_multipoint_shift_inplace(self):
     vertices = [(a-1,b+2,c-0.5) for (a,b,c) in self.vertices]
     mp = Multipoint(vertices, data=self.data)
     mp.shift((1, -2, 0.5), inplace=True)
     self.assertEqual(mp, self.mp)