[Mobilitydb-users] MobiltyDB for Windows

Mahmoud SAKR mahmoud.sakr at ulb.ac.be
Tue Aug 31 07:46:40 PDT 2021


Dear Alan

I am adding the mailing list
http://lists.osgeo.org/mailman/listinfo/mobilitydb-users, so the discussion
is also available to the community. You are welcome to subscribe and post
questions there.

I understand that you got a sequence of (location, timestamp) pairs, from
which you want to construct a trajectory. But you want to split into
multiple trajectories whenever there is a big gap (in time or in distance)
between two consecutive points.

Enclosed is an SQL function to do this.

The function takes an array of points and an array of timestamps as the
first two parameters (they should be in the same order). The last two
parameters are a distance and an interval thresholds (which are application
dependent) for deciding whether two consecutive observations belong to the
same trip or not. The function produces a sequenceset object which is a
trajectory possibly with multiple gaps. If you prefer to have them separate
you can break the sequenceset into multiple sequence by applying the
functions unnest(sequences(.)).

An example to call this function would be like this:

SELECT MMSI, build_tgeompoints(array_agg( Geom ORDER BY T), array_agg( T
ORDER BY T), 100, '5 minutes'::interval) Trip
FROM IoTBatchInput
GROUP BY IoTSource;

I hope this will help.

Mahmoud


On Tue, Aug 31, 2021 at 3:38 PM Alan Suc <suc.eleve at ecole-navale.fr> wrote:

> Hi,
>
> Sorry to bother you again but I would like to know if there is a way to
> sequence a temporal object regarding, like a trajectory if there is too
> much time between two individual points. For example if the object goes
> out of the area considered and come back inside few moment later, how to
> sequence the trajectory regarding these two phases ?
>
> Thanks again for your support.
>
> Best Regards,
>
> A. Suc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mobilitydb-users/attachments/20210831/16f3874d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: splitTrajectoriesOnGaps.sql
Type: application/sql
Size: 880 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mobilitydb-users/attachments/20210831/16f3874d/attachment.bin>


More information about the Mobilitydb-users mailing list