本文整理汇总了Python中karta.vector.geometry.Multipoint.convex_hull方法的典型用法代码示例。如果您正苦于以下问题:Python Multipoint.convex_hull方法的具体用法?Python Multipoint.convex_hull怎么用?Python Multipoint.convex_hull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类karta.vector.geometry.Multipoint
的用法示例。
在下文中一共展示了Multipoint.convex_hull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_multipoint_convex_hull_sph
# 需要导入模块: from karta.vector.geometry import Multipoint [as 别名]
# 或者: from karta.vector.geometry.Multipoint import convex_hull [as 别名]
def test_multipoint_convex_hull_sph(self):
# include a point which is in the planar convex hull but not the spherical one
vertices = [(-50, 70), (0, 71), (50, 70), (0, 50)]
mp = Multipoint(vertices, crs=SphericalEarth)
ch = mp.convex_hull()
self.assertTrue(np.all(np.equal(ch.vertices(), [(-50, 70), (0, 50), (50, 70)])))
return
示例2: test_multipoint_convex_hull
# 需要导入模块: from karta.vector.geometry import Multipoint [as 别名]
# 或者: from karta.vector.geometry.Multipoint import convex_hull [as 别名]
def test_multipoint_convex_hull(self):
vertices = [(953, 198), (986, 271), (937, 305), (934, 464), (967, 595),
(965, 704), (800, 407), (782, 322), (863, 979), (637, 689),
(254, 944), (330, 745), (363, 646), (27, 990), (127, 696),
(286, 352), (436, 205), (88, 254), (187, 85)]
mp = Multipoint(vertices)
ch = mp.convex_hull()
hull_vertices = [(27, 990), (88, 254), (187, 85), (953, 198),
(986, 271), (965, 704), (863, 979)]
self.assertTrue(np.all(np.equal(ch.vertices(), hull_vertices)))
return
示例3: test_multipoint_convex_hull2
# 需要导入模块: from karta.vector.geometry import Multipoint [as 别名]
# 或者: from karta.vector.geometry.Multipoint import convex_hull [as 别名]
def test_multipoint_convex_hull2(self):
vertices = [(-158, 175), (-179, 230), (-404, -390), (259, -79), (32,
144), (-59, 355), (402, 301), (239, 159), (-421, 172), (-482, 26),
(2, -499), (134, -72), (-412, -12), (476, 235), (-412, 40), (-198,
-256), (314, 331), (431, -492), (325, -415), (-400, -491)]
mp = Multipoint(vertices)
ch = mp.convex_hull()
hull_vertices = [(2, -499), (431, -492), (476, 235), (402, 301), (314,
331), (-59, 355), (-421, 172), (-482, 26), (-400, -491)]
self.assertTrue(np.all(np.equal(ch.vertices, hull_vertices)))
return