Speed load of screen when tracking amount car

Hi Everyone.
I want to tracking amount car on my map which was build by MapWinGis. I have referenced an example (https://www.mapwindow.org/documentation/mapwingis4.9/_track_cars_8cs-example.html). However, I am worrying about a problem is that loading speed of screen when I have to draw a lot of car. For instance 10,000- 20,000 cars. who have you already done about it, please give me some your experience.
thanks a lot.

I don’t know if anybody has tried using 10k-20k cars.
You could try using the example as a guide and just test and let us know.

When it is performing badly, we can have a closer look at your code if improvements are possible.
With so many cars other parts of your code will have an effect as well. Like how you get the data, how you display it, etc.

1 Like

Hello @tiennguyen

I agree with @pmeems. You will have to be smart about how you receive and cache your updates.

We have tracked cars, but in the dozens, not the thousands. Some of my advice would be

  1. If you have thousands of signals coming in from moving vehicles, don’t try to process that information and update your map with every individual movement. Instead, update the data in the background and only refresh the layer at fixed intervals (for example, every 10 seconds)
  2. If you can, use a separate application to keep up with your data; receiving the signals and updating the data, again, in the background.
  3. If you can, use an OGR datasource rather than a Shapefile; edits are faster, and reloading the layer from an OGR datasource is pretty fast, even with thousands of shapes.
  4. Don’t show the layer at all zoom levels, only show once you’re zoomed in enough to get meaningful data. This will minimize how many vehicles have to be drawn within the current view.

Regards,
Jerry.

1 Like

Thank for your advice. I have found a solution. I have drawn it based on an example following (https://www.mapwindow.org/documentation/mapwingis4.9/_tracking_8cs-example.html). Speed of screen is acceptable, however, there was a problem I did not how to select object( cars which was drawn by point or polygon not on shapefile). Could you recommend some suggestions.

Selecting drawing objects it not possible. You need a shape object for that.
Here’s an example: https://www.mapwindow.org/documentation/mapwingis4.9/_track_cars_8cs-example.html
With 20k cars this example might not work.
What you could do is create an in-memory shapefile on the fly with only the cars in your viewport.
When also limiting the zoom level you should only have to create up to 100 cars. That would still be quick. The you can select such a car.

Will that work for you?

Hi everyone,
I have the same need…
I am now approaching the MapWinGis control, and I too must represent a fleet of vehicles on the map.
I need to represent fewer vehicles but I could receive 4/5 GPS Position updates per second.
(possibly, to improve performance, I could perhaps save received GPS positions and update map only at intervals of 5/10 seconds).

I would like to represent the vehicles on the map with an icon or symbol or graphic font (or svg?) and, next to each vehicle, I would like to display a simple label (vehicle name only) or a complex label (multiline with date time and status).
I would also like the symbols and labels of the most recent positions to be above the symbols and labels of the older positions. So I need to change the “Features” ZOrder.

What is the most suitable MapWinGis object to do all this? Is it better to use a layer (as in the example TrackCars) or is it better to use DrawingLayer/DrawingLabels?

To give an example, to do this, other commercial components provide a “Tracking Layer”.

Another question, where can I find the shapefiles and images of TrackCars example?
Thank you

Dear mmjc23!

I have had the same problem with you. Finally, I have to find other solution. I can not do as an example (https://www.mapwindow.org/documentation/mapwingis4.9/_track_cars_8cs-example.html). Currently, I am using method which was use in following example (https://www.mapwindow.org/documentation/mapwingis4.9/_tracking_8cs-example.html), and my program run quite well.

I hope it will help you.

good luck for you

Vào Th 2, 16 thg 3, 2020 vào lúc 22:22 mmjc23 via MapWindow GIS mapwindow1@discoursemail.com đã viết:

Hi tiennguyen
and thank you very much for your reply.
Yes, I had read your solution above, but pmeems says that using the DrawingLayer, objects cannot be selected.
So … how do you move a vehicle when you receive a new GPS position from a vehicle? Do you clean the DrawingLayer and draw all the vehicles every time you receive a GPS Position?
And how do you place last position received on top?
Can you use icons and labels with the DrawingLayer?

Thank you
Best regards

Dear mmjc23.

It was correct when
pmeems say that objects cannot be selected. However, I solve this problem by other method. I calculate min distance between coordinate of mouse and coordinate of vehicles in list. A vehicle was selected when distance less epsilon (option).

As you think I clean the DrawingLayer and draw all the vehicles every time you receive a GPS Position. However, I also use some tips which pmeems suggest to me. For example, I update new data into list (which manage list vehicle) whenever sensors send to new data, but I only draw it on map via to other timer. Note that, this timer can be bigger such as N ms (10 ms or 1000 ms or 1s). Because I think you do not need draw immediately when you update data from sensors.

Good luck for you

Vào Th 3, 17 thg 3, 2020 vào lúc 14:10 mmjc23 via MapWindow GIS mapwindow1@discoursemail.com đã viết:

Dear tiennguyen,
Thank you so much for your answer.
I have to improve Map performances and functionalities of my Radio Dispatcher VB.Net application. So I have to (quickly) replace the old ESRI MapObjects control with a new, and advanced Map control.
I think that clear and redraw the DrawingLayer every time I receive a GPS Position (or at intervals of N seconds) is not an improvement.
Also, there is no Layer Legend, it does not display my ECW files and it seems that I cannot use my ico files to represent vehicles (png files only).
I would not like to have other problems and have no support to solve them in the future.
To speed up development, I’m thinking of switching to commercial components such as TatukGis (simpler) or Thinkgeo (more complicated).
I will do further tests with the TrackCars example…I would not like to abandon MapWinGis, because it seems to me that it is very advanced and complete (Thanks a lot developers!).
Thank you so much for your help…and for your time tiennguyen.
Have a good evening

1 Like

Hi ,but doesnt selecting cars using this method affect performance since you have to loop over all the cars in the list ,thus increase the complexity of the application.