Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow some kinds of non-numeric shield_text #1452

Merged
merged 4 commits into from
Dec 7, 2017

Conversation

zerebubuth
Copy link
Member

This normalises the formatting of road refs which consist of a single letter, optional space and then a number. These are often displayed with the letter as part of the signage.

Connects to #1062.

Matt Amos added 4 commits December 6, 2017 17:25
This normalises the formatting of road `ref`s which consist of a single letter, optional space and then a number. These are often displayed with the letter as part of the signage.

Also back-fill network values where they can be inferred from the operator.
@zerebubuth zerebubuth requested review from iandees and nvkelso December 6, 2017 17:46
# that extra refs are available for road networks.
if network is None:
operator = props.get('operator')
backfill_network = _NETWORK_OPERATORS.get(operator)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may need to get slightly more sophisticated so account for multiple road shield types per country also based on the A, N, M, & etc shield text prefixes &/or the road class?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to get a lot more sophisticated!

The addition of the operator-based fall-back was only because the M1 section that #1062 mentioned had a ref but no network on the way, and was only part of the E13 relation (which has both ref and network). The current logic is built around tuples of (route_type, network, ref), so the simplest approach was to guess a network based on the information available on the way.

This is a kludge, but it's an improvement over what went before.

Once we have #135, then we should change the logic so that we're additionally able to match on the country and road class. For example, a road in the UK with highway=motorway would be generally expected to have a ref starting with M (apart from the ones which don't, which have been left scattered around like rakes in long grass by the trickster spirits to frustrate us), and could be assigned a network more accurately, where one wasn't otherwise specified.

@nvkelso
Copy link
Member

nvkelso commented Dec 6, 2017

Besides my comment in https://github.com/tilezen/vector-datasource/pull/1452/files#r155352236, I think this is good to go. But I think that's already covered in #1389.

So LGTM.

@zerebubuth zerebubuth merged commit 1c6c0c6 into master Dec 7, 2017
@zerebubuth zerebubuth deleted the zerebubuth/1062-road-shield-cleanup branch December 7, 2017 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants