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

vector tile: add no-thru traffic restrictions layer #6146

Merged
merged 6 commits into from
Nov 12, 2024

Conversation

flaktack
Copy link
Contributor

@flaktack flaktack commented Oct 11, 2024

Summary

The new vector tile layers did not include no-thru traffic details. This adds layers reusing the existing colors from the permission layer.

The edge layers are grouped by street mode. This allows coloring all edges usable by the selected modes.

image

Issue

Fixes #6145

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 15 lines in your changes missing coverage. Please review.

Project coverage is 69.76%. Comparing base (2ead4da) to head (0b6fcac).
Report is 71 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...nner/inspector/vector/edge/EdgePropertyMapper.java 8.33% 11 Missing ⚠️
...ipplanner/apis/vectortiles/model/StyleBuilder.java 77.77% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #6146   +/-   ##
==========================================
  Coverage      69.75%   69.76%           
- Complexity     17657    17663    +6     
==========================================
  Files           2007     2007           
  Lines          75573    75641   +68     
  Branches        7734     7738    +4     
==========================================
+ Hits           52716    52768   +52     
- Misses         20144    20158   +14     
- Partials        2713     2715    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@t2gran t2gran added this to the 2.7 (next release) milestone Oct 16, 2024
@flaktack flaktack force-pushed the feature/layer-groups branch 2 times, most recently from 1bb4fc1 to b10b81d Compare October 17, 2024 13:22
+ group no-thru traffic and permission layers by mode
@flaktack flaktack force-pushed the feature/layer-groups branch from b10b81d to 336fb13 Compare October 17, 2024 13:31
@flaktack flaktack marked this pull request as ready for review October 17, 2024 13:32
@flaktack flaktack requested a review from a team as a code owner October 17, 2024 13:32
@flaktack flaktack added the OTP Debug UI The OTP bundled client label Oct 17, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

It's nice to get rid of the checkboxes for all permission combinations.

I haven't looked at the vectortiles before but I think this looks good in general. I tested it out and added my thoughts.

@@ -181,9 +197,8 @@ private static List<StyleBuilder> edges(VectorSourceLayer edges) {
.group(EDGES_GROUP)
.typeLine()
.vectorSourceLayer(edges)
.lineColor(MAGENTA)
.edgeFilter(EDGES_TO_DISPLAY)

Choose a reason for hiding this comment

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

Can you explain why we remove this filter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The style changes have been reverted.

Since only the edge layer was interactive, my thought was to have an indicative background layer on which any edge could be selected.

That has been replaced with an update to MapControl/LayerControl so that the list of dynamic layers is updated based on the selected layers.

.toList();
}

private static String permissionColors(StreetTraversalPermission p) {

Choose a reason for hiding this comment

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

Suggested change
private static String permissionColors(StreetTraversalPermission p) {
private static String permissionColor(StreetTraversalPermission p) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, updated ✔️

.lineColor(MAGENTA)
.edgeFilter(EDGES_TO_DISPLAY)
.lineWidth(LINE_WIDTH)
.lineColor(GRAY)

Choose a reason for hiding this comment

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

This is hard to see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original styling has been restored.

Comment on lines 220 to 221
.lineColor(GRAY)
.lineOpacity(0.2f)

Choose a reason for hiding this comment

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

This is very hard to see

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original styling has been restored.

public static String streetPermissionAsString(StreetTraversalPermission permission) {
return (
permission == StreetTraversalPermission.ALL
? "PEDESTRIAN_AND_BICYCLE_AND_CAR"

Choose a reason for hiding this comment

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

This does add a bit of noise to the map since the labels that used to say ALL now says PEDESTRIAN BICYCLE CAR. Maybe that's ok since it's more explicit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The layer style has been updated to handle ALL instead.

@flaktack flaktack force-pushed the feature/layer-groups branch from 26f78f5 to 171092c Compare November 7, 2024 21:28
@flaktack flaktack force-pushed the feature/layer-groups branch from 171092c to 8e786c0 Compare November 7, 2024 21:55
@@ -78,7 +79,7 @@ export function MapView({
}}
// it's unfortunate that you have to list these layers here.
// maybe there is a way around it: https://github.com/visgl/react-map-gl/discussions/2343
interactiveLayerIds={['regular-stop', 'area-stop', 'group-stop', 'parking-vertex', 'vertex', 'edge', 'link']}
interactiveLayerIds={interactiveLayerIds}
Copy link
Member

Choose a reason for hiding this comment

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

Fantastic! I was waiting for someone to come up with a solution for this.

Copy link
Member

Choose a reason for hiding this comment

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

You could remove the coment above it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has been removed 🙇

... since the list of interactive layer ids is updated when
a layer's visibility is changed
@flaktack flaktack merged commit 3d5d504 into opentripplanner:dev-2.x Nov 12, 2024
6 checks passed
@flaktack flaktack deleted the feature/layer-groups branch November 22, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OTP Debug UI The OTP bundled client Skip Changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add no-thru traffic details to the vector tiles
4 participants