@Override public long handleWayTags(ReaderWay way, long allowed, long relationFlags) { if (!isAccept(allowed)) return 0; long flags = 0; if (!isFerry(allowed)) { String sacScale = way.getTag("sac_scale"); if (sacScale != null) { if ("hiking".equals(sacScale)) flags = speedEncoder.setDoubleValue(flags, MEAN_SPEED); else flags = speedEncoder.setDoubleValue(flags, SLOW_SPEED); } else { flags = speedEncoder.setDoubleValue(flags, MEAN_SPEED); } flags |= directionBitMask; boolean isRoundabout = way.hasTag("junction", "roundabout") || way.hasTag("junction", "circular"); if (isRoundabout) flags = setBool(flags, K_ROUNDABOUT, true); } else { double ferrySpeed = getFerrySpeed(way); flags = setSpeed(flags, ferrySpeed); flags |= directionBitMask; } int priorityFromRelation = 0; if (relationFlags != 0) priorityFromRelation = (int) relationCodeEncoder.getValue(relationFlags); flags = priorityWayEncoder.setValue(flags, handlePriority(way, priorityFromRelation)); return flags; }
@Override public long handleWayTags(ReaderWay way, long allowed, long relationFlags) { if (!isAccept(allowed)) return 0; long flags = 0; if (!isFerry(allowed)) { String sacScale = way.getTag("sac_scale"); if (sacScale != null) { if ("hiking".equals(sacScale)) flags = speedEncoder.setDoubleValue(flags, MEAN_SPEED); else flags = speedEncoder.setDoubleValue(flags, SLOW_SPEED); } else { flags = speedEncoder.setDoubleValue(flags, MEAN_SPEED); } flags |= directionBitMask; boolean isRoundabout = way.hasTag("junction", "roundabout"); if (isRoundabout) flags = setBool(flags, K_ROUNDABOUT, true); } else { double ferrySpeed = getFerrySpeed(way, SLOW_SPEED, MEAN_SPEED, FERRY_SPEED); flags = setSpeed(flags, ferrySpeed); flags |= directionBitMask; } int priorityFromRelation = 0; if (relationFlags != 0) priorityFromRelation = (int) relationCodeEncoder.getValue(relationFlags); flags = priorityWayEncoder.setValue(flags, handlePriority(way, priorityFromRelation)); return flags; }
flags = setSpeed(flags, ferrySpeed); flags |= directionBitMask;
@Override public long handleWayTags(ReaderWay way, long allowed, long relationFlags) { if (!isAccept(allowed)) return 0; long flags = 0; if (!isFerry(allowed)) { String sacScale = way.getTag("sac_scale"); if (sacScale != null) { if ("hiking".equals(sacScale)) flags = speedEncoder.setDoubleValue(flags, MEAN_SPEED); else flags = speedEncoder.setDoubleValue(flags, SLOW_SPEED); } else { flags = speedEncoder.setDoubleValue(flags, MEAN_SPEED); } flags |= directionBitMask; boolean isRoundabout = way.hasTag("junction", "roundabout") || way.hasTag("junction", "circular"); if (isRoundabout) flags = setBool(flags, K_ROUNDABOUT, true); } else { double ferrySpeed = getFerrySpeed(way); flags = setSpeed(flags, ferrySpeed); flags |= directionBitMask; } int priorityFromRelation = 0; if (relationFlags != 0) priorityFromRelation = (int) relationCodeEncoder.getValue(relationFlags); flags = priorityWayEncoder.setValue(flags, handlePriority(way, priorityFromRelation)); return flags; }