Navigation Mapping Workshop State of the Map 2018

Kajari Ghosh • Minh Nguyễn

© D. Herrera / CC BY

Welcome to the Navigation Mapping Workshop! I’m Kajari and I work at Mapbox on the routing engine! This is Minh. [Minh] By day, I work at Mapbox on the iOS team; by night, I add turn lanes in OSM. We’ll be at the Mapbox table in front of De Donato later in the conference! But first, the workshop. Before we begin

• You can use either iD or JOSM to make edits to OSM

• This is not a general introduction to mapping

• Mainstream tagging – not proposing/promoting obscure tags today

Before we begin, here’s how the workshop will be structured, to make sure we all get the most out of our time together. Use either iD or JOSM – each has its purpose, so we don’t care which you use. This is not a general introduction to mapping. Due to time constraints, we’re going to assume you already know how to draw things so they look good on the map. There are a lot of competing ideas out there about navigation mapping – we debate these ideas within Mapbox too. But we’re going to stick to mainstream tags that are hopefully uncontroversial, tags that are well supported by routers – not just Mapbox’s router but also others such as OsmAnd and Maps.me. We love talking about the more arcane aspects of navigation mapping too, but let’s save that for outside this workshop. © Mapbox / ISC Data © OSM / ODbL

We’re going to spend the first part of this workshop introducing several considerations to keep in mind as you map, then you’re going to get some hands-on practice mapping for navigation. First of all, we say “navigation” but you might call it “routing” or “directions”. How do I get there?

Whatever the case, it’s about getting from one place to another with the help of human-readable guidance instructions. The instructions might come in a list that you print out, or they might be delivered in real time over a phone’s speaker as you drive or walk along the route. Armchair to cupholder

Data Router UI

“In a quarter mile, turn left”

Armchair © Didouner / CC BY-SA

Generally speaking, this is the basic process for making a navigation-ready map powered by OpenStreetMap. The armchair-to-cupholder pipeline, if you will. A mapper sits in an armchair, entering data into OSM. Then a router, such as OSRM, abstracts away all the details, turning it into a mathematical graph, and runs an algorithm over that graph to find the optimal route. Yes, it’s mindblowing. But let’s not forget the last part, where an app on a phone sitting in a cupholder presents that route with timely instructions. All the other components exist just so this UI can effectively guide the user. Don’t tag for the renderer

The good news is that you don’t have to worry that much about the UI. You just have to know it’s there. But you do have to worry about the router. We have this cardinal rule in OSM: don’t tag for the renderer. Don’t tag for the renderer (Tag for the renderer and the router!)

Tag for the renderer and the router! OK, that’s a bad pun. But the point is, just as it’s bad form to tailor your mapping to one renderer in particular, at the expense of all the others, it’s also bad form to tailor your mapping to one use case – visual maps – at the expense of other use cases, such as navigation. Data © OSM / ODbL

Here’s an example of crude mapping in a region that until recently had useless satellite imagery. On a map, yes, it looks a bit ugly, but things get really bad when you use turn-by-turn navigation software on this road: as you follow the actual physical road, you’ll hear “Recalculating, recalculating, recalculating” from the app, because you’re straying so far away from where the app thinks you are. Data © OSM / ODbL

Here’s a case where a road is disconnected. You know that feeling when you look at something wrong and go, who’s that idiot, and it turns out to be you? I must’ve been nodding off at my keyboard when I mapped this. Anyways, it doesn’t look like much of a problem on the map itself – just a few missing yellow pixels. But it means a detour when getting a route going southbound. Actually, it’s probably worse than this, because routers try to avoid U-turns as much as possible. Oh, it gets even worse when you go northbound. There’s probably a miles-long detour because you’d simply dead-end at this gap. Little problems in visual maps can result in big problems during navigation. Thinking like a router

To consistently produce good router-friendly maps, it isn’t enough to know what tags to use. You need to have a good intuition about how a router thinks, which is different than how a human thinks about routing. This is the stuff of doctorate degrees, and I don’t profess to be an authority on the subject, but here are the basics. Consider this hypothetical road network, with the user’s current location marked by the car and the destination marked by the house. There are some residential roads in white and a main road in red. Each router uses a different algorithm, but they all have some things in common. A router thinks about the world as a mathematical graph, and its job is to be greedy. It’ll start at the road nearest to the origin and go to the road nearest to the destination. Somehow or another, it’ll will determine that this is the shortest route, perhaps by comparing the distances each step along the way. If I want the fastest route, the router will find the fastest route based on highway tags, speed limits, current traffic, etc. You can think of it as the router taking all the possible routes and ranking them by how long they would take. Each segment of each route is assigned a weight, like a time or a distance, and these segments are summed up. 10s

30s

5min

30s 5min 30s 10s

What if we throw a bunch of obstructions in the way, like traffic lights and railroad crossings and pedestrian crossings? The router applies a penalty to each of those obstructions because they each take a certain amount of time. There can also be a penalty for left turns in a country that drives on the right. These penalties can cause the router to choose a different route. 10s

30s

5min

30s 5min 30s 10s

Now let’s do something really dastardly: the road nearest to the origin is this roundabout. Maybe the mapper forgot to connect it to the road network. What do you think will happen? 10s

30s

5min

30s 5min 30s 10s

The router ignores that roundabout and produces a normal result. The router doesn’t get stuck and go in an infinite loop, because the roundabout isn’t even part of the routing graph. Besides, it would take infinite time and leave you very far from the destination. This is one example where the router is more robust than you might intuit. Data © OSM / ODbL

Despite the very sharp angle in OSM, the guidance instruction will say “Turn right”, not “Make a sharp right”. Restrictions

Sometimes the router has to avoid a road not because of slow-downs like the crosswalks and traffic lights we saw in the previous slide, but because of legal restrictions. So far we’ve talked about things you can see in the map in some form. But some navigation tags are invisible. At this intersection, there are “no right turn” and “no U- turn” signs, so you add turn restriction relations. Data © OSM / ODbL

Often you don’t need to input a turn restriction relation, because the cross street is a one-way and a router will never send you the wrong way down a one-way street. One-ways are very important, and they’re everywhere, from city streets to dual carriageways to parking lot aisles. Another kind of restriction is a mode-of-transportation restriction, using the access tag. Mappers have come up with a lot of access tags, because people have found all kinds of ways to get around. There are even two places in OSM that explicitly allow unicycles. © / CC BY-SA

Sometimes these restrictions aren’t clear cut. Restrictions can blink on and off throughout the day, or they could apply to certain vehicles based on their type, weight, height, length, number of passengers, or other characteristics. For these conditions, there’s a conditional restriction tag. Demo

Here’s a demo of adding routing restrictions in iD. https://www.openstreetmap.org/edit#map=20/39.32313/-84.50474 Highway exits and destination signs

Everything we’ve talked about so far significantly affects the route: do you turn left or right? Do you take a shortcut or a longcut? But if the route is correct, the user can still get hopelessly lost if the instructions are missing or wrong. Highway entrance and exits in many countries have large signs indicating the destinations. Because the driver is traveling very fast, it’s important that we don’t force them to guess about which exit to take. This is where destination tags come into the picture. © Clipdude / CC BY-SA

© Scott Nazelrod / CC BY-SA © Michael Rivera / CC BY-SA

This is what entrance and exit destinations look like in the United States and Canada. The appearance and layout varies widely from country to country, so we’ll go around answering questions as you encounter highway exits and entrances in your home country.

During presentation: Dwell a little longer on this slide and point out the different tags that the router/guidance will read from these signs and use for banners/text instructions. Demo

Here’s a demo of adding destination signs in iD. Turns and lanes Turns

• For the router - Turn Restrictions • For human friendly experience - Turn Lanes Turn Restrictions

Extremely important for navigation.

Coverage in OSM is scant.

They don’t add much in terms of visual maps so they’ve been overlooked.

YOU can help! Turn Lanes

Important because the help the driver prepare for a large intersection by getting into the correct lane © roadtechie / CC BY-SA

Turn lanes Demo

Here’s a demo of mapping turn lanes in JOSM. Lanes in the future

• change:lanes

• transit:lanes and transit relations

• Per-lane entrance and exit destinations

Change:lanes - solid vs dotted Transit:lanes - how lanes connet to each other Per-lane - destination signs Minh demonstrated but one destination per lane Intersections Intersection Mapping

1. Make sure all the possible paths through the intersection are mapped, but no more. Intersection Mapping 2. Avoid contorting through roads.

Intersection Mapping

3. Make sure to tag turn lanes throughout the intersection. Look here for more details

https://www.mapbox.com/mapping/mapping-for-navigation/ modeling-intersections-for-map-navigation/ Complex Intersections

Complex intersections are designed to allow large volumes of traffic move through limited space safely and efficiently. Examples: • Single-point urban interchange (SPUIs) • Continuous Flow Intersection (CFI) • Diverging Diamond Interchange (DDI) • Superstreet • Turbo Roundabout SPUIs Starting points

• Make your hometown navigable! • Add turn lanes and exit destinations from satellite and street- level imagery – search for: Cleveland, Ohio, USA; Istanbul, Turkey; Mansfield, Ohio, USA; Milan, Italy; Stockholm, Sweden; Torino, Italy; Upsalla, Sweden; your hometown! • https://www.mapbox.com/mapping/mapping-for-navigation/