如何根据 GeoJSON 文件在两点之间的地图上绘制道路?
How to plot roads on maps between two points based on GeoJSON file?
我想可视化两点之间可能的道路,例如 google 地图,我有一个包含道路网络的 GeoJSON 文件,是否有可能或是否有任何算法仅绘制两点之间的道路?
-我就是这样做的,希望线路按路走
你用什么平台?对于 PostgreSQL / PostGIS,有 PG Routing extension that you can use. It can find shortest path between vertices of road network. So you would need to find the vertices of the road network closest to the start and destination, and then find a route between them. There are plenty of guides, e.g. https://anitagraser.com/2011/02/07/a-beginners-guide-to-pgrouting/
如果您使用的是原始 Python,请重新创建 Dijkstra Shortest Path 算法。
我想可视化两点之间可能的道路,例如 google 地图,我有一个包含道路网络的 GeoJSON 文件,是否有可能或是否有任何算法仅绘制两点之间的道路?
-我就是这样做的,希望线路按路走
你用什么平台?对于 PostgreSQL / PostGIS,有 PG Routing extension that you can use. It can find shortest path between vertices of road network. So you would need to find the vertices of the road network closest to the start and destination, and then find a route between them. There are plenty of guides, e.g. https://anitagraser.com/2011/02/07/a-beginners-guide-to-pgrouting/
如果您使用的是原始 Python,请重新创建 Dijkstra Shortest Path 算法。