Add new basic filter.

This commit is contained in:
Mikael Capelle 2018-03-12 11:25:49 +01:00
parent 8200497675
commit fa7c65a6e6

View File

@ -47,6 +47,21 @@ public class ArcFilterFactory {
}
});
// 3. Non-private roads for pedestrian and bicycle:
filters.add(new ArcFilter() {
@Override
public boolean isAllowed(Arc arc) {
return arc.getRoadInformation().getAccessRestrictions()
.isAllowedForAny(AccessMode.FOOT, EnumSet.complementOf(EnumSet
.of(AccessRestriction.FORBIDDEN, AccessRestriction.PRIVATE)));
}
@Override
public String toString() {
return "Non-private roads for pedestrian.";
}
});
// 3. Add your own filters here (do not forget to implement toString() to get an
// understandable output!):