在查看 Geotools 的示例时,我找不到有关将航点添加到 GeoTools 地图中的示例。
那么如何将航点添加到 Geotools 中?
根据您的意图,有几种方法可以回答您的问题:
A:GeoTools 只是一个工具包;它不提供用于添加航点的交互式地图。gt-graph 模块没有显示如何添加航点的可视教程。
A: gt-graph 模块确实展示了如何找到 2 个(或更多)位置之间的最短路径;如果您考虑您设置的那些位置航路点。
//calculate the paths
for ( Iterator d = destinations.iterator(); d.hasNext(); ) {
Node destination = (Node) d.next();
Path path = pf.getPath( destination );
//do something with the path
}
要在上下文中查看此源代码,文档页面位于此处: