<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">You can use the temporal distance <div><a href="https://docs.mobilitydb.com/MobilityDB/develop/ch05s17.html">https://docs.mobilitydb.com/MobilityDB/develop/ch05s17.html</a><br></div><div>and azimuth functions in MobilityDB <div><a href="https://docs.mobilitydb.com/MobilityDB/develop/ch05s06.html">https://docs.mobilitydb.com/MobilityDB/develop/ch05s06.html</a></div></div><div><br></div><div>Get the temporal distance  <br>{point,tpoint} <-> {point,tpoint}: tfloat<br>SELECT tgeompoint '[Point(0 0)@2012-01-01, Point(1 1)@2012-01-03)' <-><br>  geometry 'Point(0 1)';<br>-- "[1@2012-01-01, 0.707106781186548@2012-01-02, 1@2012-01-03)"<br>SELECT tgeompoint '[Point(0 0)@2012-01-01, Point(1 1)@2012-01-03)' <-><br>  tgeompoint '[Point(0 1)@2012-01-01, Point(1 0)@2012-01-03)';<br>-- "[1@2012-01-01, 0@2012-01-02, 1@2012-01-03)"<br>SELECT tgeompoint '[Point(0 1)@2012-01-01, Point(0 0)@2012-01-03)' <-><br>  tgeompoint '[Point(0 0)@2012-01-01, Point(1 0)@2012-01-03)';<br>-- "[1@2012-01-01, 0.707106781186548@2012-01-02, 1@2012-01-03)"<br>SELECT tgeompoint '[Point(0 0)@2012-01-01, Point(1 1)@2012-01-02)' <-><br>  tgeompoint '[Point(0 1)@2012-01-01, Point(1 2)@2012-01-02)';<br>-- "[1@2012-01-01,1@2012-01-02)"<br><br>Get the temporal azimuth  <br>azimuth(tpoint): tfloat<br>SELECT degrees(azimuth(tgeompoint '[Point(0 0 0)@2012-01-01, Point(1 1 1)@2012-01-02,<br>  Point(1 1 1)@2012-01-03, Point(0 0 0)@2012-01-04)'));<br>-- "Interp=Stepwise;{[45@2012-01-01, 45@2012-01-02], [225@2012-01-03, 225@2012-01-04)}"<br><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 1:32 PM <<a href="mailto:suc.eleve@ecole-navale.fr">suc.eleve@ecole-navale.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Good afternoon,<br>
As my currently working on a project on collision between ships, I  <br>
would like to build a tfloat which would correspond to the distance  <br>
between two ships, an other which would correspond to the bearing of  <br>
one ship saw by the other one. I already have the tgeompoint  <br>
corresponding to the trajectories of those ships but as I didn't find  <br>
mobilityDB built-in functions which would directly do what I want, I  <br>
would like to do that my self. The first step would be to obtain the X  <br>
and Y coordinates of the tgeompoint into tfloat. But I don't really  <br>
know how to do that as PosGis function ST_X() only works for points  <br>
and not trajectories. Then I will also need to apply mathematics  <br>
functions such as sin()or sqrt() to tfloat, but it seems that for the  <br>
moment only basic functions such as + or / are supported for tfloat.<br>
<br>
Would someone have solutions for these diverse issues ?<br>
<br>
Best Regards,<br>
<br>
A. Suc<br>
<br>
_______________________________________________<br>
Mobilitydb-users mailing list<br>
<a href="mailto:Mobilitydb-users@lists.osgeo.org" target="_blank">Mobilitydb-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mobilitydb-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mobilitydb-users</a><br>
</blockquote></div>