本文整理汇总了Python中karta.vector.geometry.Point.walk方法的典型用法代码示例。如果您正苦于以下问题:Python Point.walk方法的具体用法?Python Point.walk怎么用?Python Point.walk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类karta.vector.geometry.Point
的用法示例。
在下文中一共展示了Point.walk方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_walk_albers_geodetic
# 需要导入模块: from karta.vector.geometry import Point [as 别名]
# 或者: from karta.vector.geometry.Point import walk [as 别名]
def test_walk_albers_geodetic(self):
AlaskaAlbers = ProjectedCRS("+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 "
"+x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs",
"+ellps=GRS80")
start = Point((-2658638, 2443580), crs=AlaskaAlbers)
dest = start.walk(4500, 195.0, projected=False)
self.assertAlmostEqual(dest.x, -2662670.889, places=3)
self.assertAlmostEqual(dest.y, 2441551.155, places=3)
示例2: test_walk_albers_projected
# 需要导入模块: from karta.vector.geometry import Point [as 别名]
# 或者: from karta.vector.geometry.Point import walk [as 别名]
def test_walk_albers_projected(self):
AlaskaAlbers = ProjectedCRS("+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 "
"+x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs",
"+ellps=GRS80")
start = Point((-2658638, 2443580), crs=AlaskaAlbers)
dest = start.walk(4500, 195.0)
self.assertAlmostEqual(dest.x, -2659802.686, places=3)
self.assertAlmostEqual(dest.y, 2439233.334, places=3)
return
示例3: test_walk
# 需要导入模块: from karta.vector.geometry import Point [as 别名]
# 或者: from karta.vector.geometry.Point import walk [as 别名]
def test_walk(self):
start = Point((-123.1, 49.25), crs=LonLatWGS84)
dest = start.walk(1e5, 80.0)
self.assertAlmostEqual(dest.x, -121.743196, places=6)
self.assertAlmostEqual(dest.y, 49.398187, places=6)
return
示例4: test_walk_cartesian
# 需要导入模块: from karta.vector.geometry import Point [as 别名]
# 或者: from karta.vector.geometry.Point import walk [as 别名]
def test_walk_cartesian(self):
start = Point((-3, -4), crs=Cartesian)
dest = start.walk(5.0, 90-math.atan2(4.0, 3.0)*180/math.pi)
self.assertAlmostEqual(dest.x, 0.0)
self.assertAlmostEqual(dest.y, 0.0)
return
示例5: test_walk_lonlat
# 需要导入模块: from karta.vector.geometry import Point [as 别名]
# 或者: from karta.vector.geometry.Point import walk [as 别名]
def test_walk_lonlat(self):
start = Point((-132.14, 54.01), crs=LonLatWGS84)
dest = start.walk(5440.0, 106.8)
self.assertAlmostEqual(dest.x, -132.0605910876)
self.assertAlmostEqual(dest.y, 53.99584742821)
return
示例6: test_walk_cartesian
# 需要导入模块: from karta.vector.geometry import Point [as 别名]
# 或者: from karta.vector.geometry.Point import walk [as 别名]
def test_walk_cartesian(self):
start = Point((-3, -4), crs=Cartesian)
dest = start.walk(5.0, math.atan(3.0/4.0), radians=True)
self.assertAlmostEqual(dest.x, 0.0)
self.assertAlmostEqual(dest.y, 0.0)
return