Skip to content

Reduce surface tag precision#1723

Merged
zerebubuth merged 5 commits intomasterfrom
zerebubuth/1716-reduce-surface-tag-precision
Dec 11, 2018
Merged

Reduce surface tag precision#1723
zerebubuth merged 5 commits intomasterfrom
zerebubuth/1716-reduce-surface-tag-precision

Conversation

@zerebubuth
Copy link
Copy Markdown
Member

Reduce the number of different values for the surface tag on roads layer features below the zooms we typically stop naming the feature. This should allow for some information about surface finish, particularly important for walking and cycling maps, without leading to a combinatoric explosion of all the different properties. This should help effective merging at zoom levels where we don't really care about individual features (because they're just "background texture" or because they are too small to be individually noticeable).

Connects to #1716.

@zerebubuth zerebubuth requested a review from nvkelso December 10, 2018 16:44
@nvkelso
Copy link
Copy Markdown
Member

nvkelso commented Dec 10, 2018

Addresses everything but:

For just minor_roads we'd also backfill missing surface tags as paved to promote more merging (rather than leaving it null). But for other road kinds we'd leave null as null.

Because this also will affect tile size, let's compare a few tiles before/after (even reusing the same tiles from the earlier PR?).

@zerebubuth
Copy link
Copy Markdown
Member Author

zerebubuth commented Dec 11, 2018

For just minor_roads we'd also backfill missing surface tags as paved

Yup, I had second thoughts about this, so didn't initially implement it. I've added it (although disabled) in 1f1b9a3.

I ran a small sample of tiles in a zoom sequence roughly over Brooklyn:

Z X Y Nominal Zoom master PR 1723 PR 1723 + backfill Reduction (master → PR 1723) Reduction (+backfill)
8 75 96 9 165512 164972 164972 0.33% 0.00%
9 150 192 10 222914 222452 222452 0.21% 0.00%
10 301 385 11 137376 138059 138059 -0.50% 0.00%
11 603 770 12 112679 114868 114868 -1.94% 0.00%
12 1206 1540 13 73156 74589 73656 -1.96% 1.25%
13 2412 3080 14 70081 70945 71385 -1.23% -0.62%
14 4825 6161 15 23749 23749 23749 0.00% 0.00%
15 9650 12323 16 17252 17252 17252 0.00% 0.00%
16 19300 24646 16 5848 5848 5848 0.00% 0.00%

Note that the sizes here are for roads layer only (although roads are often the largest single layer at mid zooms).

Keeping the simplified surface property has a slightly positive effect at zooms 8 & 9 because we're applying the simplification to all road kinds, whereas before we were only dropping surface on minor_road. Zooms 12 through 14 see a small (<2%) increase in layer size due to the reduced opportunities for merging. Zoom 15 and up is unchanged, as we still keep the full range of values.

Backfilling the default surface: paved at zoom 12 has the expected effect: it recovers some of the lost ground by providing better merging opportunities. At zoom 13, however, it makes the layer slightly bigger because it takes a byte each for the index of the key and value that we're adding to those features' properties.

For the basic PR without backfilling, the property indices take up 11,927 bytes across 561 minor_road features. With backfilling we're able to merge down to 548 features - but the property indices are now 12,629 bytes. The average bytes per feature increased by almost 2, as we'd expect, but this pushes the overall size unexpectedly higher.

It looks like the benefits of backfilling might be minor at best. We'd get better results if we dropped surface: paved and made that an explicit default. However, dropping properties that exist feels much more invasive than backfilling defaults, and I'm not sure we want to do it. Perhaps in v2 we can switch to having an explicit default of paved.

@nvkelso
Copy link
Copy Markdown
Member

nvkelso commented Dec 11, 2018

I've filed #1724 for the v2 breaking change.

Agree we should not implement the surface backfilling right now in this PR. Take it out entirely versus commenting it out and then we're good to merge?

Copy link
Copy Markdown
Member

@nvkelso nvkelso left a comment

Choose a reason for hiding this comment

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

LGTM

@zerebubuth
Copy link
Copy Markdown
Member Author

Take it out entirely versus commenting it out and then we're good to merge?

Sounds good. Removed in c842849.

@zerebubuth zerebubuth merged commit 453e81b into master Dec 11, 2018
@zerebubuth zerebubuth deleted the zerebubuth/1716-reduce-surface-tag-precision branch December 11, 2018 20:23
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.

2 participants