Skip to content

chopped/connected Route+Banner parity #423

Closed

Description

@yakra

All chopped Routes should have the same Route+Banner combo as their ConnectedRoute.

https://github.com/TravelMapping/HighwayData/blob/3d8499cb152eb76e44ec43d40e745eafaa42e8b4/hwy_data/_systems/usatxf3_con.csv

Maybe call it
CON_ROUTE_MISMATCH
CON_BANNER_MISMATCH

Activity

  1. added a commit that references this issue on May 28, 2021
    0a447f3
  2. yakra commented on May 28, 2021

    @yakra
    ContributorAuthor
    • ABBREV_AS_CHOP_BANNER
      The route's chopped routes .csv file entry has the Abbrev erroneously entered into the Banner field.
      Info value is the line number in the chopped routes .csv file.

      (none flagged)
      
    • ABBREV_AS_CON_BANNER
      The route's connected routes .csv file entry has the chopped route's Abbrev entered as its Banner.
      Info value is the line number in the connected routes .csv file.

      ausqld.qld011coo;;;;ABBREV_AS_CON_BANNER;15
      ausqld.qld085goo;;;;ABBREV_AS_CON_BANNER;105
      ausqld.td006bau;;;;ABBREV_AS_CON_BANNER;8
      ausqld.td006hig;;;;ABBREV_AS_CON_BANNER;9
      ausqld.td007mct;;;;ABBREV_AS_CON_BANNER;12
      ausqld.td007ora;;;;ABBREV_AS_CON_BANNER;11
      ausqld.td008chi;;;;ABBREV_AS_CON_BANNER;13
      ausqld.td008gch;;;;ABBREV_AS_CON_BANNER;16
      ausqld.td008mtn;;;;ABBREV_AS_CON_BANNER;15
      ausqld.td012spr;;;;ABBREV_AS_CON_BANNER;20
      aut.b226ast;;;;ABBREV_AS_CON_BANNER;264
      bih.m017dob;;;;ABBREV_AS_CON_BANNER;25
      fracor.d071bel;;;;ABBREV_AS_CON_BANNER;90
      ga.ga246rab;;;;ABBREV_AS_CON_BANNER;393
      ga.ga246sky;;;;ABBREV_AS_CON_BANNER;394
      indwb.ah001x;;;;ABBREV_AS_CON_BANNER;5
      indwb.ah002x;;;;ABBREV_AS_CON_BANNER;7
      indwb.ah045x;;;;ABBREV_AS_CON_BANNER;19
      indwb.ah046x;;;;ABBREV_AS_CON_BANNER;20
      indwb.ah048x;;;;ABBREV_AS_CON_BANNER;23
      isr.h004ash;;;;ABBREV_AS_CON_BANNER;5
      ita.ss106tar;;;;ABBREV_AS_CON_BANNER;224
      ita.ss212ben;;;;ABBREV_AS_CON_BANNER;330
      nor.fv579sag;;;;ABBREV_AS_CON_BANNER;451
      rus.a331nju;;;;ABBREV_AS_CON_BANNER;71
      rus.a331nov;;;;ABBREV_AS_CON_BANNER;68
      rus.a331sun;;;;ABBREV_AS_CON_BANNER;69
      rus.a331ust;;;;ABBREV_AS_CON_BANNER;70
      rus.a331yak;;;;ABBREV_AS_CON_BANNER;72
      wls.b4599gur;;;;ABBREV_AS_CON_BANNER;2141
      
    • CON_BANNER_MISMATCH
      The route's Banner field in its chopped routes .csv file mismatches the Banner field in its connected routes .csv file.

      (none flagged)
      
    • CON_ROUTE_MISMATCH
      The route's Route field in its chopped routes .csv file mismatches the Route field in its connected routes .csv file.

      ausnsw.b059;;;;CON_ROUTE_MISMATCH;B59 <-> B69
      ausvic.n001altmel;;;;CON_ROUTE_MISMATCH;N1 <-> A1
      che.a014zug;;;;CON_ROUTE_MISMATCH;A14 <-> A4a
      chnsx.g0511;;;;CON_ROUTE_MISMATCH;G0511 <-> G0501
      deusl.l149r;;;;CON_ROUTE_MISMATCH;L149R <-> L149
      eng.a0488;;;;CON_ROUTE_MISMATCH;A488 <-> A487
      eng.a0488bis;;;;CON_ROUTE_MISMATCH;A488 <-> A487
      eng.a4112;;;;CON_ROUTE_MISMATCH;A4112 <-> A4113
      eng.a4189;;;;CON_ROUTE_MISMATCH;A4189 <-> A4180
      eng.b4051;;;;CON_ROUTE_MISMATCH;B4051 <-> B4058
      eng.b4465;;;;CON_ROUTE_MISMATCH;B4465 <-> B4466
      eng.borhistr;;;;CON_ROUTE_MISMATCH;BorTR <-> BorHisTR
      espar.n330jac;;;;CON_ROUTE_MISMATCH;N330 <-> N300
      franor.d638276;;;;CON_ROUTE_MISMATCH;D6382 <-> D6282
      isl.th324;;;;CON_ROUTE_MISMATCH;TH324 <-> TH322
      isl.th523;;;;CON_ROUTE_MISMATCH;TH523 <-> TH533
      ky.ky2084;;;;CON_ROUTE_MISMATCH;KY2084 <-> KY2083
      ltu.kauklagre;;;;CON_ROUTE_MISMATCH;KauKlaGre <-> KauKalGre
      mp.mp100;;;;CON_ROUTE_MISMATCH;MP100 <-> MP102
      mt.neentrd;;;;CON_ROUTE_MISMATCH;NEEntRd <-> NEEntR
      mt.nentrd;;;;CON_ROUTE_MISMATCH;NEntRd <-> NEntR
      mt.wentrd;;;;CON_ROUTE_MISMATCH;WEntRd <-> WEntR
      nir.glenaansr;;;;CON_ROUTE_MISMATCH;GlenAanSR <-> GlenAnnSR
      sct.borhistr;;;;CON_ROUTE_MISMATCH;BorTR <-> BorHisTR
      swe.nordsyd;;;;CON_ROUTE_MISMATCH;NordSyd <-> NordSyk
      wls.a0488;;;;CON_ROUTE_MISMATCH;A488 <-> A487
      wls.a0488bis;;;;CON_ROUTE_MISMATCH;A488 <-> A487
      wls.a4077;;;;CON_ROUTE_MISMATCH;A4077 <-> A4074
      wls.a4078;;;;CON_ROUTE_MISMATCH;A4078 <-> A4074
      wls.a4079;;;;CON_ROUTE_MISMATCH;A4079 <-> A4074
      wy.neentrd;;;;CON_ROUTE_MISMATCH;NEEntRd <-> NEEntR
      wy.nentrd;;;;CON_ROUTE_MISMATCH;NEntRd <-> NEntR
      wy.norcynrd;;;;CON_ROUTE_MISMATCH;NorCynRd <-> NCynRd
      wy.sentrd;;;;CON_ROUTE_MISMATCH;SEntRd <-> SEntR
      wy.wentrd;;;;CON_ROUTE_MISMATCH;WEntRd <-> WEntR
      
    • EXTRA_CHOP_ABBREV
      The route's Abbrev is erroneously included at the end of the Route field in the chopped routes .csv file.
      Info value is the line number in the chopped routes .csv file.

      mexemex.autnauecaeca;;;;EXTRA_CHOP_ABBREV;51
      
    • EXTRA_CON_ABBREV
      The route's Abbrev is erroneously included at the end of the Route field in the connected routes .csv file.
      Info value is the line number in the connected routes .csv file.

      ca.kincanrdced;;;;EXTRA_CON_ABBREV;81
      deube.autzubsch;;;;EXTRA_CON_ABBREV;14
      deuhb.autzubars;;;;EXTRA_CON_ABBREV;15
      deuhb.autzubhem;;;;EXTRA_CON_ABBREV;16
      

    Ping @Bickendan @Duke87ofST @mapcat @michihdeu @neroute2 @ntallyn @ovoss @si404 @the-spui-ninja

  3. reopened this on May 28, 2021
  4. yakra commented on May 28, 2021

    @yakra
    ContributorAuthor

    ^^ What the? How does a commit linked only to a comment here without a keyword like "close" that was never merged to TravelMapping:master close this?
    Reopened!

  5. michihdeu commented on May 29, 2021

    @michihdeu
    Contributor

    @yakra Thanks! The system name as additional info would help to find the correct csv, e.g.

    swe.nordsyd;;;;CON_ROUTE_MISMATCH;NordSyd <-> NordSyk
    

    could be swemot or eursf etc.

    The line number is useless IMO

  6. 1 remaining item

  7. michihdeu commented on May 29, 2021

    @michihdeu
    Contributor

    EXTRA_CON_ABBREV
    The route's Abbrev is erroneously included at the end of the Route field in the connected routes .csv file.
    Info value is the line number in the connected routes .csv file.

    deube.autzubsch;;;;EXTRA_CON_ABBREV;14
    deuhb.autzubars;;;;EXTRA_CON_ABBREV;15
    deuhb.autzubhem;;;;EXTRA_CON_ABBREV;16
    

    No, it is the other way round. The route name was incomplete, see last commit above.

    Autobahnzubringer means freeway distributor road

  8. yakra commented on May 29, 2021

    @yakra
    ContributorAuthor

    @michihdeu wrote:

    @yakra Thanks! The system name as additional info would help to find the correct csv, e.g.

    swe.nordsyd;;;;CON_ROUTE_MISMATCH;NordSyd <-> NordSyk
    

    could be swemot or eursf etc.

    The line number is useless IMO

    CON_ROUTE_MISMATCH doesn't include the line number -- NordSyd <-> NordSyk is the Info here.
    We don't know whether it's the chopped or connected CSV that's the issue, and I figured listing the mismatched banners themselves would be most useful.

    The ones that include the line number are:

    • ABBREV_AS_CHOP_BANNER
    • ABBREV_AS_CON_BANNER
    • EXTRA_CHOP_ABBREV
    • EXTRA_CON_ABBREV

    But anyway, to address your point:

    The idea here is that datacheck.php can link to the appropriate .csv file, with the offending line highlighted.
    I'll send a PM via the forum to how it's currently implemented on lab2.

    • Still being able to see the system name, if only looking at the error in datacheck.log or on GitHub or the forum etc., would be an added plus, yes. E.G., isrh_con.csv#L5. Know which file it is without having to click on the link.
    • Doing it this way would let datacheck.php load faster. Right now, it does a DB query to look up the system name. Unnecessary.
  9. yakra commented on May 29, 2021

    @yakra
    ContributorAuthor

    @michihdeu wrote:

    EXTRA_CON_ABBREV
    The route's Abbrev is erroneously included at the end of the Route field in the connected routes .csv file.
    Info value is the line number in the connected routes .csv file.

    deube.autzubsch;;;;EXTRA_CON_ABBREV;14
    deuhb.autzubars;;;;EXTRA_CON_ABBREV;15
    deuhb.autzubhem;;;;EXTRA_CON_ABBREV;16
    

    No, it is the other way round. The route name was incomplete, see last commit above.

    Autobahnzubringer means freeway distributor road

    Making sure I understand correctly:
    Autobahnzubringer Bremen-Arsten is the proper name, with AutZubArs being its truncated Route name (the way you fixed it in the commit)?
    (Presumably choosing Ars because two AutZubBres would be a problem?)

    No, it is the other way round

    So, the final part of what should be the Route name was erroneously left off in the chopped CSV, and included in the Abbrev field instead.
    Unfortunately, the datacheck can't really tell which of the 2 is happening. But at least we know something is off...

    I should change the description to more clearly describe the causes:

    2 potential underlying causes:

    1. The route's Abbrev is erroneously included at the end of the Route field in the connected routes .csv file.
    2. The final part of the route name was left off the chopped .csv file's Route field, and included in the Abbrev field instead.

    The 2nd case really has nothing to do with the _con.csv file, making the EXTRA_CON_ABBREV code a bit misleading here.
    I could change it to something less suggestive of the 1st case, e.g. CHOP_ABBREV_CON_NAME.

  10. yakra commented on May 29, 2021

    @yakra
    ContributorAuthor

    Another option is to fold EXTRA_CON_ABBREV back into CON_ROUTE_MISMATCH.
    It's really just a specialized case of CON_ROUTE_MISMATCH:

    void Route::con_mismatch()
    {	if (route != con_route->route)
    	  if (route + abbrev == con_route->route)
    		Datacheck::add(this, "", "", "", "EXTRA_CON_ABBREV",
    			       std::to_string(system->con_route_index(con_route)+2));
    	  else if (con_route->route + abbrev == route)
    		Datacheck::add(this, "", "", "", "EXTRA_CHOP_ABBREV",
    			       std::to_string(system->route_index(this)+2));
    	  else	Datacheck::add(this, "", "", "", "CON_ROUTE_MISMATCH",
    			       route+" <-> "+con_route->route);
    	if (banner != con_route->banner)
    	  if (abbrev.size() && abbrev == con_route->banner)
    		Datacheck::add(this, "", "", "", "ABBREV_AS_CON_BANNER",
    			       std::to_string(system->con_route_index(con_route)+2));
    	  else	Datacheck::add(this, "", "", "", "CON_BANNER_MISMATCH",
    			       (banner.size() ? banner : "(blank)") + " <-> " +
    			       (con_route->banner.size() ? con_route->banner : "(blank)"));
    }

    I separated out extra_con & extra_chop and made them their own error because I thought it's useful to note that there's something going on with the abbrev; it can help zero in on what needs fixing.
    Perhaps deube.autzubsch;;;;CON_ROUTE_MISMATCH;AutZub <-> AutZubSch
    or even mexemex.autnauecaeca;;;;CON_ROUTE_MISMATCH;AutNauEcaEca <-> AutNauEca
    are just as useful & clear.

    A problem with the current draft is that the link from datacheck.php for EXTRA_CON_ABBREV is to the _con.csv file on GitHub. Not good when, as in this case, the problem is actually in the chopped .csv file.

    Hmm... Maybe just sticking with CON_ROUTE_MISMATCH is the way to go?

  11. michihdeu commented on May 30, 2021

    @michihdeu
    Contributor

    Autobahnzubringer Bremen-Arsten is the proper name, with AutZubArs being its truncated Route name (the way you fixed it in the commit)?

    yep!

    Unfortunately, the datacheck can't really tell which of the 2 is happening. [...]
    The 2nd case really has nothing to do with the _con.csv file, making the EXTRA_CON_ABBREV code a bit misleading here.

    Exactly. I just want to point out that your description was "incomplete" because there is also a 2nd case.

  12. michihdeu commented on May 30, 2021

    @michihdeu
    Contributor

    We don't know whether it's the chopped or connected CSV that's the issue, and I figured listing the mismatched banners themselves would be most useful.

    The idea here is that datacheck.php can link to the appropriate .csv file, with the offending line highlighted.

    That's a discrepance. You can only link to the file (or even line number of the file ❗) when you know:

    • System name
    • chopped or connected csv

    The latter is quite ambitious. That's why I suggested to output the system name. It helps more than anything else because I know that there are only two files I need to open and check.

    The route name (and line number of any unknown csv file) is fine* with numbered routes (e.g. NOR Rv41 is either in norrv.csv or norrv_con.csv) but useless with named routes. In case of Norway, a named route could be in normot, norntv, eursf or eurtr, and I would need to check up to eight csv files.

    *However, the line number directs either to the chopped or connected route file. The line number is sometimes the very same but often different. So, the line number is also potentially misleading.

  13. yakra commented on May 30, 2021

    @yakra
    ContributorAuthor

    Exactly. I just want to point out that your description was "incomplete" because there is also a 2nd case.

    Yup. Having to write all that extra description for contributors to keep in their heads overcomplicates things.
    I've gotten rid of EXTRA_CON_ABBREV & EXTRA_CHOP_ABBREV and folded them back into CON_ROUTE_MISMATCH. It's an easier concept to understand. Keep it simple.
    Boom! Gone!

    Also added the .csv filename to ABBREV_AS_CHOP_BANNER & ABBREV_AS_CON_BANNER.
    After all the fixes from the last couple days, we have:

    ausqld.td012spr;;;;ABBREV_AS_CON_BANNER;ausqldtd.csv#L20
    ga.ga246rab;;;;ABBREV_AS_CON_BANNER;usaga.csv#L393
    ga.ga246sky;;;;ABBREV_AS_CON_BANNER;usaga.csv#L394
    ita.ss106tar;;;;ABBREV_AS_CON_BANNER;itass.csv#L224
    ita.ss212ben;;;;ABBREV_AS_CON_BANNER;itass.csv#L330
    
    indwb.ah001x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    indwb.ah002x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    indwb.ah045x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    indwb.ah046x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    indwb.ah048x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    
    ca.kincanrdced;;;;CON_ROUTE_MISMATCH;KinCanRd <-> KinCanRdCed
    chnsx.g0511;;;;CON_ROUTE_MISMATCH;G0511 <-> G0501
    ky.ky2084;;;;CON_ROUTE_MISMATCH;KY2084 <-> KY2083
    mexemex.autnauecaeca;;;;CON_ROUTE_MISMATCH;AutNauEcaEca <-> AutNauEca
    

    You can only link to the file (or even line number of the file ❗) when you know:

    • System name

    This is always known. The original draft changes to datacheck.php got it thru a DB lookup, but there are better ways...
    Ways more helpful to the user that simplify the page code & let it load faster.

    • chopped or connected csv

    Known for ABBREV_AS_CHOP_BANNER & ABBREV_AS_CON_BANNER errors.
    These now have the system .csv filename included, as in the above examples.

    EXTRA_CON_ABBREV & EXTRA_CHOP_ABBREV are gone now, so nothing to worry about there anymore.

    The route name (and line number of any unknown csv file) is fine* ... *However, the line number directs either to the chopped or connected route file. The line number is sometimes the very same but often different. So, the line number is also potentially misleading.

    The .csv file is known, so the remaining errors that still include a line number will link right to that line highlighted on GitHub. No ambiguity.

    I plan to keep CON_BANNER_MISMATCH as-is, and not include a system name.
    I think the most informative use of the Info field here is to show a snippet of the relevant data that got the error flagged, as is done with VISIBLE_DISTANCE, SHARP_ANGLE, DUPLICATE_COORDS and the rest that use the Info field.
    With any of the existing datachecks, like a waypoint label error, a contributor already has to know what system a route is in in order to open the file on disk (or GitHub) anyway.
    Most of the time, a contributor will recognize the root listed, and know what system it's in. And if not?

    In case of Norway, a named route could be in normot, norntv, eursf or eurtr, and I would need to check up to eight csv files.

    For CON_ROUTE_MISMATCH & CON_BANNER_MISMATCH, since we don't know which .csv file the error is in, we don't attempt to link to the file. These will have the same old link to the HB.

    If you forget what system a route is in, just click the link and look at the top-left corner above the shield for the system name & code. Then close the browser tab or hit the Back button, etc.
    With all the original errors from before the datachecks' implementation cleared out, this should happen rarely going forward. When it does, you'll know what systems you were working on at the time. :)

    Is an error in the chopped or connected file?

    chnsx.g0511;;;;CON_ROUTE_MISMATCH;G0511 <-> G0501
    ky.ky2084;;;;CON_ROUTE_MISMATCH;KY2084 <-> KY2083
    

    Here, the root is a clue. It'll usually match one and not the other. Chances are there's 1 error not 2, and it's the odd one out.

    ca.kincanrdced;;;;CON_ROUTE_MISMATCH;KinCanRd <-> KinCanRdCed
    mexemex.autnauecaeca;;;;CON_ROUTE_MISMATCH;AutNauEcaEca <-> AutNauEca
    

    Here, it should be apparent we have an extra Abbrev erroneously included in the name. Left = chopped, right = connected.
    Click on the mexemex.autnauecaeca link and you'll see that with its extraneous Eca in the chopped Route name as well as the Abbrev, it expands to a .list name of AutNauEcaEcaEca!

    indwb.ah001x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    indwb.ah002x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    indwb.ah045x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    indwb.ah046x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    indwb.ah048x;;;;CON_BANNER_MISMATCH;x <-> (blank)
    

    These specific examples are admittedly less clear. Opening up 2 .csv files ain't so bad. :)

    Most of the time these should be pretty intuitive, similar to CON_ROUTE_MISMATCH. Some imaginary examples:

    aln.gp001;;;;CON_BANNER_MISMATCH;(blank) <-> alt
    aln.gp002;;;;CON_BANNER_MISMATCH;bus <-> (blank)
    aln.gp003altfoo;;;;CON_BANNER_MISMATCH;(blank) <-> alt
    aln.gp004busbar;;;;CON_BANNER_MISMATCH;bus <-> (blank)
    aln.gp005trkbaz;;;;CON_BANNER_MISMATCH;trk <-> byp
    aln.gp006trkqux;;;;CON_BANNER_MISMATCH;byp <-> trk
    
  14. yakra commented on Jun 8, 2021

    @yakra
    ContributorAuthor

    🐛

    Good thing I messed up! It exposed a bug in the new code...

    usatxf.csv#L331
    usatxf;TX;FM339;Spr;MtC;Mount Calm;tx.fm0339;
    Root should be tx.fm0339sprmtc

    usatxf_con.csv#L331
    usatxf;FM339;Spr;Mount Calm;tx.fm0339mtc
    Root should be tx.fm0339sprmtc

    First, an ErrorList error is flagged, must have been for tx.fm0339mtc not being a valid root; wasn't paying too close attention.
    Then, the C++ version crashes. I bet it's trying to dereference a null pointer.
    Haven't tried the Python version yet, but it should have the same problem. Good thing here is, the info I get when it crashes will tell me where to look!
    Edit:

    Traceback (most recent call last):
      File "./siteupdate.py", line 2991, in <module>
        cr.roots[0].con_mismatch()
    IndexError: list index out of range
  15. yakra commented on Jun 9, 2021

    @yakra
    ContributorAuthor

    Fixed. The results of the bad usatxf data:

    [78.0] ABORTING due to 4 errors:
    1: Duplicate root in usatxf.csv: tx.fm0339 already in usatxf.csv
    2: Could not find Route matching ConnectedRoute root tx.fm0339mtc in system usatxf.
    3: No roots in usatxf_con.csv line: usatxf;FM339;Spr;Mount Calm;tx.fm0339mtc
    4: usatxf.csv: root tx.fm0339 not matched by any connected route root.
    

    Clarity?
    3. No roots -> no valid root. There's a root there; it's just not valid.
    4. TLDR, we've gotta look at error 1, notice that tx.fm0339 is a duplicate, and figure things out from there.

  16. added a commit that references this issue on Jun 9, 2021
    38da77b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions