Skip to content

failsafe vertex labels to examine shortening #90

Open

Description

@yakra

These can be copied to the comments of siteupdate.py.

A9Gun/A9Alt/E49Gun/E49Alt/E51Gun/E51Alt@ST/SN
ME9@PondRd&ME137@PondRd_Alb&US202@PondRd (though this is similar to some examples already listed, that just have directional _suffixes instead) Added to comments (Straightforward_concurrency)

Activity

  1. yakra commented on Oct 19, 2018

    @yakra
    ContributorAuthor

    Closed intersections

    • Straightforward_intersection
      IN14@*US31&US31@*IN14
    • Straightforward_concurrency
      US6@BriSt&MA79@*BriSt&MA138@BriSt
    • Exit/Intersection
      I-94@*195&US52@*I-94(195)
    • Exit_number
      A2@*33&A67@*33&E25@*33(N2)&E34@*33(N2)
  2. changed the title [-]failsafe vertex labels to examing shortening[/-] [+]failsafe vertex labels to examine shortening[/+] on Nov 6, 2018
  3. yakra commented on Nov 6, 2018

    @yakra
    Author
  4. yakra commented on Nov 19, 2018

    @yakra
    Author
  5. yakra commented on Nov 27, 2018

    @yakra
    ContributorAuthor
    3+ intersection: US16@US16Trk/385Trk_S&US16TrkHil@US16/385_S&US385@US16Trk/385Trk_S&US385TrkHil@US16/385_S	US16/US16TrkHil/US385/US385TrkHil
    3+ intersection: US16@US16Trk/385Trk_N&US16TrkHil@US16/385_N&US385@US16Trk/385Trk_N&US385TrkHil@US16/385_N	US16/US16TrkHil/US385/US385TrkHil
    Appended region: US16/US16TrkHil/US385/US385TrkHil|SD
    
    GA3@US78/278_E&GA8@US19/41_S&US19@US78/278_E&US41@US78/278_E&US78@US19/41_S&US278@US19/41_S -> GA3/GA8/US19/US41/US78/US278
    GA3@US78/278_W&GA8@US19/41_N&US19@US78/278_W&US41@US78/278_W&US78@US19/41_N&US278@US19/41_N -> GA3/GA8/US19/US41/US78/US278
    GA3/GA8/US19/US41/US78/US278|GA
    

    Never mind:

    Exit/Intersection: AR108@US59/71&US59@AR108&US71@AR108 -> AR108/US59/US71
    Exit/Intersection: AR108@US59/71&US59@AR108&US71@AR108 -> AR108/US59/US71
    Appended region: AR108/US59/US71|TX
    

    Two separate unconnected segments of AR108, one in AR & one in TX, both connecting to US59/71

  6. jteresco commented on Dec 9, 2018

    @jteresco
  7. yakra commented on Dec 23, 2018

    @yakra
    Author
  8. yakra commented on Feb 2, 2019

    @yakra
    Author
  9. yakra commented on Feb 12, 2019

    @yakra
    ContributorAuthor

    TX21@US183/130&TX130@461&US183@TX21
    I-280@I-680/101&I-680@I-280/101&US101@385B


    Pending...

    Straightforward intersection: AB1ACoc@CroTrl_S&CroTrl@AB1A_E -> AB1A_E/CroTrl_S
    Weird, cannf has always been devel. I must have temporarily disabled it when I added that comment. Or just made it up or something.

  10. yakra commented on Feb 18, 2019

    @yakra
    Author
  11. yakra commented on Apr 26, 2019

    @yakra
    Author
  12. yakra commented on Apr 28, 2019

    @yakra
    Author
  13. jteresco commented on May 17, 2019

    @jteresco
    Contributor

    I-93@12&MA3@12(93)&MA3APly@MA3_N&MA203@I-93&US1@I-93(12)

  14. 12 remaining items

  15. yakra commented on Nov 22, 2019

    @yakra
    Author
  16. yakra commented on Nov 24, 2019

    @yakra
    ContributorAuthor

    i7 & i8

    i7: use Waypoint::label_references_single_route(Route *r)
    i8: comment out final check for underscore or null zero


    • Work on C-string based speedup

    OK, so this ended up using the C++ string class; it's just more convenient. :P
    No noticeable change in speed; keeping it because in addition to a shorter straightforward_intersection.cpp, we gain a new Waypoint::label_references_single_route(Route *r) function that may prove useful in future waypoint simplification or datacheck enhancements.

    bool Waypoint::label_references_single_route(Route *r)
    {	std::string no_abbrev = r->name_no_abbrev();
    	if (label.substr(0, no_abbrev.size()) != no_abbrev)
    		return 0;
    	if (label[no_abbrev.size()] == 0 || label[no_abbrev.size()] == '_')
    		return 1;
    	if (label.substr(no_abbrev.size(), r->abbrev.size()) != r->abbrev)
    		return 0;
    	if (label[no_abbrev.size() + r->abbrev.size()] == 0 || label[no_abbrev.size() + r->abbrev.size()] == '_')	// If I comment out this line along with...
    		return 1;
    	else	return 0;												// ...this one, then the results change.
    }
    if (ap_coloc.size() == 2)
      if (ap_coloc[1]->label_references_route(ap_coloc[0]->route) && ap_coloc[0]->label_references_route(ap_coloc[1]->route))
      {	std::string newname = ap_coloc[1]->label+"/"+ap_coloc[0]->label;
    	// if this is taken or if name_no_abbrev()s match, attempt to add in abbrevs if there's point in doing so
    	bool taken = vertex_names.find(newname) != vertex_names.end();
    	if ( 	(ap_coloc[0]->route->abbrev.size() || ap_coloc[1]->route->abbrev.size())
    	     && (taken || ap_coloc[0]->route->name_no_abbrev() == ap_coloc[1]->route->name_no_abbrev())
    	   ) {	const char *u0 = strchr(ap_coloc[0]->label.data(), '_');
    		const char *u1 = strchr(ap_coloc[1]->label.data(), '_');
    		std::string newname = (ap_coloc[0]->route->list_entry_name() + (u1 ? u1 : "")) + "/" + (ap_coloc[1]->route->list_entry_name() + (u0 ? u0 : ""));
    		std::string message = "Straightforward intersection: " + name + " -> " + newname;
    		if (taken) message += " (" + ap_coloc[1]->label+"/"+ap_coloc[0]->label + " already taken)";
    		log.push_back(message);
    		return newname;
    	     }
    	log.push_back("Straightforward intersection: " + name + " -> " + newname);
    	return newname;
      }

    Commenting out the two lines noted above in the new function changes how we react to an unexpected abbrev, letter suffix, or slashed designation giving us 228 diffs. I'm still in the process of looking through them, and the results are... interesting. I see evidence of cases where somethign went wrong or got forgotten while editing; some potential for future datachecks. In almost all cases, Jim's existing labels (which we get with the two lines of code left in place) are objectively better.
    I'll keep looking at the data, investigate possibilities for new datachecks, and decide how to proceed.

  17. yakra commented on Dec 4, 2019

    @yakra
    Author
  18. yakra commented on Dec 4, 2019

    @yakra
    Author
  19. yakra commented on Dec 4, 2019

    @yakra
    Author
  20. yakra commented on Dec 4, 2019

    @yakra
    Author
  21. yakra commented on Dec 4, 2019

    @yakra
    Author
  22. yakra commented on Dec 5, 2019

    @yakra
    Author
  23. yakra commented on Dec 6, 2019

    @yakra
    Author
  24. yakra commented on Dec 6, 2019

    @yakra
    Author
  25. yakra commented on Dec 6, 2019

    @yakra
    Author
  26. yakra commented on Dec 6, 2019

    @yakra
    ContributorAuthor
    cd ~/TravelMapping/devel
    ( echo 'latitude;longitude;old label;new label'
      paste -d';' \
      <(diff <(head -n 588644 i0can.tmg) \
    	 <(head -n 588644 i15can.tmg) | grep '^<' | cut -f3 -d' ') \
      <(diff <(head -n 588644 i0can.tmg) \
    	 <(head -n 588644 i15can.tmg) | grep '^<' | cut -f4 -d' ') \
      <(diff <(head -n 588644 i0can.tmg) \
    	 <(head -n 588644 i15can.tmg) | grep '^<' | cut -f2 -d' ') \
      <(diff <(head -n 588644 i0can.tmg) \
    	 <(head -n 588644 i15can.tmg) | grep '^>' | cut -f2 -d' ') \
    ) > i15diff.csv

    • replace 588644 with num vertices + 2
    • replace i0can & i15can with whatever canonical TMGs I want to diff

  27. added
    CWN
    on Mar 2, 2021
  28. yakra commented on May 5, 2021

    @yakra
    Author
  29. yakra commented on Sep 25, 2024

    @yakra
    ContributorAuthor

    CT8@39&CT222@US6/8&US6@CT8(39)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CWNenhancementgraph generation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions