Page 1 of 1
xRoute > Response > Visualize
Posted: Tue Nov 20, 2018 12:01 pm
by Max Beermann
Hello Bernd,
i have one (further) question/thought.
I am calculating routes by using xRoute within my own user-Interface.
Each tour (request) results in defined parameters (response).
As far - as good > this works already really well.
Now i want to visualize the response (tour) by clicking e. g. on a link/shortcut;
similar to RawRequestRunner/Visualize JSON message.
Start ____________________End _______________Km_____ Toll ________Routing
D-45888 Gelsenkirchen_____ D-72202 Nagold _____473_____ 46,77 € ______Link / Shortcut
Is it possible to save (a local) image for each succeeded request?
Or is it even possible to use an URL (e. g. each succeeded request gets an ID)?
Or do you have any (other) ideas how "to reach this goal"?
I'm looking forward to the feedback - Thanks in advance!
Best regards
Max Beermann
Re: xRoute > Response > Visualize
Posted: Thu Nov 22, 2018 2:53 pm
by Bernd Welter
Hello Max,
all the approaches you described seem to be meaningful. It depends on the requirements of the user as a whole.
For example you could store the routing geometry in a database and retrieve it later (without recomputing it) for visualizing it in a map interface.
Storing the image is probably the approach with the lowest amount of efforts but - no wonder - the one that is least flexible, too. (e.g. no interaction with the map)
I'm aware of customers who store not the geometry but the "parameters" of a route (waypoint coordinates + profile name) and recompute it if needed.
What do you need to be "ok" with the topic?
Best regards,
Bernd
Re: xRoute > Response > Visualize
Posted: Sat Nov 24, 2018 8:51 am
by Max Beermann
Hello Bernd,
each of them sound more than ok. But the third (store parameters) would be perfect.
- Especially because my xRoute-response contains routing-parameters like "avoid-countries", "speed-profile", etc.
Suppose I store my parameters (e. g. xroute-request) as a "big string".
Is it possible to create a new response (based on the big-string), which shows the corresponding routing in the map (new request)?
- At best, the user presses on a link / button, which then shows him the result (e.g. in a new browser window).
Many thanks in advance again.
I appreciate it.
Best regards
MBE
Re: xRoute > Response > Visualize
Posted: Mon Dec 03, 2018 6:05 pm
by Max Beermann
Hello Bernd,
is my thought too "unclear"?
Please let me know > I will try to make it clear.
Thanks in advance for your feedback.
Best regards
Max Beermann
Re: xRoute > Response > Visualize
Posted: Fri Dec 07, 2018 9:43 am
by Joost
If you want to store parameters and actually recreate the route: I would recommend that you confine all parameter to the profile snippet so that you only have to store the coordinates of the way-points and the profile snippet string in a database. Currently we do not have an out of the box sample for this.
As for creating a web page that shows the route: i would recommend to create a template for a page that shows a map using the leaflet map control. The page can then retrieve the needed the data from the database , calculate the route and display it. For a concept of this have look at
http://176.95.37.46/samplebrowser/#samp ... aflet/view . you can hit the edit button to view the sample code behind the page.
The sample uses left mouse clicks for generating input coordinates, you should replace that by a function that get's the information out of the database. I don't have a best practice example for this.
A slight alternative is that you keep all the calculation part in the middleware and only pass the line from the result to the page to draw.
Re: xRoute > Response > Visualize
Posted: Tue Dec 11, 2018 4:07 pm
by Bernd Welter
Thanks for answering, Joost!
And Max: no, not unclear. Just too much input in my queue
Re: xRoute > Response > Visualize
Posted: Fri Dec 21, 2018 12:53 pm
by Max Beermann
Thank you very much- Joost & Bernd.
So I think I will have a new task for 2019 : )
I will let you know if/when I finished it.
Happy Christmas and Happy New Year (to all of you)!
Max Beermann
Re: xRoute > Response > Visualize
Posted: Fri Jan 04, 2019 4:01 pm
by Max Beermann
Hey Bernd & Joost,
task is already finished!
I create a html for leaflet, which includes the polyline of the xRoute-response.
Works great!
Thanks for your help and motivation
Max