本文整理汇总了Python中nansat.vrt.VRT.transform_coordinates方法的典型用法代码示例。如果您正苦于以下问题:Python VRT.transform_coordinates方法的具体用法?Python VRT.transform_coordinates怎么用?Python VRT.transform_coordinates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nansat.vrt.VRT
的用法示例。
在下文中一共展示了VRT.transform_coordinates方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_transform_coordinates_1d_array
# 需要导入模块: from nansat.vrt import VRT [as 别名]
# 或者: from nansat.vrt.VRT import transform_coordinates [as 别名]
def test_transform_coordinates_1d_array(self):
src_srs = NSR()
dst_srs = NSR(str('+proj=stere'))
src_points = (np.array([1,2,3,4]), np.array([5,6,7,8]), np.array([5,6,7,8]))
dst_x, dst_y, dst_z = VRT.transform_coordinates(src_srs, src_points, dst_srs)
# check if shape of the result matches the expected shape (list with four points)
self.assertEqual(dst_x.shape, (4,))
self.assertEqual(dst_y.shape, (4,))
self.assertEqual(dst_z.shape, (4,))
示例2: test_transform_coordinates_2d_array
# 需要导入模块: from nansat.vrt import VRT [as 别名]
# 或者: from nansat.vrt.VRT import transform_coordinates [as 别名]
def test_transform_coordinates_2d_array(self):
src_srs = NSR()
dst_srs = NSR(str('+proj=stere'))
src_points = (np.array([[1,2,3,4],[1,2,3,4]]),
np.array([[5,6,7,8],[5,6,7,8]]),
np.array([[5,6,7,8],[5,6,7,8]]),)
dst_x, dst_y, dst_z = VRT.transform_coordinates(src_srs, src_points, dst_srs)
# check if shape of the result matches the expected shape (2x4 array)
self.assertEqual(dst_x.shape, (2,4))
self.assertEqual(dst_y.shape, (2,4))
self.assertEqual(dst_z.shape, (2,4))