当前位置: 首页>>代码示例>>Python>>正文


Python Line.intersects方法代码示例

本文整理汇总了Python中karta.vector.geometry.Line.intersects方法的典型用法代码示例。如果您正苦于以下问题:Python Line.intersects方法的具体用法?Python Line.intersects怎么用?Python Line.intersects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在karta.vector.geometry.Line的用法示例。


在下文中一共展示了Line.intersects方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_line_intersection2

# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersects [as 别名]
 def test_line_intersection2(self):
     # test lines that have overlapping bounding boxes, but don't cross
     #   -----
     #   | -----
     #   |     |
     #   ----- |
     #     -----
     line0 = Line([(0.0, 0.0), (3.0, 0.0), (3.0, 3.0), (0.0, 3.0)])
     line1 = Line([(1.0, 4.0), (-2.0, 4.0), (-2.0, 1.0), (1.0, 1.0)])
     self.assertFalse(line0.intersects(line1))
     return
开发者ID:fortyninemaps,项目名称:karta,代码行数:13,代码来源:vector_predicate_tests.py

示例2: test_line_intersection_vertical

# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersects [as 别名]
 def test_line_intersection_vertical(self):
     line0 = Line([(2.5, 2.5), (2.5, -2.5)])
     line1 = Line([(1.5, 2.5), (3.5, -2.5)])
     self.assertTrue(line0.intersects(line1))
     self.assertEqual(line0.intersections(line1), Multipoint([(2.5, 0.0)]))
     return
开发者ID:fortyninemaps,项目名称:karta,代码行数:8,代码来源:vector_predicate_tests.py

示例3: test_line_intersection_horizontal

# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersects [as 别名]
 def test_line_intersection_horizontal(self):
     line0 = Line([(-2.5, 2.5), (2.5, 2.5)])
     line1 = Line([(0.0, 0.0), (1.0, 5.0)])
     self.assertTrue(line0.intersects(line1))
     self.assertEqual(line0.intersections(line1), Multipoint([(0.5, 2.5)]))
     return
开发者ID:fortyninemaps,项目名称:karta,代码行数:8,代码来源:vector_predicate_tests.py

示例4: test_line_intersection

# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersects [as 别名]
 def test_line_intersection(self):
     line0 = Line([(0.0, 0.0), (3.0, 3.0)])
     line1 = Line([(0.0, 3.0), (3.0, 0.0)])
     self.assertTrue(line0.intersects(line1))
     self.assertEqual(line0.intersections(line1), Multipoint([(1.5, 1.5)]))
     return
开发者ID:fortyninemaps,项目名称:karta,代码行数:8,代码来源:vector_predicate_tests.py

示例5: test_line_intersects_geographical4

# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersects [as 别名]
 def test_line_intersects_geographical4(self):
     # checks that coordinates are normalized
     line1 = Line([(-10.0, 20.0), (-30.0, 20.0)], crs=SphericalEarth)
     line2 = Line([(340.0, 10.0), (340.0, 30.0)], crs=SphericalEarth)
     self.assertTrue(line1.intersects(line2))
     return
开发者ID:fortyninemaps,项目名称:karta,代码行数:8,代码来源:vector_predicate_tests.py

示例6: test_line_intersects_geographical3

# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersects [as 别名]
 def test_line_intersects_geographical3(self):
     # checks to make sure geodesics are handled
     line1 = Line([(-50.0, 70.0), (50.0, 70.0)], crs=SphericalEarth)
     line2 = Line([(0.0, 71.0), (1.0, 89.0)], crs=SphericalEarth)
     self.assertTrue(line1.intersects(line2))
     return
开发者ID:fortyninemaps,项目名称:karta,代码行数:8,代码来源:vector_predicate_tests.py

示例7: test_line_intersects_geographical2

# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersects [as 别名]
 def test_line_intersects_geographical2(self):
     line1 = Line([(-40.0, 36.0), (-38.0, 36.5)], crs=SphericalEarth)
     line2 = Line([(-42.0, 34.0), (-41.0, 37.5)], crs=SphericalEarth)
     self.assertFalse(line1.intersects(line2))
     return
开发者ID:fortyninemaps,项目名称:karta,代码行数:7,代码来源:vector_predicate_tests.py


注:本文中的karta.vector.geometry.Line.intersects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。