2

I map matched a sequence of GPS-points to a road network using the Offline-Map Matching plugin for QGIS. This map matched trajectory passes certain roads segments multiple times (for example, the selected red matched trajectory segment in the picture below has two unique fid numbers, 60 and 359, see left).

example

In the picture below, only trajectory with fid 60 is selected. As you can see, these trajectory segments are generated between two consecutive GPS points.

enter image description here

In order to visualise where most vehicle activity occurred in the network (with the line thickness/size being proportional to the number of overlapping map matched trajectories), I need to analyse the number of overlapping map-matched trajectories per road link in the road network.

I have tried several things but unfortunately without success. Any ideas on how to do this in QGIS?

1 Answer 1

1

You should use aggregate to get results from another layer.

aggregate( 
 layer:= 'MatchedTrajectories',
 aggregate:= 'count',
 expression:= "id",
filter:= intersects($geometry, geometry(@parent)))
2
  • That doesn't work unfortunately. It results in way too many counts per road segment
    – winecity
    Mar 31, 2020 at 8:33
  • @winecity: Then you have to experiment with the filter. You can use other predicates like overlaps, cover, within, etc. It was not clear in your question how you want to count the trajectories
    – PieterB
    Apr 1, 2020 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.