Page 1 of 1

Recalculating high performance routing network

Posted: Fri Apr 14, 2023 12:56 pm
by igorb
Hello,

During implementation of xServer, we encountered an issue with recalculation of high-performance routing networks.

High-performance routing networks are created with PTV_SpeedPatterns and PTV_TrafficIncidents feature layers in the morning for several different TimeConsiderations throughout the day. We wish to update them during the day to account for possible traffic incidents.

When trying to recreate the high-performance routing network, it fails with the following error message: "A high-performance routing network with the requested profile parameter already exists and has been created by a user request already. Check the id field of this result limitations."

One possible solution is to delete the high-performance routing network in question before recreating it. However, ideally, we would like to avoid the downtime of not having a valid HPRN.

Another solution is to use different scopes. I would prefer to avoid using this as we would then need to store data about which scope to use when, what HPRNs are in which scope, and when the HPRNs with said scope were created.

Are there any other possible solutions?

Thank you and best regards,
Igor

Re: Recalculating high performance routing network

Posted: Fri Apr 14, 2023 1:20 pm
by Bernd Welter
Hi Igor,

from my perspective the following approach might cover your requirement... how about this?
  • Imagine to have a variable "currentScope" that is set to an initial value, e.g. "Scope N".
  • Now you know it is time to create new searchgraphs for a "scope N+1"
  • Write a procedure that creates all relevant info for the new scope (without a "does already exist" conflict)
  • at the end of the procedure you increase the variable currentScope to "scope n+1"
  • then you delete all data from the old "scope n"
  • and so on.
So as long as your "preparation for the next scope is in progress" your application still deals reading the "old scope".
It switches just when everything is ready to be used.

OK, maybe a bit "complicated" but at least thgis would cover what you need?
Or did I miss an aspect?

Bernd

Re: Recalculating high performance routing network

Posted: Fri Apr 14, 2023 3:25 pm
by igorb
Hi,

yes that is a possible solution, but still requires data persistance of said variable N, in order to know when we left on.
But if we expand on the principle:
  • we can have 2 scopes N and M
  • when creating new searchGraph, we check which scope has searchGraph in question
  • we create new searchGraph in opposite scope (N or M)
  • delete previus searchGraph
Then when we use searchGraph, we check both scopes and use the one that has the searchGraph.

Thank you for quick response :D

Igor

Re: Recalculating high performance routing network

Posted: Wed Apr 19, 2023 7:58 am
by Bernd Welter
HI Igor,

I like the way you are thinking ;-)
Switching instead of counting sound s ok to me.

Does this mean, the task is resolved?

Bernd

Re: Recalculating high performance routing network

Posted: Tue Apr 25, 2023 5:21 pm
by Maximilian Vogel
PTV_TrafficIncidents layers are dynamic data that gets updated every few minutes. There are different modes to run the content update service:
  • Continuously: New data replaces the existing data as soon as it is available.
  • On demand: A content update is triggered through a request by the user.
When the content updates are installed contiuously, there can be weird side effects when you create a HPR network in the morning but then use it a couple hours later, because the content of the traffic incidents might has changed and does not necessarily fit to the data inside the HPR network.

To deal with that content snapshots were introduced. With them you can persist the state of the PTV_TrafficIncidents layers. Afterwards, you can use this content snapshot to create a HPR network and of course to calculate routes or distance matrices.

Then you could also stay within one scope as each HPR network would use its own content snapshot. I currently do not see a possibility without managing some sort of state in your application as the xServer doesn't offer replacements of HPR networks.

Best regards,
Max