[Mobilitydb-users] MobilityDB-Coordinates from TGeompoint
suc.eleve at ecole-navale.fr
suc.eleve at ecole-navale.fr
Mon Sep 20 05:55:37 PDT 2021
It should give :
arctan((x1-x2)/(y1-y2))+a with a={0 if x1<=x2 and y1<=y2, 90 if x1<x2
and y1>y2, 180 if x1>=x2 and y1>y2, 360 if x1>x2 and y1<=y2}
Esteban Zimanyi <esteban.zimanyi at ulb.be> a écrit :
> Currently there is no such a function but I think it can be easily
> implemented.
>
> Suppose that ship1 is at p1 at t1 and ship2 is at p2 at t1. What the value of
> such a function be at time t1 ?
>
> On Mon, Sep 20, 2021 at 2:14 PM <suc.eleve at ecole-navale.fr> wrote:
>
>> Thanks for your answer, I missed the temporal distance. But the
>> built-in function azimuth is not what I want to do : I would like to
>> obtain a tfloat which would correspond at the direction in which ShipA
>> see ShipB at each instant.
>> Best Regards,
>>
>>
>> Esteban Zimanyi <esteban.zimanyi at ulb.be> a écrit :
>>
>> > 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
>> >>
>>
>>
>>
>> _______________________________________________
>> Mobilitydb-users mailing list
>> Mobilitydb-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/mobilitydb-users
>>
More information about the Mobilitydb-users
mailing list