return false;
}
public static StreetTraversalPermission getPermissionsForEntity(OSMWithTags entity,
StreetTraversalPermission def) {
StreetTraversalPermission permission = null;
/*
* Only a few tags are examined here, because we only care about modes supported by OTP
* (wheelchairs are not of concern here)
*
* Only a few values are checked for, all other values are presumed to be permissive (=>
* This may not be perfect, but is closer to reality, since most people don't follow the
* rules perfectly ;-)
*/
if (entity.isGeneralAccessDenied()) {
// this can actually be overridden
permission = StreetTraversalPermission.NONE;
if (entity.isMotorcarExplicitlyAllowed()) {
permission = permission.add(StreetTraversalPermission.ALL_DRIVING);
}
if (entity.isBicycleExplicitlyAllowed()) {
permission = permission.add(StreetTraversalPermission.BICYCLE);
}
if (entity.isPedestrianExplicitlyAllowed()) {
permission = permission.add(StreetTraversalPermission.PEDESTRIAN);
}
} else {
permission = def;
}
if (entity.isMotorcarExplicitlyDenied()) {
permission = permission.remove(StreetTraversalPermission.ALL_DRIVING);
} else if (entity.hasTag("motorcar")) {
permission = permission.add(StreetTraversalPermission.ALL_DRIVING);
}
if (entity.isBicycleExplicitlyDenied()) {
permission = permission.remove(StreetTraversalPermission.BICYCLE);
} else if (entity.hasTag("bicycle")) {
permission = permission.add(StreetTraversalPermission.BICYCLE);
}
if (entity.isPedestrianExplicitlyDenied()) {
permission = permission.remove(StreetTraversalPermission.PEDESTRIAN);
} else if (entity.hasTag("foot")) {
permission = permission.add(StreetTraversalPermission.PEDESTRIAN);
}
if (entity.isUnderConstruction()) {
permission = StreetTraversalPermission.NONE;
}