Get Distance per Country with Graphhopper

徘徊边缘 提交于 2019-12-13 05:21:51

问题


We have a running Graphhopper Server in our company for getting routes.

Is there a way to find out how far we are driving in each country? e.g if I'm driving from Munich to Vienna I would like to know how many km we are driving in Germany and how many in Austria.


回答1:


This is not yet possible out of the box. You'll have to create a feature request for this or implement this on your own: grab the country boundaries, identify the edges/nodes to mark in the graph and then create additional instructions or store the point indices to later calculate the distances/times for every path.




回答2:


We now have built our own solution which displays us the distance per country and also separates which road types are used.

commercial_info: {
    DE: {
        distance: 461221.4580000006,
        distance_per_highway: {
            trunk: "801.1859999999999",
            motorway_link: "6521.838000000001",
            motorway: "447824.3810000005",
            primary: "5922.418000000001"
        }
    },
    RS: {
        distance: 491452.9660000001,
        distance_per_highway: {
            secondary: "17662.566",
            unclassified: "4864.14",
            primary_link: "273.186",
            service: "398.826",
            motorway_link: "727.6659999999999",
            motorway: "445850.3279999998",
            primary: "21407.297000000002"
        }
    },
    default: {
        distance: 79.43371162874004,
        distance_per_highway: {
            nan: "39.71685581437002"
        }
    }
}


来源:https://stackoverflow.com/questions/33825232/get-distance-per-country-with-graphhopper

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!