我想模拟basemap.Geod类中的ntps
的功能。
其功能描述如下:
Given a single initial point and terminus point (specified by
python floats lon1,lat1 and lon2,lat2), returns a list of
longitude/latitude pairs describing npts equally spaced
intermediate points along the geodesic between the initial and
terminus points.
我想在Cartopy中做同样的事情,一种方法是计算每对连续坐标之间所需的距离,并使用该距离计算起点到终点的坐标。还有其他方法吗?
答案 0 :(得分:0)
基于cartopy
的来源,https://github.com/SciTools/cartopy/tree/master/lib/cartopy/geodesic
,显然ntps()
中没有cartopy
函数的等效项。
但是,如果您从端点之一知道方位角,则沿着测地线计算点的位置并不难。您可以按照以下步骤操作:
forward_bearing
。一个更好的选择是使用geodesic_dist/4
并忘记以上所有内容。