简体   繁体   English

Python 代码使用纬度/经度数据在 map 上绘制带有箭头的路径

[英]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.

相关问题 使用 .png 图像数字化 map 并绘制一个已知纬度/经度的圆。 在 python 中输入半径值作为中心 - Digitize map using .png image and draw a circle with known lat./long. as center by inputing radius value in python 读取纬度/经度数据,然后在Python中的地理空间地图上打印出点 - Read in Lat/Long Data, and then print out points on a Geospatial Map in Python 从纬度/经度表中在地图上为python中的热图绘制自定义多边形? - Draw custom polygon on map for heatmap in python from table of lat/long points? 在 python 中将一列 MULTIPOLYGON 数据转换为 lat 和 long - Converting a column of MULTIPOLYGON data to lat and long in python 3g覆盖图 - 可视化lat,long,ping数据 - 3g coverage map - visualise lat, long, ping data 如何将网格化的 csv 温度数据(按纬度/经度)转换为栅格地图? - How to convert gridded csv temperature data (by lat/long) to a raster map? 如何使用Python Matplotlib在轮廓图中绘制箭头和弧线 - How to draw arrows and arcs in a contour plot using Python matplotlib 将地图坐标转换为纬度/经度 - converting map coordinates to lat/long Python代码计算三点之间的角度(lat长坐标) - Python code to calculate angle between three points (lat long coordinates) 如何使用Scrapy / XPath从JavaScript代码中抓取经/纬度 - How to scrape lat/long from JavaScript code using Scrapy / XPath
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM