[英]Python code to draw a path on a map with arrows using lat/long data
Along with time and heading, I also have the latitude & longitude data.除了时间和航向,我还有纬度和经度数据。 From the data, I want to draw a path with arrows that indicate the path a vehicle took.
根据数据,我想绘制一条带箭头的路径,指示车辆所走的路径。
I can create a path, but I am not able to make arrows on the path, in order to specify the path and the direction, it took.我可以创建一条路径,但我无法在路径上制作箭头,为了指定路径和方向,它采取了。
I want to create a plot that looks like the image below.我想创建一个如下图所示的 plot。
If you are using matplotlib, you could use quiver
如果您使用的是 matplotlib,则可以使用
quiver
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
# Arrow locations
lon = [1,1,2,2]
lat = [1,2,2,1]
# Arrow directions
x_dir = [1,0,-1,0]
y_dir = [0,-1,0,1]
# add to plot using quiver
ax.quiver(lon,lat,x_dir,y_dir,angles='xy', scale_units='xy')
plt.show()
I cannot be more precise with info you provided, but above logic could be used.我无法根据您提供的信息更加精确,但可以使用上述逻辑。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.