xRoute > Response > Visualize

This forum covers all questions dealing with visualization of data within the native PTV xMap interface. Please remember that additional plugins such as AJAX or Leaflet may be handeled in other forums.

xRoute > Response > Visualize

Postby Max Beermann » Tue Nov 20, 2018 12:01 pm

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
User avatar
Max Beermann
 
Posts: 36
Joined: Tue Oct 30, 2018 7:36 am

Re: xRoute > Response > Visualize

Postby Bernd Welter » Thu Nov 22, 2018 2:53 pm

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
Bernd Welter
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1335
Joined: Mon Apr 14, 2014 10:28 am

Re: xRoute > Response > Visualize

Postby Max Beermann » Sat Nov 24, 2018 8:51 am

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
User avatar
Max Beermann
 
Posts: 36
Joined: Tue Oct 30, 2018 7:36 am

Re: xRoute > Response > Visualize

Postby Max Beermann » Mon Dec 03, 2018 6:05 pm

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
User avatar
Max Beermann
 
Posts: 36
Joined: Tue Oct 30, 2018 7:36 am

Re: xRoute > Response > Visualize

Postby Joost » Fri Dec 07, 2018 9:43 am

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.
Joost Claessen
Senior Technical Consultant
PTV Benelux
Joost
 
Posts: 232
Joined: Fri Apr 25, 2014 1:46 pm

Re: xRoute > Response > Visualize

Postby Bernd Welter » Tue Dec 11, 2018 4:07 pm

Thanks for answering, Joost!
And Max: no, not unclear. Just too much input in my queue ;-)
Bernd Welter
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1335
Joined: Mon Apr 14, 2014 10:28 am

Re: xRoute > Response > Visualize

Postby Max Beermann » Fri Dec 21, 2018 12:53 pm

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
User avatar
Max Beermann
 
Posts: 36
Joined: Tue Oct 30, 2018 7:36 am

Re: xRoute > Response > Visualize

Postby Max Beermann » Fri Jan 04, 2019 4:01 pm

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
User avatar
Max Beermann
 
Posts: 36
Joined: Tue Oct 30, 2018 7:36 am


Return to PTV xMapServer

cron