Skip to main content

I am looking to take a point feature class that acquires a GPS location from our Utility trucks every 15 seconds and create routes driven based upon historical data. End goal is I would like to build a polyline feature class to reduce the amount of data that I am publishing to our Portal to improve the performance of querying data, as we are acquiring approximately 2.5-3 million points within a 30 day span.

Below is an example of the data being received.

Here is what the data means:

Vehicle is Offline = IsIdle - 0 & GpsActive - 0

Vehicle is active but in a Idle State = IsIdle - 1 & GpsActive - 1

Vehicle is Actively Moving = IsIdle - 0 & GpsActive - 1

The part I am getting stumped on is how I can define routes driven. In the example above, there would have been 2 routes driven. The first route would be from

to

 

and the second route being

to

Below is an example of where I would like to take the data, with the addition of some sort of RouteID field.

Any help is greatly appreciated.

Dave

Could you share a sample CSV file, so we can have a try at this fun challenge?


Could you share a sample CSV file, so we can have a try at this fun challenge?

Vehicle Historical Routing.csv

Here's a small sample set.


You should be able to use adjacent attribute handling to set the route id. I'm presuming you would just need to start at 1 and then increment that number every time the gpsactive field changes to 0?

 

gpsroute.fmwt


I have created a FME workspace (FME 2019) that creates the 13 lines from the sample.

The workspace looks like this:

 

This is the output (in the Data Inspector):

The workspace is attached here route.fmw

Hope this helps.


You should be able to use adjacent attribute handling to set the route id. I'm presuming you would just need to start at 1 and then increment that number every time the gpsactive field changes to 0?

 

gpsroute.fmwt

Solid response and that was way easier than I was anticipating.


You should be able to use adjacent attribute handling to set the route id. I'm presuming you would just need to start at 1 and then increment that number every time the gpsactive field changes to 0?

 

gpsroute.fmwt

This seems to work great. The only issue I am seeing now is that for each vehicle, which I have around 100 total. Not all vehicle RouteID's start at 1.

You should be able to use adjacent attribute handling to set the route id. I'm presuming you would just need to start at 1 and then increment that number every time the gpsactive field changes to 0?

 

gpsroute.fmwt

@egomm Do you know how I can get the start and stop sequence to start at 1 for each vehicle based off of the field "VehicleID"? I've attached a larger list for you to view.

 

Vehicle Export.csv


@egomm Do you know how I can get the start and stop sequence to start at 1 for each vehicle based off of the field "VehicleID"? I've attached a larger list for you to view.

 

Vehicle Export.csv

You can add an extra condition in the attributecreator that will set the routeID back to 1 for each vehicle, you'll need to ensure that the the data is sorted by vehicle first, then gpstime for this to work correctly


Reply