You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since VISIBLE_DISTANCE errors are no longer flagged for active routes, we have a lot of unmatched fps in unmatchedfps.log. It would be good to automate a one-time cleanup of the fp list.
That was, in the strictest sense, a "a one-time cleanup". :)
I can easily do that again, and it may be worthwhile...
There are now only 49 (make that 48, actually...) unmatchedfps, for a much better signal-to-noise ratio.
Three of these are nearmatchfps, and may be helpful for contributors correcting those. The rest, I suppose it may be better to leave to the authors of the respective regions to deal with as appropriate.
So, I erred on the side of caution and didn't cull these along with the VISIBLE_DISTANCE unmatchedfps.
More to the point, though, there are still 3139 VISIBLE_DISTANCE FPs marked in preview and devel systems, which may slowly filter into unmatchedfps.log as more systems go live (unless the author gets rid of them when activating the systems).
TL;DR, future cleanups may still be necessary. I guess I'll leave it to @jteresco whether to close or leave this issue open.
usingnamespacestd;
#include<fstream>
#include<iostream>classentry
{ public:
string text;
bool cull;
entry *prev, *next;
// init alphaentry() {prev = 0; next = 0; cull = 0;}
// insertionsentry(entry *cursor) // cursor, in this case, is a pointer to the prev entry
{ prev = cursor;
next = 0;
cull = 0;
}
};
boolfind(string needle, entry *haystack)
{ while (haystack)
{ if (needle == haystack->text) return1;
haystack = haystack->next;
}
return0;
}
intmain(int argc, char *argv[])
{ entry *cList = new entry;
entry *fList = new entry;
entry *cursor;
if (argc != 4) { cout << "usage: ./fpcull CullFile FullFile OutputFile\n"; return0; }
// init ifstreams
ifstream cFile(argv[1], ios::in);
if (!cFile.is_open()) { cout << argv[1] << " file not found!" << endl; return0; }
ifstream fFile(argv[2], ios::in);
if (!fFile.is_open()) { cout << argv[2] << " file not found!" << endl; return0; }
// create cull list
cFile >> cList->text; //TODO: enclose in an IF in case hell breaks loose (IE, no text in cFile) //FIXME: see below
cursor = newentry(cList);
while (cFile >> cursor->text) //FIXME: This expects every line to be one text string and every text string to be one line. This will not always be the case.// For example, see line 6613 of https://github.com/TravelMapping/HighwayData/blob/d33d0f6e93eec8ce7f71f31af94336a473161e5f/datacheckfps.csv
{ cursor->prev->next = cursor;
cursor = newentry(cursor);
}
delete cursor;
// create full listfFile >> fList->text; //TODO: enclose in an IF in case hell breaks loose (IE, no text in fFile) //FIXME: see below
cursor = newentry(fList);
while (fFile >> cursor->text) //FIXME: This expects every line to be one text string and every text string to be one line. This will not always be the case.// For example, see line 6613 of https://github.com/TravelMapping/HighwayData/blob/d33d0f6e93eec8ce7f71f31af94336a473161e5f/datacheckfps.csv
{ cursor->prev->next = cursor;
cursor = newentry(cursor);
}
delete cursor;
// flag unmatchedfps as to-be-culledfor (cursor = fList; cursor; cursor = cursor->next)
if (find(cursor->text, cList)) cursor->cull = 1;
// output
ofstream oFile(argv[3]);
cursor = fList;
while (cursor)
{ if (!cursor->cull) oFile << cursor->text << endl;
cursor = cursor->next;
}
}
It's not perfect; it choked on the line that Si removed from line 6613 of this commit (because it expects every line to be one text string and every text string to be one line), but it does a pretty bang-up job. Just requires a little manual checking.
Looks better than the nonexistent one we had before! Could you put in a pull request adding this to a directory like "CullDatacheckFPs" in this repository?
shell script to produce a list of VISIBLE_DISTANCE entries in active systems (replace the file & directory paths in the first 2 lines with what's appropriate on your system):
Activity
yakra commentedon Oct 13, 2017
TravelMapping/HighwayData#1657
yakra commentedon Oct 13, 2017
I only removed VISIBLE_DISTANCE entries, and not all unmatchedfps.
yakra commentedon Oct 14, 2017
That was, in the strictest sense, a "a one-time cleanup". :)
I can easily do that again, and it may be worthwhile...
There are now only 49 (make that 48, actually...) unmatchedfps, for a much better signal-to-noise ratio.
Three of these are nearmatchfps, and may be helpful for contributors correcting those. The rest, I suppose it may be better to leave to the authors of the respective regions to deal with as appropriate.
So, I erred on the side of caution and didn't cull these along with the VISIBLE_DISTANCE unmatchedfps.
More to the point, though, there are still 3139 VISIBLE_DISTANCE FPs marked in preview and devel systems, which may slowly filter into unmatchedfps.log as more systems go live (unless the author gets rid of them when activating the systems).
TL;DR, future cleanups may still be necessary. I guess I'll leave it to @jteresco whether to close or leave this issue open.
jteresco commentedon Oct 14, 2017
I'll leave it open, since I think something more automated is a worthy future goal.
michihdeu commentedon Oct 14, 2017
Out of more than 5,000 FPs in total...
👍
yakra commentedon Oct 15, 2017
How's this? :D
It's not perfect; it choked on the line that Si removed from line 6613 of this commit (because it expects every line to be one text string and every text string to be one line), but it does a pretty bang-up job. Just requires a little manual checking.
jteresco commentedon Oct 15, 2017
Looks better than the nonexistent one we had before! Could you put in a pull request adding this to a directory like "CullDatacheckFPs" in this repository?
yakra commentedon Oct 16, 2017
#66
yakra commentedon Nov 6, 2018
(Lines containing whitespace would have been split into multiple lines, instead of being left alone.)
Fixed in #124 -- and basically rewritten altogether. That earlier version was a bit of an embarrassment.
yakra commentedon Nov 23, 2019
shell script to produce a list of
VISIBLE_DISTANCEentries in active systems (replace the file & directory paths in the first 2 lines with what's appropriate on your system):You can even have its output masquerade as a file; and use it as an argument to fpcull:
...shown here as if it were saved as a .sh file, for brevity and ease of understanding.
...Or, more verbosely:
You don't even need to save it as a file.
VISIBLE_DISTANCE FPs in active systems
jteresco commentedon Dec 31, 2022
Still anything in this issue we might want to pursue further?
michihdeu commentedon Dec 31, 2022
Yep, the initial issue still exists:
We have 328 unmatched FPs right now: https://travelmapping.net/logs/unmatchedfps.log