获取整个路线,Google地图或OpenStreetMap的精确地理坐标 [英] Get exact geo coordinates along an entire route, Google Maps or OpenStreetMap
问题描述
我需要的是沿着整个路线的地理位置(lat / long),以特定的时间间隔(例如,每1/4英里或100米)。
有没有办法通过Google Maps API /网络服务完成此操作?
或者OpenStreetMap数据库可以做到这一点吗?
亲切的问候,
Madeleine 。
OSRM 为您提供路线道路几何形状与OpenStreetMap数据库一样。例如,您可以将路线作为GPX(如果需要,可以后处理该文件)。这看起来如下所示:
GET http://router.project-osrm.org/viaroute?hl=zh-CN& loc = 47.064970,15.458470& loc = 47.071100,15.476760& output = gpx
了解更多:< a href =https://github.com/DennisOSRM/Project-OSRM/wiki/Server-api> OSRM API文档。
Suppose I have a route defined from one town to another. From the Google Maps API I can recover a route between the two. However, the route returned from Google is a driving route that includes geo-coordinates only at places where there is another step in a leg (for example, where I have to turn from one highway to another).
What I need is geo-locations (lat/long) along the entire route, at specific intervals (for example, every 1/4 mile or 100m).
Is there a way to accomplish this via the Google Maps API / web services?
Or would the OpenStreetMap database be the way to do it?
Kind regards, Madeleine.
OSRM gives you routes with road geometries as they are in the OpenStreetMap database. For example, you can get the route as GPX (and post-process this file if you want). This would look like the following:
GET http://router.project-osrm.org/viaroute?hl=en&loc=47.064970,15.458470&loc=47.071100,15.476760&output=gpx
Read more: OSRM API docs.
这篇关于获取整个路线,Google地图或OpenStreetMap的精确地理坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!