Skip to content

Comments

Snap To Rail#1027

Merged
josh-willis-arcadis merged 27 commits intomtc-deployfrom
snap-to-rail
May 6, 2025
Merged

Snap To Rail#1027
josh-willis-arcadis merged 27 commits intomtc-deployfrom
snap-to-rail

Conversation

@josh-willis-arcadis
Copy link
Contributor

@josh-willis-arcadis josh-willis-arcadis commented Mar 11, 2025

Add support for a snap to rail feature when editing trip patterns. Uses OpenRailRouter, a fork of GraphHopper.

@josh-willis-arcadis josh-willis-arcadis added the BLOCKED Blocked (waiting on another PR to be merged) label Mar 11, 2025
@josh-willis-arcadis josh-willis-arcadis mentioned this pull request Mar 11, 2025
7 tasks
@miles-grant-ibigroup miles-grant-ibigroup self-assigned this Mar 12, 2025
Copy link
Contributor

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

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

I see quite a bit of potential to reduce the number of files touched. I'd start by leaving followStreets untouched. That will also make the edits to valhalla less dangerous. We can leave that file mostly untouched and merely add a short check after the alternates section to switch to rail if followRail is true.

That way we can also configure rail routing within alternates. Just have to add a rail flag on each graphhopper alternate!

graphHopperKey = KEY
} else { // no URL or need default value so use graphhopper test environment
graphHopperUrl = 'https://graphhopper.com/api/1/'
// include key here??? this will throw 401 i believe
Copy link
Contributor

Choose a reason for hiding this comment

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

You deleted the code that makes it required to have a graphhopper key! That's a required param

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 rail routing server doesn't require a key. only the street routing server.

@miles-grant-ibigroup miles-grant-ibigroup removed the BLOCKED Blocked (waiting on another PR to be merged) label Mar 12, 2025
Copy link
Contributor

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

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

I'm noticing that the default OpenRailServer server is missing, but maybe that's ok? A few small nitpicks and cleanups but once those are resolved this is good to go!

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

I think you are missing a change to fetch a polyline with the followRail option (see comment). See also other suggested refactors.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

Much better now, and all modes work. Thanks for the all the work.

componentClass='select'
value={currentSelection}
name='followOption'
onChange={this._onFollowOptionChange}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit - Sort props and put closing > on new line.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

Apologies, one requirement we overlooked. Could you "enable “Snap To Rail” function when editing routes with rail GTFS route_type (0 - Light Rail/Streetcar, 1 - Subway/Metro , 2 - Rail) and not enable it for all other route_type values", please. Thank you!

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

Nice

render () {
// Edit Settings passed in are present
const {editSettings, patternSegment, updateEditSetting} = this.props
const {editSettings, patternSegment, updateEditSetting, activeEntity} = this.props
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit - sort props

@josh-willis-arcadis josh-willis-arcadis merged commit 7ca6dca into mtc-deploy May 6, 2025
2 checks passed
@josh-willis-arcadis josh-willis-arcadis deleted the snap-to-rail branch May 6, 2025 17:24
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.

3 participants