@Override public PolyLine asPolyLine() { final PolyLine one = this.upstream.asPolyLine(); final PolyLine two = this.downstream.asPolyLine(); final List<Location> points = new ArrayList<>(); one.forEach(points::add); for (int i = 1; i < two.size(); i++) { points.add(two.get(i)); } return new PolyLine(points); }
public Iterable<LocationIterableProperties> asGeoJsonRestrictedPath() { return this.turnRestrictions().stream() .map(turnRestriction -> new LocationIterableProperties( turnRestriction.getRoute().asPolyLine(), Maps.hashMap("highway", "motorway", "oneway", "yes", "route", turnRestriction.getRoute().toString()))) .collect(Collectors.toList()); }
ComplexHighwayAreaHelper(final Edge edge) { this.sourceEdge = edge; buildHighwayAreaBoundary(Route.forEdge(edge)).ifPresent(route -> { this.boundary = route.asPolyLine(); StreamSupport.stream(route.spliterator(), false).map(Edge::getIdentifier) .forEach(this.visitedEdgeIdentifiers::add); this.sourceEdge = edge.getAtlas().edge(this.visitedEdgeIdentifiers.first()); }); if (this.boundary == null) { this.oops = new CoreException("Unable to build boundary for edge {}", edge.getOsmIdentifier()); } }
final PolyLine line = road.getRoute().asPolyLine();
@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); }
/** * Checks for roads that should not be inside a roundabout. Such roads are car navigable, not a * roundabout, bridge, or tunnel, don't have a layer tag, and have geometry inside the * roundabout. * * @param roundabout * A roundabout as a {@link Route} * @return true if there is a road that is crossing and has geometry enclosed by the roundabout */ private boolean roundaboutEnclosesRoads(final Route roundabout) { final Polygon roundaboutPoly = new Polygon(roundabout.asPolyLine()); return roundabout.start().getAtlas().edgesIntersecting(roundaboutPoly, edge -> HighwayTag.isCarNavigableHighway(edge) && !JunctionTag.isRoundabout(edge) && !this.ignoreBridgeTunnelCrossings(edge) && this.intersectsWithEnclosedGeometry(roundaboutPoly, edge)) .iterator().hasNext(); }