本文整理汇总了Python中karta.vector.geometry.Multipoint.shift方法的典型用法代码示例。如果您正苦于以下问题:Python Multipoint.shift方法的具体用法?Python Multipoint.shift怎么用?Python Multipoint.shift使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类karta.vector.geometry.Multipoint
的用法示例。
在下文中一共展示了Multipoint.shift方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_write_collection_points
# 需要导入模块: from karta.vector.geometry import Multipoint [as 别名]
# 或者: from karta.vector.geometry.Multipoint import shift [as 别名]
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
示例2: test_write_collection_multipoint
# 需要导入模块: from karta.vector.geometry import Multipoint [as 别名]
# 或者: from karta.vector.geometry.Multipoint import shift [as 别名]
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)))
示例3: test_multipoint_shift
# 需要导入模块: from karta.vector.geometry import Multipoint [as 别名]
# 或者: from karta.vector.geometry.Multipoint import shift [as 别名]
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
示例4: test_multipoint_shift_inplace
# 需要导入模块: from karta.vector.geometry import Multipoint [as 别名]
# 或者: from karta.vector.geometry.Multipoint import shift [as 别名]
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)