Travel Mapping

Web Design Discussion => General Web Design Discussion => Topic started by: Jim on June 05, 2020, 04:18:43 pm

Title: Mapview rte= functionality
Post by: Jim on June 05, 2020, 04:18:43 pm
I'm busy converting all existing Mapview functionality to use the new underlying engine developed for the scrollable Mapview that's now available.  I'm hoping it's going to knock off some things that have been on wish lists for years and maybe even introduce some new useful functionality you might not have thought about.

For things like combinations of rg= and sys= QS parameters, it's easy enough and I plan to match existing functionality.  rg= alone shows all routes in the given region(s),  sys= alone shows all routes in the given system(s), and rg= and sys= together shows all routes in the regions that are in the systems.  These are used in links from various places on the site.

The country= parameter can replace or supplement the rg= parameter, and all regions of the given country are added to the region list before processing, and we can still restrict by systems, optionally.  I intend to maintain this, even though it invites massive queries that are likely to lead to long load times and overburdened map navigation.  But if you want it, it should be there.

The rte= parameter is a little more strange.  As pointed out in some recent discussions here and/or in GitHub Issues, the rte= parameter alone gives all "related" routes that use that as the "route" field in the routes table, ignoring banner, abbrev, and city.  So if you specify rte=I-90, you not only get all of the regional segments of mainline I-90 from usai, but you all get each of the business loops and spurs in usaib.  That seems like a reasonable feature and would not be hard to continue to provide.  However, we also use it to generate some links to mapview such as rte=I-84&sys=usai, which I believe are intended to show all segments of a connected route.  However, as this parameter gives no information about which connected route if there is more than one with the same "route" field, it just shows all.  Those interested can see the discussion in https://github.com/TravelMapping/Web/issues/101 .  I propose that we either disallow the system restriction  in Mapview altogether or leave the functionality as-is, but provide true connected route capabilities in an improved version of the HB (see: https://github.com/TravelMapping/Web/issues/421 ).

I'm bringing this last issue to the forum to try to get some wider feedback on it.
Title: Re: Mapview rte= functionality
Post by: yakra on June 05, 2020, 04:54:41 pm
I find the system restriction useful, and use it pretty frequently.
Let's leave the functionality as-is, and provide true connected route capabilities in an improved version of the HB.

Thoughts on a banner= parameter?
Title: Re: Mapview rte= functionality
Post by: si404 on June 05, 2020, 05:54:37 pm
So if you specify rte=I-90, you not only get all of the regional segments of mainline I-90 from usai, but you all get each of the business loops and spurs in usaib.  That seems like a reasonable feature and would not be hard to continue to provide.
That's useful. rte=A1 and similar isn't so much.

The I-90 business routes are related to I-90. A1 (http://travelmapping.net/user/mapview.php?units=miles&u=si404&rte=A1) gives you 41 different actual A1 routes (some consisting of several segments and related routes themselves): Albania, Australia, Austria, Belgium, Botswana, Bulgaria, Bosnia, Croatia, Cyprus, France, Gabon, Germany, Great Britain, Greece, Isle of Man, Italy, Jamaica, Jersey, Kazakhstan, Kenya, Latvia, Lesotho, Lithuania, Luxembourg, Martinique, Morocco, Mauritius, Namibia, Netherlands, Northern Ireland, North Macedonia, Poland, Portugal, Romania, Senegal, Serbia, Slovenia, Spain, Sri Lanka, Switzerland and Tunisia. And also two that aren't: Florida's FLA1A and Massachusetts' MA1A.
Title: Re: Mapview rte= functionality
Post by: yakra on June 05, 2020, 06:34:49 pm
And also two that aren't: Florida's FLA1A and Massachusetts' MA1A.
Is there a way to replicate the '^' functionality of a Un*x regex?
Title: Re: Mapview rte= functionality
Post by: yakra on June 05, 2020, 10:37:20 pm
The I-90 business routes are related to I-90. A1 gives you 41 different actual A1 routes
One way to make the "Related Routes" link from the HB immensely more useful would be to add a sys= restriction to the mapview URL, E.G.
http://travelmapping.net/user/mapview.php?rte=A1&sys=alba
http://travelmapping.net/user/mapview.php?rte=A1&sys=bela
http://travelmapping.net/user/mapview.php?rte=A1&sys=bgra
http://travelmapping.net/user/mapview.php?rte=A1&sys=cypa
http://travelmapping.net/user/mapview.php?rte=A1&sys=fraa
http://travelmapping.net/user/mapview.php?rte=A1&sys=deua
http://travelmapping.net/user/mapview.php?rte=A1&sys=gbna
http://travelmapping.net/user/mapview.php?rte=A1&sys=grca
http://travelmapping.net/user/mapview.php?rte=A1&sys=imna
http://travelmapping.net/user/mapview.php?rte=A1&sys=itaa
http://travelmapping.net/user/mapview.php?rte=A1&sys=jama
http://travelmapping.net/user/mapview.php?rte=A1&sys=ltua
http://travelmapping.net/user/mapview.php?rte=A1&sys=luxa
http://travelmapping.net/user/mapview.php?rte=A1&sys=mtqa
http://travelmapping.net/user/mapview.php?rte=A1&sys=nlda
http://travelmapping.net/user/mapview.php?rte=A1&sys=nira
http://travelmapping.net/user/mapview.php?rte=A1&sys=pola
http://travelmapping.net/user/mapview.php?rte=A1&sys=prta
http://travelmapping.net/user/mapview.php?rte=A1&sys=roua
http://travelmapping.net/user/mapview.php?rte=A1&sys=espa
http://travelmapping.net/user/mapview.php?rte=A1&sys=chea
http://travelmapping.net/user/mapview.php?rte=A1&sys=tuna

etc.
Title: Re: Mapview rte= functionality
Post by: si404 on June 06, 2020, 03:53:55 am
One way to make the "Related Routes" link from the HB immensely more useful would be to add a sys= restriction to the mapview URL, E.G.
Sure, though my main problem is that FLA1A and MA1A are in.

And if you default to the system, you'd want the bannered routes as well - which makes the code more complex.
Title: Re: Mapview rte= functionality
Post by: yakra on June 06, 2020, 01:22:31 pm
Thus we would want to search for the relevant string at the beginning of the route name, rather than anywhere within it. This is what the ^ character does in a Un*x regex.
Title: Re: Mapview rte= functionality
Post by: Jim on June 06, 2020, 02:27:15 pm
It wasn't my code in the original rte= support, but the current code achieves its results with this as part of its SQL query:

https://github.com/TravelMapping/Web/blob/028605b8e4b1dfd1ef3877bb1076eaa19d9c036b/user/mapview.php#L273-L274
Title: Re: Mapview rte= functionality
Post by: Jim on June 07, 2020, 09:09:07 am
I am not seeing any reason we need all the regex stuff here.  As I have implemented it in the new Mapview, rte= requires an exact match in the routes.route field.  And you can optionally restrict to one or more systems with sys=.

Those interested in this functionality, please give it a try, and let me know if it behaves as you expect.  Keep in mind there is nothing done at this point to restrict to only the same connected route.
Title: Re: Mapview rte= functionality
Post by: yakra on June 07, 2020, 11:28:27 am
So if you specify rte=I-90, you not only get all of the regional segments of mainline I-90 from usai, but you all get each of the business loops and spurs in usaib.  That seems like a reasonable feature and would not be hard to continue to provide.
I am not seeing any reason we need all the regex stuff here.  As I have implemented it in the new Mapview, rte= requires an exact match in the routes.route field.  And you can optionally restrict to one or more systems with sys=.
How about letter-suffixed children, such as ME4A, NY17*, etc?

Those interested in this functionality, please give it a try, and let me know if it behaves as you expect.  Keep in mind there is nothing done at this point to restrict to only the same connected route.
http://tmtest.teresco.org/user/mapview.php?units=miles&rte=NY17 has vanilla NY17 and PA NY17SWa panned off the west edge of the map. The westernmost bits of NY17Bin are also clipped; +X101 (http://www.openstreetmap.org/?lat=42.009637&lon=-76.460810) is at or just off the W edge of the map. I still need to zoom out one level to fit all NY17 segments within the viewport. 1680x1050 display.
Title: Re: Mapview rte= functionality
Post by: Jim on June 07, 2020, 12:13:19 pm
So if you specify rte=I-90, you not only get all of the regional segments of mainline I-90 from usai, but you all get each of the business loops and spurs in usaib.  That seems like a reasonable feature and would not be hard to continue to provide.
I am not seeing any reason we need all the regex stuff here.  As I have implemented it in the new Mapview, rte= requires an exact match in the routes.route field.  And you can optionally restrict to one or more systems with sys=.
How about letter-suffixed children, such as ME4A, NY17*, etc?

I would consider them separate routes entirely unless they're bannered versions with the same route.  Adding them seems to invite potentially-unintended/unrelated inclusions.

If we want such functionality, maybe it's better with some sort of separate "rp=" (for "route pattern") where you specify whatever regex you want, and it just gets passed along.

Quote
Those interested in this functionality, please give it a try, and let me know if it behaves as you expect.  Keep in mind there is nothing done at this point to restrict to only the same connected route.
http://tmtest.teresco.org/user/mapview.php?units=miles&rte=NY17 has vanilla NY17 and PA NY17SWa panned off the west edge of the map. The westernmost bits of NY17Bin are also clipped; +X101 (http://www.openstreetmap.org/?lat=42.009637&lon=-76.460810) is at or just off the W edge of the map. I still need to zoom out one level to fit all NY17 segments within the viewport. 1680x1050 display.

That seems to happen in various situations, and I'm stumped.  Try rg=CT,RI and western CT might be off the screen for you, as it is for me.  I must not be including something in the bounding box computation to send to the map's fitBounds method, but I can't find it.
Title: Re: Mapview rte= functionality
Post by: yakra on June 07, 2020, 08:04:07 pm
I would consider them separate routes entirely unless they're bannered versions with the same route.
My first thought was that of the Related Routes feature shows child routes in the form of bannered routes, then similarly including letter-suffixed routes for systems that don't or rarely use banners (e.g. usanh) would be a good thing.

Adding them seems to invite potentially-unintended/unrelated inclusions.
A little exploring...
Code: [Select]
cat `ls | grep -v '_con\.csv$'` | cut -f3 -d';' | sort | uniq > ~/uniqrtes.txt
for rte in `cat ~/uniqrtes.txt`; do egrep "^$rte[A-Za-z]+$" ~/uniqrtes.txt | sed "s~^~$rte;~"; done | tee ~/letter_suffixes.csv
grep -v '[0-9]' ~/letter_suffixes.csv | less
...forces me to concede this point.
For instance, there are a few cases of routes using Roman numerals, and then a big chunk of the idnjt system.

If it's important to have similar behavior, maybe require that banners match?

If we want such functionality, maybe it's better with some sort of separate "rp=" (for "route pattern") where you specify whatever regex you want, and it just gets passed along.
I'll stop short of saying I want this.

Try rg=CT,RI and western CT might be off the screen for you, as it is for me.
Yep. I'm getting the same thing.
Title: Re: Mapview rte= functionality
Post by: Jim on June 07, 2020, 10:40:50 pm
That seems to happen in various situations, and I'm stumped.  Try rg=CT,RI and western CT might be off the screen for you, as it is for me.  I must not be including something in the bounding box computation to send to the map's fitBounds method, but I can't find it.

Found my dumb copy-and-paste-but-only-partially-modify error.  Looks like the bounds are now set properly.
Title: Re: Mapview rte= functionality
Post by: michih on June 26, 2020, 02:05:26 pm
Is anything open or can the topic be marked solved?
Title: Re: Mapview rte= functionality
Post by: Jim on June 26, 2020, 03:01:56 pm
I think existing Issues related probably cover it. 
Title: Re: Mapview rte= functionality
Post by: froggie on October 14, 2022, 09:00:03 am
Resurrecting this thread because I feel some improvements to the Mapview menu would be helpful.  When choosing which regions to show, the menu only shows 4.5 options...with how many regions we have, that requires a lot of scrolling through the menu.  Furthermore, my middle mousewheel doesn't scroll the menu but scrolls the underlying map, so that's useless when trying to select regions.  Is there any way to improve this given how it's coded?
Title: Re: Mapview rte= functionality
Post by: Jim on October 14, 2022, 09:20:58 am
I never noticed how the "wheel" functionality scrolls the map.  I am not sure how to get the overlay window to process those events so it would scroll the lists instead.

I guess a bigger questions is if and how people use the region and system lists on that mapview overlay window.  I am not sure I ever have since I first was testing this a couple years ago.  Sounds like we have at least one user, though.  Do you select multiple regions?  Multiple non-adjacent regions?  Would it be better to have a separate popup window of some kind that let you use checkboxes, or a window where you could move regions back and forth between selected and unselected lists?

Title: Re: Mapview rte= functionality
Post by: froggie on October 14, 2022, 10:16:20 am
When I use it (as an aid in trip planning), I usually use multiple adjacent regions.  For example NY, NJ, PA, MD.

Not sure what the best method would be.  Open to suggestion.  Just wanted to point out that the current process is a PITA to select multiple regions.
Title: Re: Mapview rte= functionality
Post by: Jim on October 14, 2022, 10:45:30 am
When I use it (as an aid in trip planning), I usually use multiple adjacent regions.  For example NY, NJ, PA, MD.

Not sure what the best method would be.  Open to suggestion.  Just wanted to point out that the current process is a PITA to select multiple regions.

Agreed!  My own workaround is a lot of URL editing.  Not a great solution.
Title: Re: Mapview rte= functionality
Post by: michih on October 14, 2022, 12:58:10 pm
When I use it (as an aid in trip planning), I usually use multiple adjacent regions.  For example NY, NJ, PA, MD.

Not sure what the best method would be.  Open to suggestion.  Just wanted to point out that the current process is a PITA to select multiple regions.

You might open mapview for NY, scroll out to see your whole travel area, enable the "Always Update Visible Routes" option, wait till loaded, disable the option again*. Zoom in and out like you want.

*If you keep the option checked, it will be annoying when zooming out.

Agreed!  My own workaround is a lot of URL editing.  Not a great solution.

Me too! Works fine to me.
Title: Re: Mapview rte= functionality
Post by: Jim on October 14, 2022, 03:51:10 pm
You might open mapview for NY, scroll out to see your whole travel area, enable the "Always Update Visible Routes" option, wait till loaded, disable the option again*. Zoom in and out like you want.

*If you keep the option checked, it will be annoying when zooming out.

This is pretty much what I do, but I don't start with a region.  I just use "Find Place" to start at a place in the area I'm traveling, uncheck the update box, pan and zoom to the area I want to see, check the update box, let it load, uncheck the update box, then pan and zoom all I want with no further loading and rendering delays.