Solved

Fill gaps in GPS track lines

  • 23 August 2019
  • 2 replies
  • 18 views

Badge

I have some vehicle GPS tracking lines. The lines have gaps in them. I want to join the lines.

The data is ordered and categorised so I can use a Chopper to chop the lines into vertices and then a LineBuilder with "Group By" set to the vehicle Type and "Group By Mode" set to "Process When Group Changes" to rebuild the lines with gaps joined.

However, in the source, consecutive lines may be a different vehicle of the same Type (I can see they are different vehicles but there is nothing in the data to differentiate individual vehicles), so I get unwanted connections.

There are two methods I could use to prevent most of these unwanted connections:

  • if the distance to the next line is too far do not create a connection
  • the source data contains start and finish times for each track, so if the finish time of the current line is after the start time of the next one, do not create a connection

But I'm not sure how to do either of these - can anyone help?

icon

Best answer by redgeographics 23 August 2019, 11:59

View original

2 replies

Userlevel 5
Badge +25

I would look into the 2nd option first. In the AttributeManager, using the Adjacent Features option, you can set up a conditional value to fill a "vehicle id" attribute based upon the difference between the end time of one segment and start time of the next: if the next start is before the current finish or there is a big difference between them you can create a new vehicle id and then use that in the LineBuilder.

Badge

I would look into the 2nd option first. In the AttributeManager, using the Adjacent Features option, you can set up a conditional value to fill a "vehicle id" attribute based upon the difference between the end time of one segment and start time of the next: if the next start is before the current finish or there is a big difference between them you can create a new vehicle id and then use that in the LineBuilder.

That's great, thank you, was not familiar with that functionality - I'm half way there - now to see what I can do about the distance...

...which is actually dead easy using the same method.

Reply