[Fiware-tech-help] [FI-WARE-JIRA] (HELP-4449) [Complex Event Processing (CEP) - Proactive Technology Online] Function Distance

Help-Desk jira-help-desk at fi-ware.org
Thu Oct 1 15:51:00 CEST 2015


Dear Thomas,

Distance:
You need to provide 4 parameters, 2 for the first point and 2 for the second. These parameters are used as the (X,Y) coordinates of the 2 points you want to measure the distance between.
The function calculate a geometric distance, sqrt((y2-y1)^2 + (x2-x1)^2), so the result will be in the same units as the input. 
To refer to attribute of an event use the following: <EventName>.<EventAttributeName> for example attribute x of event a: a.x
So if event a has attributes x,y and event b has attributes x,y , you can refer to the distance between those two points by writing:
distance(a.x,a.y,b.x,b.y)

You can use this function directly in the condition of an input event assuming this event has the attributes of the two points.

Best regards,
Itai

-------------------------------------------------------------------------------
Tali Yatzkar Haham created HELP-4449:
----------------------------------------

             Summary: [Fiware-tech-help] [Complex Event Processing (CEP) - Proactive Technology Online] Function Distance
                 Key: HELP-4449
                 URL: https://jira.fiware.org/browse/HELP-4449
             Project: Help-Desk
          Issue Type: extRequest
          Components: FIWARE-TECH-HELP
            Reporter: FW External User

This email was generated by the FIWARE JIRA (http://jira.fiware.org).



More information about the Fiware-tech-help mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy