PTNA: news for Public Transport Network Analysis

I’ll just clarify the technical aspects:

  • You can write import statements in any order you like, and structure the page however you like. All the points below only apply to sorting within each import statement.
  • The default sorting method is basically:
    1. Sort by route_type according to the sort key defined in this file (lower numbers appear first).
      • I expected that in nearly all cases, each import statement would only include routes of the same route_type, making this sort key irrelevant. However, it seems like there are some cases where different route types end up in the same table.
    2. Sort by the non-numeric prefix in ref
      • e.g. for ref="A23", the second sort key would be “A”
    3. Sort by the first number in ref
      • e.g. for ref="A23", the third sort key would be 23
    4. Etc. if more letters and numbers appear in ref
    5. Identical refs - which generally should not occur, but might - will be sorted by operator and then by route_id
  • Currently, “manual sorting” can be done by using separate import statements. For example, if you want a specific line to appear at the top of the list, you can import just that one and then import the rest. An actual example:
    # custom order:
    #@train
    #@ref=FEX
    #@@
    #@train
    #@ref~^R\D\d+$
    #@@
    #@train
    #@ref=TES
    #@@
    # default order:
    @train
    @ref~^(FEX|TES|R\D\d+|I.+)$
    @@
    
    See actual result at the CSV page and the analysis page.
  • It is technically very easy to change the default sort order described above with a very small amount of Python code. The only catch is that Toni has to put it in the right place in the PTNA servers, end users can’t fiddle with this by themselves like they can with the CSV templates. But Toni is awesome and always known for doing things like this really quickly, at least in my experience - so this would not be an issue. (Only the first time I might have to show him how I set up the code to do it)

So from my understanding, this discussion is about how best to organize the page (with headings and subheadings, etc.) and less about how each group is sorted internally. But if it is about how each group is sorted internally, then there are solutions for that - just say the word.