Skip to main content

Hello Guys

need your support with this case

we are getting car position from streaming data 30 thousand points every 30 seconds, we use time windower to get the position of each car every 5 min, then we use a filter to check if this car entered the delivery zone,

what we are looking for is to store the event when the car gets in and when it gets out and we have to store only one record for each event

this event will be stored in the database as follow

 

Crad_id start_time End_time Status

TK256 14:20 14:35 within

when we store the event in the database the first time there will be no end time since the car is still within the delivery zone as soon as it gets out we will update the end time

Any Suggestions

we want to achieve something similar to this connector

Thanks

Is this real time processing using FME server or post processing? Because this is posted in FME Desktop.

If real time, sorry, no experience.

If postprocessing, read the points from a database with a FeatureReader using the delivery zones as input features / spatial filters. Then sort on time followed by samplers for first and last point.


Is this real time processing using FME server or post processing? Because this is posted in FME Desktop.

If real time, sorry, no experience.

If postprocessing, read the points from a database with a FeatureReader using the delivery zones as input features / spatial filters. Then sort on time followed by samplers for first and last point.

@nielsgerrits​ 

thanks for your response, well its post-processing for now

if we do first and last for each period we will have will have one record for each period , our goal is to reduce the number of records and store only one for each event , when its happened but we need to start the start and the end date


@nielsgerrits​ 

thanks for your response, well its post-processing for now

if we do first and last for each period we will have will have one record for each period , our goal is to reduce the number of records and store only one for each event , when its happened but we need to start the start and the end date

Rename the datetime attribute from the sampler outputting the first feature to start, the datetime attribute from the sampler outputting the last feature to end, merge both features in one using an Aggregator, set to merge attributes.

 

Samplers and Aggregator group by car id to get a single record for each car.


@nielsgerrits​ 

thanks for your response, well its post-processing for now

if we do first and last for each period we will have will have one record for each period , our goal is to reduce the number of records and store only one for each event , when its happened but we need to start the start and the end date

@nielsgerrits​ 

Thanks again for your support

Let me give more details on the case

 

as you can see in the picture below there 2 cars both, are streaming their position in real time we need to start an event when the car enters a zone and end the event when the car exit a zone we should create an event Id and start and end time of the event

I am attaching sample data if that helps

imageThe data stream keeps flowing with no end

Thanks

 

 

 


@nielsgerrits​ 

thanks for your response, well its post-processing for now

if we do first and last for each period we will have will have one record for each period , our goal is to reduce the number of records and store only one for each event , when its happened but we need to start the start and the end date

Hi @boubcher​ ,

We have a video on geofencing streamed data on our YouTube channel here and more example here in the Community.

 

If you've already solved that part, and just need to flatten the data into single records, the attached workspace may help with your downstream processing. It uses your sample csv data as input and a basic SQLite DB with a single Positions table you can create in FME. A StatisticsCalculator is used to get the first IN and last OUT record for each vehicle event in the window. These are then flattened into a single record using the FeatureJoiner. From there, it handles the scenarios of:

  • a vehicle entering and exiting the zone in the same window: create a record with both timestamps
  • a vehicle entering the zone, but not exiting: create record with Time In only
  • a vehicle exiting the zone that entered in a prior window: update existing record and add Time Out

Hope this helps!

 


Reply