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

Which-road-am-I-on is picking up footways when in driving mode #2227

Open
danpat opened this issue Oct 17, 2019 · 6 comments
Open

Which-road-am-I-on is picking up footways when in driving mode #2227

danpat opened this issue Oct 17, 2019 · 6 comments
Labels
archived Archived issue.

Comments

@danpat
Copy link

danpat commented Oct 17, 2019

Android API: Unknown
Mapbox Navigation SDK version: Unknown

Steps to trigger behavior

When navigating, the "current road" label can sometimes show the name of a nearby footway.

image (6)

In this example, "100 Steps" is referring to this path: https://www.openstreetmap.org/way/166468142 which is adjacent to the road.

Expected behavior

When navigating using a Driving profile, foot-accessible paths should not be considered for detecting the current road name.

Actual behavior

Looks like we're simply picking the name of the nearest map feature to the current position - if there's position error, the displayed name can be incorrect.

@1ec5
Copy link
Contributor

1ec5 commented Oct 17, 2019

The current road name label relies on querying the map for the road feature under the user location. Since the style can be arbitrarily customized, MapLayerInteractor.addStreetsLayer() lays down a line layer bound to the Streets source and ensures that it gets obscured by the original style’s own road layers:

void addStreetsLayer(String sourceId, String sourceLayer) {
LineLayer streetsLayer = new LineLayer(STREETS_LAYER_ID, sourceId)
.withProperties(
lineWidth(DEFAULT_WIDTH),
lineColor(Color.WHITE)
)
.withSourceLayer(sourceLayer);
mapboxMap.getStyle().addLayerAt(streetsLayer, LAST_INDEX);
}

The line layer needs to have a source layer of road (to avoid snagging other named features like rivers). The layer should also have a filter that requires class to be an appropriate value. The set of appropriate values depends on the current route step’s mode:

Route step modeFeature class
driving
  • motorway
  • motorway_link
  • trunk
  • trunk_link
  • primary
  • primary_link
  • secondary
  • secondary_link
  • tertiary
  • tertiary_link
  • street
  • street_limited
  • track
  • service
  • roundabout
walking
cycling

All of the above plus:

  • pedestrian
  • path
ferry
  • ferry
train
  • major_rail
  • minor_rail
  • service_rail

@1ec5
Copy link
Contributor

1ec5 commented Oct 17, 2019

We should also investigate whether the SDK is querying for features based on the raw location or the snapped location. In principle, this issue would be much less likely to reproduce if the query point is a snapped location. The filtering above would still help with situations like an elevated rail line running on a viaduct above a roadway.

@1ec5
Copy link
Contributor

1ec5 commented Oct 17, 2019

In this example, "100 Steps" is referring to this path: https://www.openstreetmap.org/way/166468142 which is adjacent to the road.

It seems to be nearly perpendicular to the road at both endpoints. WaynameFeatureFilter.filterQueriedFeatures() has quite a bit of code to weed out results that go off in a different direction than the route. It looks more involved than the corresponding iOS code that it was ported from. But the fixes suggested above would still be relevant for more pathological cases where pathways run parallel or coincident to roadways.

@stale
Copy link

stale bot commented Jul 13, 2020

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 stale bot added the archived Archived issue. label Jul 13, 2020
@Guardiola31337
Copy link
Contributor

Street names will be available from NN as part of EH work.

cc @mskurydin

@stale stale bot removed the archived Archived issue. label Jul 15, 2020
@stale
Copy link

stale bot commented Nov 9, 2020

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 stale bot added the archived Archived issue. label Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archived Archived issue.
Projects
None yet
Development

No branches or pull requests

3 participants