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

Drop bicycle network and shield text to match style. #1707

Merged
merged 3 commits into from
Nov 28, 2018

Conversation

zerebubuth
Copy link
Member

Drop RCN from 12 down to 0, LCN from 15 down to 0, and any network on track paths from 12 down to zero. These properties inhibit some degree of merging at mid zooms.

Context.

Connects to #1331. (Note that this is one part of many - submitting a PR for each to avoid it becoming unreadably large.)

Drop RCN from 12 down to 0, LCN from 15 down to 0, and any network on track paths from 12 down to zero. These properties inhibit some degree of merging at mid zooms.

Context: #1331 (comment)
@zerebubuth zerebubuth requested a review from nvkelso November 19, 2018 12:42
@zerebubuth
Copy link
Member Author

Follow-up: On 12/1206/1540, which is basically Brooklyn, the number of minor_road features is 38% lower after the change. This means a lot more merging is going on. The layer as a whole is 8% smaller.

@nvkelso
Copy link
Member

nvkelso commented Nov 19, 2018 via email

@zerebubuth
Copy link
Member Author

For the roads layer features, the counts by kind:

Kind Before After Reduction
ferry 6 6  
highway 59 59  
major_road 570 568 0%
minor_road 313 200 36%
path 322 313 3%
rail 14 14  

Which is what we expected: A big reduction in the number of minor_road kind features and some small reductions in other types. This doesn't have such a huge impact on the bytes per feature:

Kind Type Before After Reduction
ferry geom_cmds 154 154  
ferry metadata 24 24  
ferry properties 178 178  
highway geom_cmds 2649 2649  
highway metadata 240 240  
highway properties 1451 1422 2%
major_road geom_cmds 8170 8168 0%
major_road metadata 2281 2273 0%
major_road properties 14785 13576 8%
minor_road geom_cmds 20101 19919 1%
minor_road metadata 1262 814 35%
minor_road properties 7240 4000 45%
path geom_cmds 5671 5652 0%
path metadata 1291 1255 3%
path properties 6994 6777 3%
rail geom_cmds 1201 1201  
rail metadata 59 59  
rail properties 243 243  
    73994 68604 7%

Note that nothing has really changed for any highway kind features. The changes in the size of the properties is likely to be due to re-arrangement of the string table, leading to small changes to the length of the varints used to encode the key and value indexes.

For the layer as a whole, including the string table:

  Before After Reduction
Features 73994 68604 7%
Metadata 16 16 0%
String Table 12631 12326 2%
TOTAL 86641 80946 7%

(PS: Looks like I got my maths a little wrong before - the reductions are 35% and 7% for the minor roads count and layer size, rather than 38% and 8% - perhaps I summed up the counts and byte sizes together by mistake or something.)

The GeoJSON for the roads layer is here in a gist and it looks like this (coloured by kind, kind_detail and landuse_kind):

image

queries.yaml Outdated
properties:
- bicycle_network
- bicycle_shield_text
- all_bicycle_networks
Copy link
Member

@nvkelso nvkelso Nov 27, 2018

Choose a reason for hiding this comment

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

Dropping all_bicycle_networks and all_bicycle_shield_texts all the time until the max zoom would be best (not limited to just lcn, for any bicycle network).

Copy link
Member Author

Choose a reason for hiding this comment

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

Dropped in 2f7728a, and cleaned up some of the other logic for dropping all_bicycle_*

start_zoom: 0
end_zoom: 13
properties:
- bicycle_network
Copy link
Member

@nvkelso nvkelso Nov 27, 2018

Choose a reason for hiding this comment

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

Reviewing https://github.com/tangrams/walkabout-style/blob/gh-pages/layers/bike-interlay.yaml I see that the network IS referenced like bicycle_network: [icn,ncn,rcn] at lower zooms, but rcn is ignored at super low zooms like filter: { bicycle_network: rcn, $zoom: [8,9,10] }:

https://github.com/tangrams/walkabout-style/blob/gh-pages/layers/bike-interlay.yaml#L1788-L1797

So it would be:

  • okay to drop bicycle_network from 0 to 11 (or is that 10, I get confused) for rcn
  • okay to drop bicycle_shield_text from 0 to 12 (one more zoom than bicycle_network is dropped) for rcn
  • see other comment about always dropping the all* variants until the max zoom) even for rcn

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 I've captured this in 324e67f, but would be good to have a check over the tests to make sure the logic is correct.

start_zoom: 0
end_zoom: 16
properties:
- bicycle_network
Copy link
Member

@nvkelso nvkelso Nov 27, 2018

Choose a reason for hiding this comment

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

It would be more conservative to do:

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 I've captured this in 324e67f, but would be good to have a check over the tests to make sure the logic is correct.

params:
source_layer: roads
start_zoom: 0
end_zoom: 13
Copy link
Member

Choose a reason for hiding this comment

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

end_zoom: 13
properties:
- bicycle_network
- bicycle_shield_text
Copy link
Member

Choose a reason for hiding this comment

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

Should this include the all* variants, too?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is answering a slightly different question, but: Since 2f7728a, we drop the all_bicycle_* stuff at anything except max zoom, so we don't need to drop it anywhere else - it's already gone.

@nvkelso
Copy link
Member

nvkelso commented Nov 27, 2018

Look at the sample GeoJSON file we can probably also drop bicycle until zoom 13:

https://tangrams.github.io/walkabout-style/#13/37.8177/-122.5060

Copy link
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.

Great work! See a few comments and then I think we're good to go...

- all_walking_networks
- all_walking_shield_texts
- all_bus_networks
- all_bus_shield_texts
# drop all_bicycle_* until the max zoom:
# https://github.com/tilezen/vector-datasource/pull/1707#discussion_r236522176
Copy link
Member

@nvkelso nvkelso Nov 27, 2018

Choose a reason for hiding this comment

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

Copy link
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, though not sure if https://github.com/tilezen/vector-datasource/pull/1707/files#r236767971 applies to this PR or the other one since commits are in both PRs...

@nvkelso
Copy link
Member

nvkelso commented Nov 27, 2018

Please also make sure #1707 (comment) is tracked in an issue somewhere.

@zerebubuth
Copy link
Member Author

Tracking the bicycle thing in #1713.

@zerebubuth zerebubuth deleted the zerebubuth/1331-drop-road-properties branch November 28, 2018 11:28
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