[Mobilitydb-users] MobilityDB-Coordinates from TGeompoint

Esteban Zimanyi esteban.zimanyi at ulb.be
Mon Sep 20 05:05:37 PDT 2021


You can use the temporal distance
https://docs.mobilitydb.com/MobilityDB/develop/ch05s17.html
and azimuth functions in MobilityDB
https://docs.mobilitydb.com/MobilityDB/develop/ch05s06.html

Get the temporal distance
{point,tpoint} <-> {point,tpoint}: tfloat
SELECT tgeompoint '[Point(0 0)@2012-01-01, Point(1 1)@2012-01-03)' <->
  geometry 'Point(0 1)';
-- "[1 at 2012-01-01, 0.707106781186548 at 2012-01-02, 1 at 2012-01-03)"
SELECT tgeompoint '[Point(0 0)@2012-01-01, Point(1 1)@2012-01-03)' <->
  tgeompoint '[Point(0 1)@2012-01-01, Point(1 0)@2012-01-03)';
-- "[1 at 2012-01-01, 0 at 2012-01-02, 1 at 2012-01-03)"
SELECT tgeompoint '[Point(0 1)@2012-01-01, Point(0 0)@2012-01-03)' <->
  tgeompoint '[Point(0 0)@2012-01-01, Point(1 0)@2012-01-03)';
-- "[1 at 2012-01-01, 0.707106781186548 at 2012-01-02, 1 at 2012-01-03)"
SELECT tgeompoint '[Point(0 0)@2012-01-01, Point(1 1)@2012-01-02)' <->
  tgeompoint '[Point(0 1)@2012-01-01, Point(1 2)@2012-01-02)';
-- "[1 at 2012-01-01,1 at 2012-01-02)"

Get the temporal azimuth
azimuth(tpoint): tfloat
SELECT degrees(azimuth(tgeompoint '[Point(0 0 0)@2012-01-01, Point(1 1
1)@2012-01-02,
  Point(1 1 1)@2012-01-03, Point(0 0 0)@2012-01-04)'));
-- "Interp=Stepwise;{[45 at 2012-01-01, 45 at 2012-01-02], [225 at 2012-01-03,
225 at 2012-01-04)}"



On Mon, Sep 20, 2021 at 1:32 PM <suc.eleve at ecole-navale.fr> wrote:

> Good afternoon,
> As my currently working on a project on collision between ships, I
> would like to build a tfloat which would correspond to the distance
> between two ships, an other which would correspond to the bearing of
> one ship saw by the other one. I already have the tgeompoint
> corresponding to the trajectories of those ships but as I didn't find
> mobilityDB built-in functions which would directly do what I want, I
> would like to do that my self. The first step would be to obtain the X
> and Y coordinates of the tgeompoint into tfloat. But I don't really
> know how to do that as PosGis function ST_X() only works for points
> and not trajectories. Then I will also need to apply mathematics
> functions such as sin()or sqrt() to tfloat, but it seems that for the
> moment only basic functions such as + or / are supported for tfloat.
>
> Would someone have solutions for these diverse issues ?
>
> Best Regards,
>
> A. Suc
>
> _______________________________________________
> Mobilitydb-users mailing list
> Mobilitydb-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mobilitydb-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mobilitydb-users/attachments/20210920/df12f41e/attachment.html>


More information about the Mobilitydb-users mailing list