PTNA: news for Public Transport Network Analysis

I see. There is probably a way to programmatically detect the duplicates in Python, we could add it as a separate property for feeds that need it. Let me know if you want to pursue that route.

Then the filter would be:

@type=bus
@ref~^6\d\d$
@duplicate!=yes
@@

Or something like that, depending on how we implement it.

Edit: actually, it might even be possible to output both route_id values in a single CSV line, similar to what’s currently being done for IL-MOT. Will need a bit of code rethinking on my end, but should be doable.

Edit: already got a solid plan for how to do it :smiley: but really not sure when I’ll have the time to do it.

I also spent some thoughts on that. I’ll come back this afternoon.
Just in brief: PTNA has an analysis option which controls how to handle double, tripple, … appearances in the CSV : --multiple-ref-type-entries=

  • “analyze” this is standard and analyzes operator, from and to to distinguish
  • “allow” simply take as is from csv an do not try to distinguish (handy if you want to list the same bus multiple times)
  • “ignore” as it says: ignore any further entry for the same ref,type combination

I was thinking of a similar @duplicates= command

  • ignore - which one shall be ignored?
  • list (default)
  • join = creates a single entry with multiple route_id values

Both will be transparent to the mappers, are individual settings, under the control by me and mappers, and in combination could privide enough flexibility without manipulating the GTFS data.

This could be done, but IMO it would be more appropriate to do it during the SQL → JSON conversion as I suggested, not during JSON → CSV injection.

This is getting technical and probably confusing for everyone else here so let’s discuss privately.

1 Like

Okay, after taking it through we think for the time being CSV editors should manually filter out unwanted duplicate lines using filters, for example:

@bus
@ref~(some regex)
# dupe of: 2-a-j24-2
@route_id!=2-a-j24-3
# dupe of: XXX
@route_id!=YYY
@@

If this becomes unmanageable - like if there’s too many duplicate routes or they change too often - then the issue should be brought up here and we’ll figure out a more automated solution.

1 Like

I just added analysis support for public-transport to ptna for

based on a PM by the office:

District Administrator of the District of Schaumburg,
Office for Economic Development, Regional Planning and Mobility,
Public Transport Planning

asking for support on: “Synchronization of data from OSM and public sources”.
Feel free to contact me for more details.

I added @route_id!=1924_3, but now this one only changed to “2.7.5. Rest” and the route 654 still appears under “Not clearly assigned routes” :thinking:

Oh yeah, I forgot to mention that anything which has been de-selected before will pop-up in the “Rest” section. Maybe, after the test phase, we can delete the “Rest” section completely.

1 Like

I believe you can already delete it - the comment after </pre> will show them anyway in the wiki source code and in the template test page, but not in PTNA or in the rendered wiki page.

Edit: perhaps you could clarify it with a comment in German. Also, for fun, you can replace “all” in the filter @!~$all with something in German that conveys the same meaning :slight_smile: as long as it’s an impossible regex, it’ll list all routes. (The simpler @!= is good too but technically, hypothetically, might not list a route if it has a property with blank key and blank value - which will never happen, but I’m always more comfortable when something can’t fail instead of just that it won’t fail)

1 Like

You probably saw my previous comment before I edited it, so here’s me calling your attention to that.

1 Like

I disabled some twin routes, but this is unfortunately not the solution. I found some routes with different variants in both route_id’s.
for example: 640, 657, 802, 948, 951

1 Like

That’s what I was afraid of!

For the time being, you could disable them completely and add them manually after the final @@ statement for Havelbus. But that’s only a dirty workaround. The entry should include both route_ids in the CSV field for “route_id” as “xxx;yyy”.

We’ll have to think about a @%duplicates= solution again.

2 Likes

Are those route variants actually important? Would you actually want to map them in OSM?

I have to take a closer look in the next few days.

1 Like

One reason for twin routes seems to be more than one operator. Therefor we need all route id’s. E.g. Havelbus route 657, routeID 252090993 is only served by “Bürgerbus”, another one by both. You can find these “Bürgerbus” routes under ‘10296_3’. I added all gtfs data in osm. PTNA seems to have a problem with trips with 2 ref_trips/gtfs:trip_id:sample on gtfs/compare-routes.php. Maybe you can fix this or have ideas for another solution.

Now I can only think of a bus made out of hamburger… I don’t think I’m in a state to look into this right now :stuck_out_tongue:

4 Likes

Well okay, despite my better judgement I ended up looking into it anyway. This is the trip_id you mentioned: PTNA - GTFS Analysen

And here is the other trip_id for the same route_id: PTNA - GTFS Analysen

The route_id: PTNA - GTFS Analysen

I only see operator=Havelbus Verkehrsgesellschaft mbH on both of them… where are you looking?

Thanks, I’ll check that.

It is by intention to have and support only one trip_id per OSM route. I does not make sense to me to list two trip_ids here which are, except the id, identical regarding the stops and ways used.
It should also be irrelevant whether the bus a 10:00 is operated by “A” and the bus at 10:30 is operated by “B”.

PTNA - DE-BE-VBB => bus 657 route_master + route 1631520
route 1631521 is served only by :hamburger:Bus, so it’s contain only in 10296_3

The route_id’s = xxx_3 could be routes with smaller busses.
2. example bus 640, route_id = 20931_3. uses a small bus with capacity=8, like 10296_3.

That could explain why trips of 20931_3 have block_id = wheelchair_accessible = 0 and trips of 20931_700 have block_id = wheelchair_accessible = 1.

But if I’m right: these trip_id related settings do not justify two route_ids.