Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failsafe vertex labels to examine shortening #90

Open
yakra opened this issue Jun 19, 2018 · 37 comments
Open

failsafe vertex labels to examine shortening #90

yakra opened this issue Jun 19, 2018 · 37 comments
Labels

Comments

@yakra
Copy link
Contributor

yakra commented Jun 19, 2018

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)

@yakra
Copy link
Contributor Author

yakra commented Oct 19, 2018

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)

@yakra yakra changed the title failsafe vertex labels to examing shortening failsafe vertex labels to examine shortening Nov 6, 2018
@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra
Copy link
Contributor Author

yakra commented Nov 27, 2018

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

@jteresco

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra
Copy link
Contributor Author

yakra commented Feb 12, 2019

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.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@jteresco
Copy link
Contributor

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

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra
Copy link
Contributor Author

yakra commented Nov 7, 2019

I-90@24&I-93@20&MA3@20(93)&US1@I-93(20)
I-90@134&I-93@20&MA3@20(93)&US1@I-93(20)
I-90@134&I-93@16&MA3@16(93)&US1@I-93(16)
Added to comments (Exit_number)

@yakra

This comment has been minimized.

yakra added a commit to yakra/DataProcessing that referenced this issue Nov 19, 2019
TravelMapping#90 (comment)
Solo routes compressed OK, but concurrencies were still double-counted.
@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra
Copy link
Contributor Author

yakra commented Nov 24, 2019

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.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra

This comment has been minimized.

@yakra
Copy link
Contributor Author

yakra commented Dec 6, 2019

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

@yakra yakra added the CWN canonical_waypoint_name label Mar 2, 2021
@yakra

This comment has been minimized.

@yakra
Copy link
Contributor Author

yakra commented Sep 25, 2024

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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants