Closed yakra closed 3 years ago
Was there a recent change? I mean, I also rely on it for border wps. I wanted to be sure and tested it a few months ago and was sure it works.
I just found a case where a trailing zero was missing in a wpt file I've drafted this month....
wpt editor also behaves as desired.
Is it possible to compute all my wpt files and output lines where trailing zeros are missing?
To avoid NMPs.
Maybe it's just 'cuz I'm still working on that first cup of coffee, but I don't see what this has to do with NMPs. NMPs are calculated by distance between points, and are unaffected by presence or absence of trailing zeros. But anyway, to answer the question...
hwy_data/
directory.regions
variable of the regions you want to look at. Based on this forum post, it might be
regions='FRA-ARA FRA-BFC FRA-GES FRA-HDF FRA-IDF FRA-NOR BEL DNK LTU LUX NLD NOR SWE AUT CHE CZE DEU-BB DEU-BE DEU-BW DEU-BY DEU-HB DEU-HE DEU-HH DEU-MV DEU-NI DEU-NW DEU-RP DEU-SH DEU-SL DEU-SN DEU-ST DEU-TH HUN LIE HRV SVN ARG BRA ECU URY'
It must be enclosed within quotes, all caps, and space-separated. No whitespace around the =
sign.for rg in $regions; do egrep -Hsv 'http://www.openstreetmap.org/\?lat=-?[0-9]+\.[0-9]{6}\&lon=-?[0-9]+\.[0-9]{6}' $rg/*/*.wpt | grep http:; done
(The grep command at the end filters out blank lines, notes in unprocessed files, etc.)Here's what I get:
FRA-ARA/fraarad15/fraara.d063215.wpt:Can/PdD http://www.openstreetmap.org/?lat=45.38901&lon=2.753239
FRA-ARA/fraarad26/fraara.d013926.wpt:Dro/Ise http://www.openstreetmap.org/?lat=45.318137&lon=5.03356
FRA-ARA/fraarad26/fraara.d022826.wpt:Dro/Ise http://www.openstreetmap.org/?lat=45.2268&lon=5.190225
FRA-BFC/frabfcd21/frabfc.d0010f21.wpt:A38 http://www.openstreetmap.org/?lat=47.31889&lon=4.91485
FRA-BFC/frabfcd21/frabfc.d010821vel.wpt:A38 http://www.openstreetmap.org/?lat=47.31889&lon=4.91485
FRA-BFC/frabfcd39/frabfc.d028439.wpt:D116 http://www.openstreetmap.org/?lat=46.784513&lon=6.0388
FRA-BFC/frabfcd70/frabfc.d000170.wpt:GES/BFC http://www.openstreetmap.org/?lat=47.85563&lon=5.798885
FRA-BFC/frabfcd71/frabfc.d022971.wpt:ARA/BFC http://www.openstreetmap.org/?lat=46.319133&lon=3.98193
FRA-BFC/frabfcd89/frabfc.d019289.wpt:Yon/Nie http://www.openstreetmap.org/?lat=47.3793&lon=3.937966
FRA-GES/fragesd6ae/frages.d0001b16ae.wpt:A35 http://www.openstreetmap.org/?lat=48.21786&lon=7.402012
FRA-GES/fragesd6ae/frages.d003226ae.wpt:BFC/GES http://www.openstreetmap.org/?lat=47.609975&lon=7.00814
FRA-GES/fragesd6ae/frages.d003236ae.wpt:BFC/GES http://www.openstreetmap.org/?lat=47.680837&lon=7.04303
FRA-GES/fragesd6ae/frages.d003286ae.wpt:BFC/GES http://www.openstreetmap.org/?lat=47.682429&lon=7.04788
FRA-GES/fragesd6ae/frages.d01666ae.wpt:A36 http://www.openstreetmap.org/?lat=47.72645&lon=7.168064
FRA-GES/fragesd6ae/frages.d02276ae.wpt:D627 http://www.openstreetmap.org/?lat=48.8668&lon=7.682152
FRA-GES/fragesd6ae/frages.d02646ae.wpt:DEU/FRA http://www.openstreetmap.org/?lat=49.04611&lon=7.953629
FRA-GES/fragesd6ae/frages.d03236ae.wpt:Mos/Als http://www.openstreetmap.org/?lat=48.95838&lon=6.994834
FRA-GES/fragesd6ae/frages.d07326ae.wpt:A4 http://www.openstreetmap.org/?lat=48.76923&lon=7.597389
FRA-GES/fragesd6ae/frages.d07486ae.wpt:D437 http://www.openstreetmap.org/?lat=48.74275&lon=7.812822
FRA-GES/fragesm6ae/frages.m02636ae.wpt:M2350 http://www.openstreetmap.org/?lat=48.592831&lon=7.74255
FRA-GES/fragesm6ae/frages.m04006ae.wpt:A35 http://www.openstreetmap.org/?lat=48.524904&lon=7.66541
FRA-GES/fragesm6ae/frages.m04686ae.wpt:A35 http://www.openstreetmap.org/?lat=48.546188&lon=7.72768
FRA-HDF/frahdfd59/frahdf.d026759.wpt:Nor/Ais http://www.openstreetmap.org/?lat=50.046449&lon=3.54036
FRA-HDF/frahdfd60/frahdf.d002160.wpt:HDF/IDF http://www.openstreetmap.org/?lat=49.158232&lon=2.26195
FRA-HDF/frahdfd60/frahdf.d003060.wpt:Som/Ois http://www.openstreetmap.org/?lat=49.74006&lon=1.830042
FRA-HDF/frahdfd60/frahdf.d052460.wpt:Som/Ois http://www.openstreetmap.org/?lat=49.610713&lon=2.68223
FRA-HDF/frahdfd60/frahdf.d055160.wpt:Ois/Ais http://www.openstreetmap.org/?lat=49.66569&lon=3.117859
FRA-HDF/frahdfd62/frahdf.d0015e262.wpt:PdC/Nor http://www.openstreetmap.org/?lat=50.118153&lon=3.0987
FRA-HDF/frahdfd62/frahdf.d024562cal.wpt:A16 http://www.openstreetmap.org/?lat=50.93631&lon=1.860337
FRA-HDF/frahdfd62/frahdf.d095462.wpt:PdC/Nor http://www.openstreetmap.org/?lat=50.48554&lon=3.017061
FRA-HDF/frahdfd80/frahdf.d007280.wpt:D6/D24 http://www.openstreetmap.org/?lat=49.946139&lon=3.10124
SWE/eure/swe.e45.wpt:+XA7 http://www.openstreetmap.org/?lat=65.847346&lon=19.45283
DEU-NW/eure/deunw.e314.wpt:NLD/DEU http://www.openstreetmap.org/?lat=50.818781&lon=6.02466
Thanks! I already found 2 manually today....
e.g.: FRA-GES/fragesm6ae/frages.m04006ae.wpt:A35 http://www.openstreetmap.org/?lat=48.524904&lon=7.66541
Maybe it's just 'cuz I'm still working on that first cup of coffee, but I don't see what this has to do with NMPs. NMPs are calculated by distance between points, and are unaffected by presence or absence of trailing zeros.
I usually open all files of the region and search for the coords - the full osm link. Since I brought in incomplete links, M400 wasn't found when I've realigned the A35 wp. M400's A35 wp and A35's 7 wp are NMPs now
I also search for coords, full OSM link, though using my OS's find files feature, or more often lately from the commandline using grep.
I think the popup should do:
This shouldn't be hard, and I hope to fix soon.
I think the fix you're looking for was as easy as I thought and is now on tmdevel.teresco.org - look like it solves the problem?
I just did the simple fix.
I'm think the cases of wpt lines with more than 6 digits should be handled separately. A quick program to read every wpt and write it back out with trailing 0's added and digits beyond 6 removed.
digits beyond 6 removed.
Sounds like truncation. Easier to do yes, though I'd prefer the precision of rounding. A program to change everything to 6 digits won't help those trying to search for a given URL in the canonical WPTs in the repo itself, IMO. If shortening the URLs bothers me that much... maybe I can change it myself? ;)
look like it solves the problem?
https://tmdevel.teresco.org/hb/showroute.php?r=me.me188&lat=45.18012753&lon=-68.36940336&zoom=14
https://travelmapping.net/hb/showroute.php?r=me.me188&lat=45.18012753&lon=-68.36940336&zoom=14
I think also doing a .tofixed(6)
on the coords themselves in the link text is counter-productive.
If a collaborator has http://www.openstreetmap.org/?lat=45.18012753&lon=-68.36940336
in one file and http://www.openstreetmap.org/?lat=45.180128&lon=-68.369403
in the other, there's no indication in the HB that the coords are different. A collaborator could end up saying "What the heck? The coords match, why do I have an NMP here?"
Leaving the coords at full precision (however the link address ends up notwithstanding) gives an indication the coords are different.
Yes, rounding not truncation if a program is going to go through and fix all of the too-long URLs.
I guess I'm not seeing why showroute would have any data with more that 6 digits after we fix them all and get them in the repository and in the DB, so it doesn't need to be a tool to find NMPs that result from extra digits in the data.
If we fix everything to 6 digits, sure, the repo won't have anything longer. But there's no guarantee more cases won't sneak in in the future. I don't think there should be any expectation that all collabs "fix" their URLs; 6 digits is only how everything has traditionally been formatted, not a requirement. While adding extra zeros to shorter URLs gives us the same coordinates, just with a different URL, removing zeros from a longer URL gives different coordinates from the point itself when copying the link. Beyond just NMPs, this can break intersecting/concurrent routes. For me at least, copying coords from the popup in the HB is my go-to when creating new routes.
All of us have to deal with the files manually. There is a high risk that non-6-digit-coords will appear again. It sometimes happens to me with the last digits of the file when I create a new file and remove the empty line at the end.....
Since there are still some hwy data managers who don't want their files being touched.... and those who only have their own local copy and would not apply the corrected files....
I think that we should just try to avoid anyone catching up an incomplete on showroute, wpt editor or anywhere else on the site.
Since there are still some hwy data managers who don't want their files being touched.... and those who only have their own local copy and would not apply the corrected files....
Also, ISTR someone somewhere sometime might have used the 7th decimal place to break concurrency detection.
Is what's now on tmdevel an improvement?
Is what's now on tmdevel an improvement?
No!
https://tmdevel.teresco.org/hb/showroute.php?r=fraara.d0001b01
The trailing zero is displayed in the info window of D1 but when you copy the link (context menu copy link) it is still missing: http://www.openstreetmap.org/?lat=46.38307&lon=4.883002
Wait, I thought we didn't want to change the link text.
I only care about what I can pick up.
I prefer:
I think maybe I now understand and maybe I now have something better on tmdevel.
OK, good. So as long as @michihdeu is ok with or at least I didn't break anything for him, I'll get this on the main site.
I've only checked https://tmdevel.teresco.org/hb/showroute.php?r=fraara.d0001b01 and it's fine. Thanks 👍
Live on the main site.
The coords link omits trailing zeros, rather than doing a
tofixed(6)
on both lat and lon. For example, https://travelmapping.net/hb/showroute.php?r=ns.ns105&lat=45.974516&lon=-61.12737&zoom=18 If the zero had been stripped from lat rather than lon, I wouldn't have found the WPT lines. At least, not as easily.The HDX behaves as desired.