Closed EmersonLopes closed 1 year ago
Try
SETCHAN channelFord INTERSECTS cars WHERE 'info.brand == "ford"' FENCE DETECT inside,outside [...]
Try
SETCHAN channelFord INTERSECTS cars WHERE 'info.brand == "ford"' FENCE DETECT inside,outside [...]
With this command the result was the same
The WHERE clause is considered to be part of the geofence constraint.
Basically the INTERSECTS command you are providing says:
For all cars that are inside of the provided polygon and are a ford, send an "inside" event, otherwise send an "outside" event.
Perhaps using "enter,exit" instead of "inside,outside" will give you better results, because an "exit" event cannot happen unless the car was previously considered inside.
My bad, I overlooked your inside,outside
Using a channel like so:
SETCHAN channelFord INTERSECTS cars WHERE 'info.brand == "ford"' FENCE DETECT enter,exit OBJECT {"type":"Polygon","coordinates":[[[-87.6875402606167,41.91766993152294],[-87.6875402606167,41.91053637115587],[-87.67749935516063,41.91053637115587],[-87.67749935516063,41.91766993152294],[-87.6875402606167,41.91766993152294]]]}
works as expected on ford vehicles, but ignores everything else.
>> 127.0.0.1:9851> SET cars ABC1234 FIELD info {"brand":"ford","year":"2010"} POINT 41.91323014924143 -87.68240968749839
>> {"ok":true,"elapsed":"1.109292ms"}
>> {"command":"set","group":"64ef2d1716fcd30001286d1d","detect":"enter","hook":"channelFord","key":"cars","time":"2023-08-30T11:50:46.999727689Z","id":"ABC1234","object":{"type":"Point","coordinates":[-87.68240968749839,41.91323014924143]},"fields":{"info":{"brand":"ford","year":"2010"}}}
>> SET cars DEF5678 FIELD info {"brand":"bmw","year":"2012"} POINT 41.91323014924143 -87.68240968749839
{"ok":true,"elapsed":"235.875µs"}
>>
Got it, thanks for the help guys. Enter, exit really works I will use enter, exit
The bug occurs when I create a channel for ford brand cars only, but the channel is showing cars from other brands as well
Create "channelFord" channel only for ford brand cars
subscribe in channel
SET inside
SET outside
the result of subcribe
The expected result was that only Ford cars were captured in the canal.
Help
Did I do something wrong? Help me please