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

[Feature Request] Detect redundant relations #39

Open
Polfo opened this issue Dec 3, 2018 · 8 comments
Open

[Feature Request] Detect redundant relations #39

Polfo opened this issue Dec 3, 2018 · 8 comments

Comments

@Polfo
Copy link

Polfo commented Dec 3, 2018

Currently, way 214190421 is part of 4 relations. Relations 3265927 and 6705827 both are part of the same network and carry the same note = 60-298 tag.

Could knooppuntnet provide a warning about this situation. The only current warning is about an incomplete route, while a (different) complete route exists.

image

image

image

image

image

vmarc added a commit that referenced this issue Dec 5, 2018
vmarc added a commit that referenced this issue Dec 5, 2018
@vmarc
Copy link
Owner

vmarc commented Dec 5, 2018

@Polfo thanks for suggesting this new functionality

As a first step, I wrote some code to explore the possibilities for detecting duplicate routes. The code looks for routes with the same name that have at least one way in common. The result is here.

Next would be to figure out if this result actually makes sense. Really duplicate routes? Not too many false positives? The amount of routes found in Germany seems suspiciously high.

@Polfo
Copy link
Author

Polfo commented Dec 6, 2018

@vmarc Great. Thanks.
Interesting. In addition it would be nice to see for each row in the result table: the number of ways and the number of shared ways. Columns could be name, route 1, # ways 1, # shared, # ways 2, route 2

@vmarc
Copy link
Owner

vmarc commented Dec 6, 2018

The report has been updated to include the suggested columns, and a percentage overlap. This makes it easier to distinguish between exact duplicates (100% overlap) and routes with only partial overlap.

The routes with partial overlap have to be looked at more closely to see if it would make sense to issue warnings for those.

For example: there seem to be cases where there are 2 alternative routes between the same nodes. For these it seems to be perfectly ok to have some overlap. It would not be good to issue a warning in these cases. It would be nice if we could somehow recognize these cases by looking at the tags.

Further assistance to analyze the situation is certainly welcome.

@Polfo
Copy link
Author

Polfo commented Dec 6, 2018

Hello vmarc.
Thanks for this quick update.
I analysed 25 entries in the table and came to the following logic.

IF ((both routes are OK) and (NL or BE))

    IF (the overlap is 100%) 
        // 19 cases on a total of 25 checks
        One route is redundant
        It can probably be fixed by deleting one route (but check/merge tags)

    IF (the overlap is < 100%) 
        // 5 cases on a total of 25 checks
        It is probably an alternative route (check and suggest alternative route tagging?)

ELSEIF (one route is NOK (missing node))

    IF (the route with less ways is NOK and shares 100% of ways with route with more ways)
        // 1 case on a total of 25 checks
        The small route is probably redundant
        It can probably be fixed by deleting the route (but check parent network is identical).

Note: sometimes, there are > 2 alternative ways like when 4 lock doors (nl:sluis), each representing an alternative. That makes your table longer, but does not change the algorithms.
e.g. currently relations 3294691 3294692 3294693 3294694

Aditionally, I looked at 5 German cases. The routes with identical ways and note have different tags, like different name and description.
Neuss (1) - Neuss (81) vs KPN Neuss (01) - (81) Neuss
KPN Soest (92) - (93) Bad Sassendorf vs RSW (SO-92) Soest-Thöningsen - (SO-93) Bad Sassendorf
I assume they generated that programatically and not manually.
But at least some redundant routes are maintained in by one user. I don't understand why they do that:
image
image

@vmarc
Copy link
Owner

vmarc commented Dec 6, 2018

There are currently 4 routes that are tagged with state=alternate as documented in the wiki. This is shown in 2 additional columns in the report.

@Polfo
Copy link
Author

Polfo commented Dec 8, 2018

I added encountered frequency in the pseudocode above

@vmarc vmarc changed the title Detect redundant relations [Feature Request] Detect redundant relations Jan 13, 2022
vmarc added a commit that referenced this issue Jan 25, 2022
@vmarc vmarc added idea and removed enhancement labels Nov 9, 2022
@vmarc
Copy link
Owner

vmarc commented May 21, 2024

Report 21 may 2024:

nl/hiking 46561 routes, with 43 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
03-51 6658320 6658321 35% 7 16 4
07-08 3518596 7155614 57% 3 4 2
08-25 11749326 11749327 3% 18 45 1
08-77 1830946 1830952 74% 10 9 7
12-17 4215058 6581626 80% 5 5 4
12-68 11562732 12432648 70% 30 27 20
17-49 6186440 6186441 40% 2 3 1
17-93 5161306 5161307 76% 19 15 13
18-x 7575214 11046624 67% 5 4 3
22-23 11746583 11746584 18% 7 4 1
23-24 7317743 7317744 7% 10 18 1
24-25 11749123 11751730 9% 14 33 2
28-40 11764499 11764500 24% 17 8 3
28-vv 7776398 9174227 50% 2 2 1
29-33 3218910 3218911 18% 4 7 1
32-x 7175609 11047960 71% 7 10 6
34-36 7742677 9638374 40% 2 3 1
36-84 3733997 3734008 50% 2 2 1
39-x 10181051 11047905 50% 3 5 2
40-41 4233340 4587713 44% 4 5 2
44-53 4228903 4613208 57% 7 7 4 ALTERNATE
51-245 15956009 15956010 100% 8 8 8
53-92 1525060 3678746 40% 5 5 2
56-T 4229792 4651524 67% 3 3 2
62-64 3280892 6730084 15% 9 4 1
63-91 6610967 11130821 10% 9 11 1
71-72 3593796 3593797 18% 7 4 1
72-74 5638789 7633251 100% 2 2 2
74-75 11743538 11743539 33% 17 7 4
76-77 11742672 11742673 17% 6 6 1
83-94 2222640 2222641 40% 3 2 1
85-88 10313192 10313193 18% 7 4 1
91-92 3807088 4034136 29% 3 4 1
94-95 7708410 7708411 29% 9 5 2
C07-C09 8383345 8383349 27% 12 3 2
C16-C25 12240946 12240947 40% 2 3 1
E11-E16 7799780 7800949 57% 3 4 2
E63-E94 11906637 11906638 25% 2 6 1
F36-F43 11366571 11366572 18% 7 4 1
L56-L59 13017167 13017168 43% 6 8 3
V32-V33 8026220 9865088 37% 15 12 5
W18-W51 8303295 8303296 60% 6 4 3
W39-W40 12224912 12225776 10% 8 13 1

nl/cycling 15657 routes, with 8 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
01-87 7322272 7322601 8% 19 30 2
08-10 148820 6334533 31% 7 6 2
22-91 1922281 13226228 25% 7 9 2
33-72 1285470 4757484 18% 6 5 1
39-61 1866196 12896009 32% 10 9 3
44-97 1245517 4769578 38% 9 7 3
53-88 3246843 3308552 15% 19 22 3
66-80 13507259 13507260 6% 16 19 1

nl/horse-riding 2021 routes, with 2 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
20-92 3737991 3737992 30% 9 11 3
61-96 8484376 17370984 67% 1 2 1

be/hiking 15439 routes, with 21 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
02-99 12812702 12812916 15% 6 7 1
03-90 6856566 6934504 22% 2 7 1
05-06 2336935 2336936 11% 6 13 1
05-06 7768744 7768770 55% 6 5 3
09-85 2393578 17460083 100% 2 2 2
11-56 2569046 2569052 40% 3 2 1
13-14 2851007 7421410 67% 4 5 3
17-18 3294691 3294692 77% 13 13 10
17-18 3294691 3294693 26% 13 10 3
17-18 3294691 3294694 25% 13 11 3
17-18 3294692 3294693 26% 13 10 3
17-18 3294692 3294694 25% 13 11 3
17-18 3294693 3294694 67% 10 11 7
30-92 4187259 4187260 44% 3 6 2
34-35 2569065 2569066 44% 4 5 2
45-60 2171775 2171776 31% 6 7 2
48-49 308368 308553 20% 3 7 1
51-56 6085464 7368966 50% 2 2 1
55-57 7768539 7768540 11% 7 11 1
55-69 12695702 12695703 25% 4 4 1
58-59 2669998 15447335 100% 4 4 4

be/cycling 10433 routes, with 17 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
02-87 12381947 12952747 100% 6 6 6
05-82 11779746 12982487 100% 14 14 14
06-14 7340458 7340476 34% 25 28 9 ALTERNATE
26-30 11771707 12982120 84% 31 31 26
26-47 7443274 16705027 51% 20 15 9
31-34 12357 1764164 53% 20 18 10
50-51 967549 12385292 100% 10 10 10
51-54 1840378 12385306 100% 16 16 16
52-72 12380217 12952767 61% 15 8 7
53-54 9250 3935684 80% 3 2 2
55-56 11795955 12988981 83% 5 7 5
61-71 1843936 11779728 82% 35 33 28
72-73 11774117 12982172 95% 10 11 10
75-182 1772965 15659173 76% 26 32 22
83-92 11781768 12946850 100% 20 20 20
92-93 11779732 12937172 100% 10 10 10
92-95 19005 7151646 36% 17 16 6 ALTERNATE

de/hiking 13745 routes, with 14 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
21-23 8488396 8488400 14% 3 11 1
22-23 8488397 8488399 33% 8 10 3
90-93 12844769 14438924 50% 1 3 1
Am Hochmoor - Mooshof 6130257 6130258 22% 5 4 1
Am Klingelberg - Stollenwald-Hölzle 11973421 11973422 33% 3 3 1
Am Rumpelstein - Wingolfbrunnen 13048482 13048483 18% 4 7 1
Kiechlinsbergen Beim Käpelle - ? 17270915 17270916 40% 3 2 1
Mittlerer Busterbach - Oberes Silbergründle 12096650 12096651 36% 6 5 2
Muckenhofweiher - Renzenhof 14400600 14400601 17% 7 5 1
Obere Sonnenhalde - Sonnenhalde 17148579 17148583 40% 3 2 1
Riesenbühlweg - Vogelhaus 14276356 14276363 25% 6 2 1
Schanzenbergsattel - Schloss Bad Rotenfels 16755253 16755254 17% 10 2 1
Seibelseckle - Skilift Darmstädter Hütte 12731869 12731871 13% 5 10 1
Theurerswald - Wanderheim Zavelstein 10041108 17191869 33% 4 2 1

de/cycling 13042 routes, with 31 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
01-48 13254981 13255003 50% 8 4 3
04-05 5941416 13948342 100% 22 22 22
04-05 12892395 13118633 100% 9 9 9
17-79 7711579 12365526 100% 3 3 3
20-69 7711537 12365558 100% 3 3 3
21-37 7706766 9240482 100% 32 32 32
22-27 5391806 5391807 44% 10 8 4
22-27 5391806 7820144 44% 10 8 4
22-27 5391807 7820144 100% 8 8 8
22-37 7752176 9240493 100% 3 3 3
29-31 9227315 13992715 100% 5 5 5
29-32 7908654 7908655 71% 27 38 23
29-32 15959339 15959871 5% 21 21 1 ALTERNATE
31-46 123734 2247758 44% 8 10 4
39-94 12936079 15088682 20% 1 9 1
44-46 1829105 2294733 6% 8 23 1
45-46 6009045 7721837 16% 94 32 10
56-72 7592204 7701811 100% 24 24 24
59-90 9790634 12381299 100% 3 3 3
61-68 14481177 15092450 80% 2 3 2
69-70 5997475 7736699 4% 32 22 1
69-71 1830736 2369015 25% 33 32 8
69-81 11928453 12346940 100% 1 1 1
70-71 2271346 2369135 20% 24 27 5
71-72 2271986 2369897 27% 14 30 6
71-99 9790632 12429000 100% 1 1 1
80-82 7997925 8041876 22% 10 26 4
81-83 7528368 7542584 11% 44 12 3
83-85 8917224 8917225 11% 11 8 1
92-94 9796376 12381292 100% 10 10 10
Sch21 - Sch21 12966407 12966409 75% 14 10 9

fr/hiking 20420 routes, with 56 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
? - Col de la Chapelle 12356391 12356392 25% 3 5 1
? - Doucy Village 15044922 15082036 44% 6 3 2
? - Giron 13672670 13672671 20% 5 5 1
? - La Borne au Lion 13644061 13672683 14% 12 2 1
? - Le Chaleyras 17611236 17611240 67% 2 1 1
? - Le lac de Pramol 14874322 14874324 22% 3 6 1
? - Les Côtes 12120715 15966177 25% 4 4 1
? - Montagne d'en Haut 15068920 15068923 33% 3 3 1
? - Refuge des Évettes 15033347 15033348 40% 2 3 1
? - Saint-Geney 17537082 17538631 29% 4 3 1
?-? 13473679 14156925 12% 4 13 1
?-? 13569606 13573807 25% 4 4 1
?-? 13659816 15430260 30% 7 26 5
?-? 13669140 13669142 25% 3 5 1
?-? 13669143 13669144 17% 9 3 1
?-? 13669147 13669149 25% 6 2 1
?-? 13825759 13825761 57% 3 4 2
?-? 14011898 14020559 50% 2 2 1
Auberives-en-Royans - Le Barrage 17532880 17556476 100% 21 21 21
Baraque de Carpe - Gampaloux 17508473 17508476 67% 4 5 3
Belvédère des Expertois - Chaumois Boivin 13765922 13765923 33% 2 4 1
Bois Sigü - Ecole d'escalade 12432286 17471222 100% 1 1 1
Cable Keller - Le Châtaignier 14137618 14954082 100% 1 1 1
Champlan - ? 12531090 12531109 50% 2 2 1
Chemin d'Herbe - Pas des Feuillées 17497195 17569388 89% 9 9 8
Chichilianne - Chichilianne 17498125 17501504 100% 3 3 3
Col de Papavet - Les Sages 17498122 17498132 50% 2 2 1
Col des Pellas - Col de Papavet 17498679 17498680 50% 2 2 1
Doucy Village - Oratoire du Chaussis 15044924 15082037 40% 3 2 1
Ecole d'escalade - La fontaine du val Furon 12432287 17471221 100% 4 4 4
Grande Aiguille - Lac des Pourettes 2518488 14512583 100% 1 1 1
L'Igloo - Croix des 7 Frères 17428301 17428561 100% 2 2 2
La Basse Combe Froide - Sur les Puits 13661460 13661461 67% 3 3 2
La Combe Nord - Bourbourin 16061231 16387457 60% 5 5 3 ALTERNATE
La Frette - Cable Keller 14185528 14954083 100% 4 4 4
La Piscine - ? 17462266 17462267 17% 3 9 1
La fontaine du val Furon - Bois Sigü 12432288 17471220 100% 3 3 3
Le Châtaignier - Font Chaise 14137617 14954081 86% 7 7 6
Le Moulin - ? 17507243 17507244 17% 5 7 1
Le Solliet (Sud) - Le Solliet (Nord) 17434111 17434112 100% 1 1 1
Les Carrières - La Planche du Fenu 14188445 14188446 25% 4 4 1
Les Charbonnières - Roches de Saint-Béron 14459911 14749452 67% 1 2 1
Les Civières - Gève 12434636 17445917 20% 5 5 1
Les Poules - Pré Achard 17479167 17520073 100% 1 1 1
Les Sages - ? 17498121 17498133 50% 2 2 1
Mas Rebuffat - Le Passeït 17556232 17611224 100% 3 3 3
Mollard des Barres - ? 13573799 13574532 20% 7 3 1
Moure de Trian - Chêne Rond 17047141 17279311 33% 3 3 1
Oppedette (Mairie) - Parking des Belvédères 16020492 16020493 80% 10 10 8
Passerelle du Foron - Lac de Flérier 17408940 17409019 33% 2 4 1
Plan Corbet - Col de la Légette 17195212 17195213 50% 2 2 1
Rue des Ondines - Pont de la Poudrerie 12232602 12346014 62% 7 6 4 ALTERNATE
Saint-Nazaire-en-Royans - ? 17526240 17526241 17% 4 8 1
Salastre - Notre Dame d'Ajude 14769975 15880994 29% 3 4 1
Tiers de Châtillon - ? 17410458 17410497 67% 1 2 1
Écomusée de l'Ocre - Piquebori 16363407 16363419 59% 8 9 5 ALTERNATE

fr/cycling 1792 routes, with 7 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
05-15 15587866 15617862 100% 7 7 7
65-67 15576803 15576810 100% 1 1 1
66-68 15572218 15582738 86% 12 16 12
81-77 15773335 16836114 100% 12 12 12
84-86 15668726 15671392 100% 4 4 4
91-90 16266338 16841944 100% 2 2 2
94-41 16841939 17163753 100% 3 3 3

at/cycling 132 routes, with 1 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
32-34 10440632 10440633 15% 9 4 1 ALTERNATE

es/hiking 275 routes, with 1 overlaps

name route 1 route 2 overlap # ways 1 # ways 2 # shared alt 1 alt 2
AE216 - AE220 11351581 11351589 5% 25 18 1

@pyrog
Copy link

pyrog commented May 25, 2024

related to JOSM/pt_assistant#66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ideas
Development

No branches or pull requests

3 participants