Page 1 of 1

Traffic jam updates not refreshing properly in Map

Posted: Fri Jun 12, 2020 5:19 am
by nirengp
Hello,

We are displaying Traffic updates with PTV_TrafficIncidents layer in xMap.
And on our PTV xServer Content Update Service is configured to update traffic data every 15 minutes.

In our map traffic jam is displayed:
Traffic_display.png
After some time when traffic jam clears away map is displayed:
AfterNoTraffic_display.png
So as you can see, the traffic jam symbols are gone when traffic jam clears up, however red marker is till show in the Map. And this traffic jam marker does not go way from Map. After the Map is closed and opened again then clear map is displayed.

So questions are:
1) Why the traffic jam red marker not going away on it's own. Do we have to do some kind of refresh to remove it?
2) Does the Ptv.XServer.Controls.Map.Map class refresh traffic data automatically or do we have to implement refresh logic on our own?

Any guidance will be appreciated.

Thanks

Re: Traffic jam updates not refreshing properly in Map

Posted: Fri Jun 12, 2020 7:02 am
by Bernd Welter
Hello NIren,

I am not sure
- whether this is a bug in the xServer.NET or the FeatureLayer implementation
- an improper application code

I therefore created a task (MPXSRV-4405) for this.

Best regards,
Bernd

Re: Traffic jam updates not refreshing properly in Map

Posted: Fri Jun 12, 2020 7:44 am
by Oliver Heilig
This looks more like a refresh problem on the client. The background-tiles (lines) are stored in-memory, and it doesn't seem to refresh.

Assuming you are using the implementation for xserver-1 from the sample "FeatureLayers" here https://github.com/ptv-logistics/xserver.net-samples

* Do you call presenter.RefreshMap()?
* Do you set the referenceTime for the FeatureLayer? This is important, because this would also be used to calculate the cache-id.
* Another option would be to disable the in-memory cache at startup of your application with Ptv.XServer.Controls.Map.GlobalOptions.TileCacheSize = 0;

Oli

Re: Traffic jam updates not refreshing properly in Map

Posted: Sat Jun 13, 2020 4:38 am
by nirengp
Hello Oliver / Bernd,

Thanks for the details.

* We are not specifically calling presenter.RefreshMap().
* We have not set the referenceTime for the FeatureLayer.
* After disabling the in-memory cache with Ptv.XServer.Controls.Map.GlobalOptions.TileCacheSize = 0, the map is refreshing traffic details correctly.

So now, question is should we keep in-memory cache disabled permanently or is their better option to configure cache more efficiently, so that in-memory cache can still be used. I am guessing in-memory cache is used to improve efficiency of map tile display.

I was checking FeatureLayers class properties. However, have not understood the correct usage of ReferenceTime, ShowOnlyRelevantByTime and TimeConsiderationScenario. Also, checked Xmap2LayerFactoryTest.

As per what I understood,
1) Value set for TimeConsiderationScenario & TimeSpan will determine at which duration the cache will be refreshed automatically. However how does OptimisticTimeConsideration, SnapshotTimeConsideration and TimeSpanConsideration work is not clear.
2) If we set the ReferenceTime to the time Map was loaded and ShowOnlyRelevantByTime = true the cache will be refreshed automatically at some fixed interval.

Can setting some or all of these properties allow to make cache usage more efficiently and still the map get's refreshed correctly. Please correct my understanding and guide how they should be configured.

Thanks

Re: Traffic jam updates not refreshing properly in Map

Posted: Sat Jun 13, 2020 3:30 pm
by Oliver Heilig
Hello Niren,

the methods you mention refer on xMapserver-2, your screenshots indicate you are using xMapServer-1.

The reference implementation in https://github.com/ptv-logistics/xserver.net-samples

xserver-1: FeatureLayers
xserver-2: Xmap2LayerFactoryTest

For xmap-1 to update the FeatureLayer for the current time, you have to set referenceTime to DateTime.Now time and call refresh, like here https://github.com/ptv-logistics/xserve ... cs#L53-L61 It doesn't update automatically (you could trigger it by a timer though).

Please verify:

* Which xServer are you using, xserver-1 or xserver-2?
* Do you use xserver on premise or xserver-internet?

Re: Traffic jam updates not refreshing properly in Map

Posted: Mon Jun 15, 2020 4:50 am
by nirengp
Hello Oli,

Thanks for the details.

And you are right, we are using XServer-1 on premise.
So we will implement timer to refresh traffic details as per the reference implementation in sample.

Thanks.