@SuppressWarnings("deprecation") public LocationIterableProperties asGeoJson() { final Map<String, String> tagsNo = Maps.hashMap("highway", "primary", "oneway", "yes", "type", "NO"); final Map<String, String> tagsOnly = Maps.hashMap("highway", "primary", "oneway", "yes", "type", "ONLY"); return new LocationIterableProperties(this.route().asPolyLine(), this.getTurnRestrictionType() == TurnRestrictionType.NO ? tagsNo : tagsOnly); }
switch (turnRestriction.getTurnRestrictionType()) turnRestriction.getTurnRestrictionType()); return false; default: turnRestriction.getTurnRestrictionType());
Route toMember = null; this.relation = relation; this.type = getTurnRestrictionType(relation); if (this.type == TurnRestrictionType.OTHER)
@Test public void testOnlyRestriction() { final Atlas atlasOnly = this.rule.getAtlasOnly(); logger.trace("AtlasOnly: {}", atlasOnly); final Route candidate = Route.forEdges(atlasOnly.edge(102), atlasOnly.edge(203)); int counter = 0; for (final ComplexTurnRestriction restriction : new ComplexTurnRestrictionFinder() .find(atlasOnly, Finder::ignore)) { if (restriction.getTurnRestriction() .getTurnRestrictionType() == TurnRestrictionType.ONLY) { final Route route = restriction.route(); if (candidate.equals(route)) { counter++; } } } Assert.assertEquals(1, counter); final Set<RestrictedPath> paths = new HashSet<>(); for (final BigNode bigNode : new BigNodeFinder().find(atlasOnly, Finder::ignore)) { paths.addAll(bigNode.turnRestrictions()); } Assert.assertEquals(3, paths.size()); }
.find(atlasNo, Finder::ignore)) if (restriction.getTurnRestriction().getTurnRestrictionType() == TurnRestrictionType.NO)