在查看 Geotools 的示例时,我找不到有关将航点添加到 GeoTools map 中的示例。
那么如何将路径点添加到 Geotools 中?
最佳答案
根据您的意图,有几种方法可以回答您的问题:
答:GeoTools 只是一个工具包;它不提供用于添加航路点的交互式 map 。 gt-graph 模块没有可视化教程来展示如何添加航路点。
答: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
}
要在上下文中查看此源代码,文档页面位于此处:
关于java - 如何在 GeoTools 中添加航点项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5620835/