Using leaflet, a line is constructed between 2 points with known coordinates of end points. how can we get latitude and longitude of all points lying on that line.
使用小叶,在具有已知终点坐标的2个点之间构建线。我们怎样才能获得该线上所有点的纬度和经度。
1 个解决方案
#1
0
As I said already in How to find every point [ coordinates ] between two geolocation coordinates?, the right way is to use geographiclib to fetch the azimuth and distance between points, and calculate new points using the same azimuth but different distances, and do research about great circles.
正如我在“如何找到两个地理位置坐标之间的每个点[坐标]”中已经说过的那样,正确的方法是使用geographiclib获取点之间的方位角和距离,并使用相同的方位角但不同的距离计算新点,并进行研究关于伟大的圈子。
If you don't care about great circles and prefer to fetch the lat-lngs of the straight line as displayed in EPSG:3857, then use map.project
, map.unproject
and a tiny bit of linear interpolation.
如果你不关心大圆并且更喜欢获取EPSG:3857中显示的直线的lat-lng,那么使用map.project,map.unproject和一点点线性插值。
#1
0
As I said already in How to find every point [ coordinates ] between two geolocation coordinates?, the right way is to use geographiclib to fetch the azimuth and distance between points, and calculate new points using the same azimuth but different distances, and do research about great circles.
正如我在“如何找到两个地理位置坐标之间的每个点[坐标]”中已经说过的那样,正确的方法是使用geographiclib获取点之间的方位角和距离,并使用相同的方位角但不同的距离计算新点,并进行研究关于伟大的圈子。
If you don't care about great circles and prefer to fetch the lat-lngs of the straight line as displayed in EPSG:3857, then use map.project
, map.unproject
and a tiny bit of linear interpolation.
如果你不关心大圆并且更喜欢获取EPSG:3857中显示的直线的lat-lng,那么使用map.project,map.unproject和一点点线性插值。