public CarFlagEncoder(PMap properties) { this((int) properties.getLong("speed_bits", 5), properties.getDouble("speed_factor", 5), properties.getBool("turn_costs", false) ? 1 : 0); this.properties = properties; this.setBlockFords(properties.getBool("block_fords", true)); this.setBlockByDefault(properties.getBool("block_barriers", true)); }
@Test public void testFordAccess() { ReaderNode node = new ReaderNode(0, 0.0, 0.0); node.setTag("ford", "yes"); ReaderWay way = new ReaderWay(1); way.setTag("highway", "unclassified"); way.setTag("ford", "yes"); // Node and way are initially blocking assertTrue(encoder.isBlockFords()); assertFalse(encoder.acceptWay(way) > 0); assertTrue(encoder.handleNodeTags(node) > 0); try { // Now they are passable encoder.setBlockFords(false); assertTrue(encoder.acceptWay(way) > 0); assertFalse(encoder.handleNodeTags(node) > 0); } finally { encoder.setBlockFords(true); } }
public CarFlagEncoder( PMap properties ) { this((int) properties.getLong("speed_bits", 5), properties.getDouble("speed_factor", 5), properties.getBool("turn_costs", false) ? 1 : 0); this.properties = properties; this.setBlockFords(properties.getBool("block_fords", true)); }
public CarFlagEncoder(PMap properties) { this((int) properties.getLong("speed_bits", 5), properties.getDouble("speed_factor", 5), properties.getBool("turn_costs", false) ? 1 : 0); this.properties = properties; this.setBlockFords(properties.getBool("block_fords", true)); this.setBlockByDefault(properties.getBool("block_barriers", true)); }
public CarFlagEncoder(PMap properties) { this((int) properties.getLong("speed_bits", 5), properties.getDouble("speed_factor", 5), properties.getBool("turn_costs", false) ? 1 : 0); this.properties = properties; this.setBlockFords(properties.getBool("block_fords", true)); this.setBlockByDefault(properties.getBool("block_barriers", true)); }