本文整理匯總了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