本文整理汇总了Python中karta.vector.geometry.Multipoint.vertices方法的典型用法代码示例。如果您正苦于以下问题:Python Multipoint.vertices方法的具体用法?Python Multipoint.vertices怎么用?Python Multipoint.vertices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类karta.vector.geometry.Multipoint
的用法示例。
在下文中一共展示了Multipoint.vertices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_add_route
# 需要导入模块: from karta.vector.geometry import Multipoint [as 别名]
# 或者: from karta.vector.geometry.Multipoint import vertices [as 别名]
def test_add_route(self):
route = Multipoint([(np.random.random(), np.random.random())
for i in range(10)], properties={"name":"route0"})
g = vector.gpx.GPX()
g.add_route(route)
expected = self.Route([self.Point(tuple(xy), {}, {}) for xy in route.vertices()],
{"name":"route0"}, {})
self.assertEqual(g.routes[0], expected)
return
示例2: test_add_track
# 需要导入模块: from karta.vector.geometry import Multipoint [as 别名]
# 或者: from karta.vector.geometry.Multipoint import vertices [as 别名]
def test_add_track(self):
track = Multipoint([(np.random.random(), np.random.random())
for i in range(10)], properties={"name":"segment0"})
g = vector.gpx.GPX()
g.add_track(track)
expected = self.Track([self.Trkseg(
[self.Point(tuple(xy), {}, {}) for xy in track.vertices()],
{"name":"segment0"}, {})], {}, {})
self.assertEqual(g.tracks[0], expected)
return