skinkie / reference

Personal repository where I collect working examples to understand inner workings while building PyNeTExConv
GNU Affero General Public License v3.0
1 stars 1 forks source link

Route to ServiceJourneyPattern/ServiceLinks #112

Open skinkie opened 3 weeks ago

skinkie commented 3 weeks ago

We currently have code to go from a ServiceJourneyPattern with TimingLinks and ServiceLinks to a Route, where the actual PointProjection towards a RoutePoint from a ScheduledStopPoint is also created, and the TimingLinks itself are being disolved into a longer RouteLink.

For EPIP we need to be able to do this in the reverse direction as well:

  1. Transform a StopPointInSequence + TimingPointInSequence into a StopPointInSequence with only ServiceLinks.
  2. Given the PointProjection towards RoutePoints we know from what RoutePoint to what RoutePoint, and thus concatinate the found RouteLinks to resolve the shape of a ServiceLink. Some magic is required to skip duplicated points when joining.

Most of the code already exists: https://github.com/skinkie/reference/blob/master/gtfs-netex-test/db-to-db.py#L364

skinkie commented 1 week ago

This is implemented, currently testing it on real datasets.