@Test public void testPier() { ReaderWay way = new ReaderWay(1); way.setTag("man_made", "pier"); long flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertNotEquals(0, flags); }
@Test public void testMixSpeedAndSafe() { ReaderWay way = new ReaderWay(1); way.setTag("highway", "motorway"); long flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertEquals(0, flags); way.setTag("sidewalk", "yes"); flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertEquals(5, footEncoder.getSpeed(flags), 1e-1); way.clearTags(); way.setTag("highway", "track"); flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertEquals(5, footEncoder.getSpeed(flags), 1e-1); }
@Test public void testRailPlatformIssue366() { ReaderWay way = new ReaderWay(1); way.setTag("railway", "platform"); long flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertNotEquals(0, flags); way.clearTags(); way.setTag("highway", "track"); way.setTag("railway", "platform"); flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertNotEquals(0, flags); way.clearTags(); // only tram, no highway => no access way.setTag("railway", "tram"); flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertEquals(0, flags); }
@Test public void testSlowHiking() { ReaderWay way = new ReaderWay(1); way.setTag("highway", "track"); way.setTag("sac_scale", "hiking"); long flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertEquals(FootFlagEncoder.MEAN_SPEED, footEncoder.getSpeed(flags), 1e-1); way.setTag("highway", "track"); way.setTag("sac_scale", "mountain_hiking"); flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertEquals(FootFlagEncoder.SLOW_SPEED, footEncoder.getSpeed(flags), 1e-1); }
assertTrue(footEncoder.acceptWay(way) > 0); way.setTag("sidewalk", "left"); assertTrue(footEncoder.acceptWay(way) > 0); assertFalse(footEncoder.acceptWay(way) > 0); way.setTag("sidewalk", "left"); way.setTag("access", "private"); assertFalse(footEncoder.acceptWay(way) > 0); way.clearTags(); assertTrue(footEncoder.acceptWay(way) > 0); assertTrue(footEncoder.acceptWay(way) > 0); assertFalse(footEncoder.acceptWay(way) > 0); assertTrue(footEncoder.acceptWay(way) > 0); assertTrue(footEncoder.acceptWay(way) > 0); way.setTag("foot", "no"); assertFalse(footEncoder.acceptWay(way) > 0); assertTrue(footEncoder.acceptWay(way) > 0); assertFalse(footEncoder.acceptWay(way) > 0); way.setTag("foot", "yes"); assertTrue(footEncoder.acceptWay(way) > 0);
@Test public void handleWayTagsCircularJunction() { ReaderWay way = new ReaderWay(1); way.setTag("junction", "circular"); way.setTag("highway", "tertiary"); long flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertTrue(footEncoder.isBool(flags, FlagEncoder.K_ROUNDABOUT)); }
@Test public void handleWayTagsRoundabout() { ReaderWay way = new ReaderWay(1); way.setTag("junction", "roundabout"); way.setTag("highway", "tertiary"); long flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertTrue(footEncoder.isBool(flags, FlagEncoder.K_ROUNDABOUT)); }
@Test public void testFerrySpeed() { ReaderWay way = new ReaderWay(1); way.setTag("route", "ferry"); // a bit longer than an hour way.setTag("duration:seconds", "4000"); long flags = footEncoder.handleWayTags(way, footEncoder.acceptWay(way), 0); assertTrue(footEncoder.getSpeed(flags) > footEncoder.getMaxSpeed()); assertEquals(20, footEncoder.getSpeed(flags), .1); }