Skip to content

NMP "looks intentional" error (what gets flagged) #150

Closed

Description

@yakra

Crossposted to the Forum:

nearmisspoints.log:

aln.backcove Bar (43.669615,-70.265141) NMP aln.backcove Baz (43.669762,-70.265371) aln.backcove Foo (43.669615,-70.26514) [LOOKS INTENTIONAL]
aln.backcove Baz (43.669762,-70.265371) NMP aln.backcove Bar (43.669615,-70.265141) aln.backcove Foo (43.669615,-70.26514)
aln.backcove Foo (43.669615,-70.26514) NMP aln.backcove Bar (43.669615,-70.265141) aln.backcove Baz (43.669762,-70.265371) [LOOKS INTENTIONAL]

Log lines list all NMPs for a given point on a single line, whether they look intentional or not.
If any single NMP LOOKS INTENTIONAL, then the entire line is flagged:

for other_w in sorted(w.near_miss_points,
key=lambda waypoint:
waypoint.route.root + "@" + waypoint.label):
if (abs(w.lat - other_w.lat) < 0.0000015) and \
(abs(w.lng - other_w.lng) < 0.0000015):
nmplooksintentional = True

In this example, Foo and Bar are designed to Look Intentional (off by 0.000001), and Baz is offset from both by a greater amount.
The 2nd line, for Baz, looks fine, as neither of its NMPs are within 0.000001 of Baz.
The 1st & 3rd lines each list one NMP that LOOKS INTENTIONAL and one that does not.

tm-master.nmp:

aln.backcove@Bar 43.669615 -70.265141 LI
aln.backcove@Baz 43.669762 -70.265371 LI

aln.backcove@Bar 43.669615 -70.265141 LI
aln.backcove@Foo 43.669615 -70.26514 LI

aln.backcove@Baz 43.669762 -70.265371
aln.backcove@Foo 43.669615 -70.26514

(whitespace added for easier reading)
3rd pair looks fine: it does not Look Intentional, and is not flagged as such.
2nd pair looks fine: it does Look Intentional, and is flagged as such.
1st pair: does not Look Intentional, but is flagged. This is because Foo is an NMP of Bar, and thus sets nmplooksintentional to True for all NMPs of Bar.

Activity

  1. added
    nmps
    on Dec 13, 2018
  2. yakra commented on Dec 13, 2018

    @yakra
    ContributorAuthor

    I don't propose any changes to nmpline (before the [MARKED FP] and [LOOKS INTENTIONAL] fields), as that would break everybody's false positives. Maybe a [SOME LOOK INTENTIONAL] tag would be sufficient.

    For tm-master.nmp, there are ways to get the "LI" extra_fields right.

  3. self-assigned this
    on Jan 3, 2019
  4. yakra commented on Apr 26, 2019

    @yakra
    ContributorAuthor

    While working on #211, I found an example of this in the real world.
    http://travelmapping.net/logs/nmpbyregion/nld.nmp | HDX-Lite

    nld.a002@53 50.858461 5.713336 FPLI
    nld.n002maa@A2(53) 50.858461 5.713335 FPLI
    nld.a002@53 50.858461 5.713336 FPLI
    nld.n590@N2 50.858559 5.713041 FPLI
    nld.a002@53 50.858461 5.713336 FPLI
    nld.noobrug@N2 50.858461 5.713335 FPLI
    ...
    nld.e25@53(A2) 50.858461 5.713336 FPLI
    nld.n002maa@A2(53) 50.858461 5.713335 FPLI
    nld.e25@53(A2) 50.858461 5.713336 FPLI
    nld.n590@N2 50.858559 5.713041 FPLI
    nld.e25@53(A2) 50.858461 5.713336 FPLI
    nld.noobrug@N2 50.858461 5.713335 FPLI
    ...
    nld.n002maa@A2(53) 50.858461 5.713335 FPLI
    nld.n590@N2 50.858559 5.713041 FPLI
    nld.n590@N2 50.858559 5.713041 FP
    nld.noobrug@N2 50.858461 5.713335 FP

    • The bolded entries show the bug in action; we can see these are >0.0000015° apart.
      • nld.a002@53 also has nld.n002maa@A2(53) as a NMP. It LI, all NMPs are flagged LI, including nld.n590@N2.
      • nld.e25@53(A2) also has nld.n002maa@A2(53) as a NMP. It LI, all NMPs are flagged LI, including nld.n590@N2.
      • nld.n002maa@A2(53) also has the above 2 points as NMPs. They LI, all NMPs are flagged LI, including nld.n590@N2.
    • In italics: the last pair here is like the last pair in the OP. Starting our search at nld.n590@N2, nothing that LI is found. This pair is unflagged, correctly.
  5. yakra commented on Mar 23, 2020

    @yakra
    ContributorAuthor

    For finding NMP pairs where some but not all are marked as FP.
    Not really relevant to this issue, but just leaving it here rather than opening a new one.

    for PriCoord in \
      $(grep MARKED nearmisspoints.log \
        | sed 's~.* \((-\?[0-9]\+\.\?-\?[0-9]*,-\?[0-9]\+\.\?-\?[0-9]*)\) .*~\1~' \
        | sort | uniq \
      ); do
      NumResults=$( \
        grep -v '\[MARKED FP\]' nearmisspoints.log | grep -m 1 -c "$PriCoord" \
      )
      if [[ $NumResults = 1 ]]; then
        cat nearmisspoints.log | grep "$PriCoord"
        echo
      fi
    done
  6. changed the title [-] NMP "looks intentional" error[/-] [+] NMP "looks intentional" error (what gets flagged)[/+] on Mar 23, 2020
  7. yakra commented on Mar 24, 2020

    @yakra
    ContributorAuthor

    HighwayData @ 5e187fe4f18d4d44730f0804906c07f586846bea

    yakra@BiggaTomato:~/TravelMapping/yakra/DataProcessing/siteupdate/cplusplus$ diff logs/nearmisspoints.log <(cat _nmpli/logs/nearmisspoints.log | sed 's~SOME LOOK INTENTIONAL~LOOKS INTENTIONAL~')
    yakra@BiggaTomato:~/TravelMapping/yakra/DataProcessing/siteupdate/cplusplus$ 
    

    Yes. Good.


    653,654c653,654
    < nld.a002@53 50.858461 5.713336 FPLI
    < nld.n590@N2 50.858559 5.713041 FPLI
    ---
    > nld.a002@53 50.858461 5.713336 FP
    > nld.n590@N2 50.858559 5.713041 FP
    663,664c663,664
    < nld.e25@53(A2) 50.858461 5.713336 FPLI
    < nld.n590@N2 50.858559 5.713041 FPLI
    ---
    > nld.e25@53(A2) 50.858461 5.713336 FP
    > nld.n590@N2 50.858559 5.713041 FP
    669,670c669,670
    < nld.n002maa@A2(53) 50.858461 5.713335 FPLI
    < nld.n590@N2 50.858559 5.713041 FPLI
    ---
    > nld.n002maa@A2(53) 50.858461 5.713335 FP
    > nld.n590@N2 50.858559 5.713041 FP

    ...To be examined in the morning.

  8. yakra commented on Mar 24, 2020

    @yakra
    ContributorAuthor

    The diff above checks out. Good.

    Bad:

    tx.tx161sir RockIslRd (32.81597,-97.018214) NMP tx.geobushtpk +x357 (32.815971,-97.018214) [MARKED FP] [SOME LOOK INTENTIONAL]

    If there's only one NMP, there's nothing "SOME" about it!

    Out of 207 new [SOME LOOK INTENTIONAL] lines, 102 list only a single NMP for a given point.

  9. yakra commented on Mar 24, 2020

    @yakra
    ContributorAuthor
    if (fp)												// yes
    {	nmpfplist.erase(fpit);
    	nmpline += " [MARKED FP]";
    	near_miss_points.clear();								// done!
    }
    if (li_count)											// intended == 1; yes
    {	if ( li_count == std::distance(near_miss_points.begin(), near_miss_points.end()) )	// std::distance == 0, because near_miss_points was just cleared
    		nmpline += " [LOOKS INTENTIONAL]";						// nope
    	else	nmpline += " [SOME LOOK INTENTIONAL]";						// done!
    	near_miss_points.clear();
    }
    // need to switch the order of these 2 blocks

    This puts the [LOOKS INTENTIONAL]/[SOME LOOK INTENTIONAL] & [MARKED FP] tags in that order rather than the reverse, as has been done till now. Not a big deal IMO.

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

Metadata

Metadata

Assignees

Labels

bugnmpspending

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions