I am using the GEO extension within function into an execution plan. I have multiple event streams, which contain sensor information, including the location of each sensor (in geographical coordinates). Furthermore, I have a Polygon (example below, which contains the coordinates of each point). I would like to check if it's possible to determine whether the sensors are within the boundaries of this polygon.
My execution plan is the following:
@Plan:name('TestExecutionPlan')
define stream sensorStream (id string, lat double, longi double);
define stream outputStream (id string);
from sensorStream [geo:within(lat,longi,{"type": "Polygon", "coordinates": [[[37.9807986, 23.7262081],[37.9807986, 23.7262081],[37.9792256, 23.7302850],[37.9789888, 23.7268089],[37.9807986, 23.7262081]]]})]
select id
insert into outputStream;
When I'm running my execution plan in Siddhi Try It Tool of the WSO2CEP Management Console the following error is occurring:
You have an error in your SiddhiQL at line 16:108, no viable alternative at input 'geo:within(sensorStream.lat, sensorStream.longi,{'type':'Polygon','coordinates':[[[37.9807986, 23.7262081],[37.9807986, 23.7262081],[37.9792256, 23.7302850],[37.9789888, 23.7268089],[37.9807986, 23.7262081]]]}'
I do not know why that error occurs.
I would be very grateful if somebody could help me on this matter.
Thanks!