mapbox / mapbox-navigation-ios

Turn-by-turn navigation logic and UI in Swift on iOS
https://docs.mapbox.com/ios/navigation/
Other
860 stars 310 forks source link

Expand shield coverage beyond the United States #334

Open 1ec5 opened 7 years ago

1ec5 commented 7 years ago

The turn banner and step table show graphical route shields for a number of route networks in the United States. Shields.plist maps ref prefixes to file name patterns on Wikimedia Commons. Commons has a much larger repertoire of shields, but we’ve run up against the limits of parsing the ref tag on ways, and even what we have now is prone to false positives. For example:

Unfortunately, there isn’t a better way to distinguish shields internationally until either Project-OSRM/osrm-backend#482 or Project-OSRM/osrm-backend#333 is implemented. This issue affects routes in the U.S. as well: state trunkline highways in Michigan have the prefix M, which is identical to motorways in several other countries.

For more background on graphical route shields and why they matter in navigation, see gravitystorm/openstreetmap-carto#508 and this OSM diary entry, or watch this talk from State of the Map 2011.

/ref https://github.com/mapbox/mapbox-navigation-ios/issues/286#issuecomment-309649781 /cc @ericrwolfe @danpat @freenerd

1ec5 commented 7 years ago

To illustrate the scale of worldwide shield coverage, MapKit on macOS 10.12 ships with an initial set of 27 packs of shields (/System/Library/PrivateFrameworks/GeoServices.framework/Versions/A/Resources/InitialResources/), each pack containing the shield assets needed for a particular region of the world. 0-0-1-north-america-shields-index-23.shieldindex contains 70 shield designs, while 3-2-2-oceania-shields-index-7.shieldindex contains 17. In all, MapKit supports 3,842 non-transit shield designs, multiplied by screen resolution (1×, 2×, 3×) and image size (XS, S, M, L, XL).

Here’s how I came up with the 3,842 figure:

strings /System/Library/PrivateFrameworks/GeoServices.framework/Versions/A/Resources/InitialResources/*.shieldindex | grep -v TRANSIT | wc -l

As you browse additional regions of the world, MapKit downloads additional shield packs automatically. It’s possible that these lines include all the on-demand assets as well as the ones that come out of the box.

1ec5 commented 7 years ago

For a more realistic (and relevant) figure, I took a look at Wikimedia Commons, which is our current source of shield images. Commons hosts 305 template SVG files, one per design/reflen combination, from which contributors have generated and uploaded 141,592 SVG images that have numerals baked into them, one image per route. There are also 229 shield blanks, one per design/reflen combination, each of which is a vector or raster image that can be composited with numerals. Note that many of these designs are for the county level and below, which are most likely out of scope for this issue. There are also some historical designs represented, which are definitely out of scope.

/cc @kronick

brsbl-zz commented 6 years ago

@1ec5 looks like both of these have been closed -- still blocked upstream?

Unfortunately, there isn’t a better way to distinguish shields internationally until either Project-OSRM/osrm-backend#482 or Project-OSRM/osrm-backend#333 is implemented.

1ec5 commented 6 years ago

Now blocked by:

and the selection or generation of shield artwork.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Stale.

1ec5 commented 4 years ago

Still blocked upstream.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.