opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.19k stars 1.03k forks source link

Walk routing on trunk roads in UK #1996

Closed marcusyoung closed 2 years ago

marcusyoung commented 9 years ago

The attached screenshot shows a start and end point on the A483 in Tycroes, Wales. The A483 is a trunk road but here is going through a residential area and the speed limit is 30 mph and the road has pavements. But it seems that OTP thinks this road isn't suitable for a walk route, despite it having bus stops on it. I looked at this road in OSM and it had the following access tags (I have since updated OSM and foot and bicycle are now yes):

Access

General : yes Foot: unknown Motor Vehicles: yes Bicycles: unknown Horses: unknown

The problem appears to be that OTP assumes that trunk roads are for driving only, from the following in DefaultWayPropertySetSource.java:

    /* DRIVING ONLY */
    setProperties(props, "highway=trunk", StreetTraversalPermission.CAR, 7.47, 7.47);
    setProperties(props, "highway=motorway", StreetTraversalPermission.CAR, 8, 8);

Which I guess would be overridden if there is an access tag foot=yes . Trouble is, in the UK trunk roads do often pass through towns and cities, so the assumption of car only is incorrect. And anyway, there is no general legal restriction to walking or cycling on a trunk road in the UK.

Ideally, this setting (and other routing rules such as average speeds of road types) would be configurable in build-config.json. That way it would be possible to tweak OTP routing rules to meet local requirements.

walk-route Marcus

buma commented 9 years ago

It is configurable. You can change defaultWayPropertySetSource. It is also advisable to change default speed limits.

Previously you could configure permissions in XML. But now only configuration in Java is possible. But yes it would be easier to be able to configure this with JSON.

And yes pedestrian permissions are added if foot=yes exists.

marcusyoung commented 9 years ago

Hi Marko

Thanks. I realise that I can edit the relevant Java file but that then requires a build from master. This is very cumbersome if you are trying to tweak routing to local circumstances, with a rebuild after every change. So configuration via JSON would be great in the future.

Marcus

From: Marko Burjek Sent: Friday, 19 June 2015 08:52 To: opentripplanner/OpenTripPlanner Reply To: opentripplanner/OpenTripPlanner Cc: Young M.A. Subject: {Disarmed} Re: [OpenTripPlanner] Walk routing on trunk roads in UK (#1996)

It is configurable. You can change defaultWayPropertySetSource. It is also advisable to change default speed limits.

Previously you could configure permissions in XML. But now only configuration in Java is possible. But yes it would be easier to be able to configure this with JSON.

And yes pedestrian permissions are added if foot=yes exists.

— Reply to this email directly or view it on GitHubhttps://github.com/opentripplanner/OpenTripPlanner/issues/1996#issuecomment-113416937.

abyrd commented 9 years ago

Hello,

Being able to specify all the rules in JSON would be nice, but it’s a fairly complicated change. A simpler solution is to make alternative subclasses that have additional rules (e.g. a UKWayPropertySetSource, though we might want to come up with a more pleasant name for these like UkWayTagInterpreter). Then we would just have a line in the JSON config to choose a PropertySetSource. The upside of this method is that the properties for each region would be checked into the OTP repository and available out of the box to other OTP users.

Working on the UKWayPropertySetSource as a Java file would not be as cumbersome as it might seem. If you work inside an IDE with a small OSM extract for a particular town, recompiling and restarting OTP to try out the configuration after each tweak is an automatic process and really not noticeably slower than changing JSON and restarting OTP on the command line without recompiling. Working on OTP this way in an IDE is much simpler than it used to be.

-Andrew

On 19 Jun 2015, at 10:07, Marcus Young notifications@github.com wrote:

Hi Marko

Thanks. I realise that I can edit the relevant Java file but that then requires a build from master. This is very cumbersome if you are trying to tweak routing to local circumstances, with a rebuild after every change. So configuration via JSON would be great in the future.

Marcus

From: Marko Burjek Sent: Friday, 19 June 2015 08:52 To: opentripplanner/OpenTripPlanner Reply To: opentripplanner/OpenTripPlanner Cc: Young M.A. Subject: {Disarmed} Re: [OpenTripPlanner] Walk routing on trunk roads in UK (#1996)

It is configurable. You can change defaultWayPropertySetSource. It is also advisable to change default speed limits.

Previously you could configure permissions in XML. But now only configuration in Java is possible. But yes it would be easier to be able to configure this with JSON.

And yes pedestrian permissions are added if foot=yes exists.

— Reply to this email directly or view it on GitHubhttps://github.com/opentripplanner/OpenTripPlanner/issues/1996#issuecomment-113416937.

— Reply to this email directly or view it on GitHub https://github.com/opentripplanner/OpenTripPlanner/issues/1996#issuecomment-113424729.

marcusyoung commented 9 years ago

Hi,

The alternative subclass sounds like a good approach.

I haven’t as yet tried working on OTP within an IDE, I will have to try and get that set up. Could you send me a license key for IntelliJ IDEA?

Regarding the configuration in defaultWayPropertySetSource, what is the significance of the numbers, for example the two 7.47 values below:

setProperties(props, "highway=trunk", StreetTraversalPermission.CAR, 7.47, 7.47);

Thanks

Marcus

From: Andrew Byrd [mailto:notifications@github.com] Sent: 19 June 2015 11:20 To: opentripplanner/OpenTripPlanner Cc: Young M.A. Subject: {Disarmed} Re: [OpenTripPlanner] Walk routing on trunk roads in UK (#1996)

Hello,

Being able to specify all the rules in JSON would be nice, but it’s a fairly complicated change. A simpler solution is to make alternative subclasses that have additional rules (e.g. a UKWayPropertySetSource, though we might want to come up with a more pleasant name for these like UkWayTagInterpreter). Then we would just have a line in the JSON config to choose a PropertySetSource. The upside of this method is that the properties for each region would be checked into the OTP repository and available out of the box to other OTP users.

Working on the UKWayPropertySetSource as a Java file would not be as cumbersome as it might seem. If you work inside an IDE with a small OSM extract for a particular town, recompiling and restarting OTP to try out the configuration after each tweak is an automatic process and really not noticeably slower than changing JSON and restarting OTP on the command line without recompiling. Working on OTP this way in an IDE is much simpler than it used to be.

-Andrew

On 19 Jun 2015, at 10:07, Marcus Young notifications@github.com<mailto:notifications@github.com> wrote:

Hi Marko

Thanks. I realise that I can edit the relevant Java file but that then requires a build from master. This is very cumbersome if you are trying to tweak routing to local circumstances, with a rebuild after every change. So configuration via JSON would be great in the future.

Marcus

From: Marko Burjek Sent: Friday, 19 June 2015 08:52 To: opentripplanner/OpenTripPlanner Reply To: opentripplanner/OpenTripPlanner Cc: Young M.A. Subject: {Disarmed} Re: [OpenTripPlanner] Walk routing on trunk roads in UK (#1996)

It is configurable. You can change defaultWayPropertySetSource. It is also advisable to change default speed limits.

Previously you could configure permissions in XML. But now only configuration in Java is possible. But yes it would be easier to be able to configure this with JSON.

And yes pedestrian permissions are added if foot=yes exists.

— Reply to this email directly or view it on GitHubhttps://github.com/opentripplanner/OpenTripPlanner/issues/1996#issuecomment-113416937.

— Reply to this email directly or view it on GitHub https://github.com/opentripplanner/OpenTripPlanner/issues/1996#issuecomment-113424729.

— Reply to this email directly or view it on GitHubhttps://github.com/opentripplanner/OpenTripPlanner/issues/1996#issuecomment-113461215.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days

leonardehrenfried commented 2 years ago

This is coming to OTP2 in #4328.