Skip to content

[WIP] Allow foot and bike routing over bridleways in GB - #1408

Closed
boldtrn wants to merge 4 commits into
graphhopper:masterfrom
boldtrn:issue_469
Closed

boldtrn wants to merge 4 commits into
graphhopper:masterfrom
boldtrn:issue_469

Conversation

@boldtrn

@boldtrn boldtrn commented Jun 21, 2018 •

Copy link
Copy Markdown
Member

Fixes #469 and #504.

I added WIP since the bike routing is not yet implemented, should be quite easy though.

For now I only decided to allow routing over bridleway in GB and not in other countries, most countries like Germany are rather restrictive about bridleways, so we should probably see how this feature evolves and maybe add another country at a later point if needed.

Here is one example in GB.
This PR:
1408_local
GH Maps:
1408_gh

@Override
public AccessValue getAccessValue(String highwayTag, TransportationMode transportationMode, AccessValue _default) {
return AccessValue.ACCESSIBLE;
return _default;

@boldtrn boldtrn Jun 21, 2018 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a breaking change, but the behavior before didn't make sense if you want to block something by default and only allow it for certain areas. If there was no rule for the area, it always returned accessible and not the _default.

Will add this to the changelog.

}

@Override
public AccessValue getAccessValue(String highwayTag, TransportationMode transportationMode, AccessValue _default) {

Copy link
Copy Markdown
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 method is a bit limited, we should think about passing the ReaderWay, this would allow us to make more complex decision also using other available tags, for example: designation=public_bridleway, which is a relevant tag for bridleways in the UK, but not for other countries, see here.

@boldtrn

boldtrn commented Jun 21, 2018 •

Copy link
Copy Markdown
Member Author

I just found an issue with this approach. So far I only tested it in GB which worked. But I just tried it in Germany and it didn't work in Germany.

It turns out the issue is that we only set estimated_center after we call encodingManager.acceptWay(way); is OSMReader. Therefore I added a change in OSMReader to set the start coordinates for the way in advance. I have to admit, that I am not really happy with this change. Hopefully we can find a better way to handle this.

We could also calculate the estimated center, before accepting the way. Calculating the estimated center is not that expensive. Calculating the distance is a bit more expensive so we can move this after we accept the way?

@karussell

Copy link
Copy Markdown
Member

I think we need rewrite this to the new concepts in mind (RoadClass.BRIDLEWAY). Or should we close here?

Also it might be that the issue with the center or way_start_point is no longer a problem as the SpatialRuleParser should handle that (I hope).

@boldtrn

boldtrn commented Jan 29, 2020

Copy link
Copy Markdown
Member Author

Maybe a full rewrite would be better than reusing this PR. I think that the bridleway situation is something we should improve.

Also it might be that the issue with the center or way_start_point is no longer a problem as the SpatialRuleParser should handle that (I hope).

The SpatialRuleParser should happen after the acceptWay? We should know where a bridleway is in order to decide if we can accept it. Alternatively, we could accept all bridleways at first and in handleWayTags we set it as not accessible if it's in certain countries?

@karussell

Copy link
Copy Markdown
Member

Alternatively, we could accept all bridleways at first and in handleWayTags we set it as not accessible if it's in certain countries?

Yeah, probably in general I think we should remove the acceptWay method. I'm not sure it is really faster with it.

@karussell

Copy link
Copy Markdown
Member

Maybe a full rewrite would be better than reusing this PR

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

England/Wales public bridleway implies foot=yes

2 participants