use of aimax.osm.data.entities.MapWay in project aima-java by aimacode.
the class MapAdapter method getLocations.
/** {@inheritDoc} Very expensive for large maps! */
@Override
public List<String> getLocations() {
List<String> result = new ArrayList<>();
HashSet<MapNode> nodeHash = new HashSet<>();
for (MapWay way : osmMap.getWays(new BoundingBox(-90, -180, 90, 180))) {
if (filter == null || filter.isAccepted(way)) {
for (MapNode node : way.getNodes()) if (!nodeHash.contains(node)) {
result.add(Long.toString(node.getId()));
nodeHash.add(node);
}
}
}
return result;
}
Aggregations