Code Monkey home page Code Monkey logo

Comments (5)

EmersonLopes avatar EmersonLopes commented on May 23, 2024 1

Try

SETCHAN channelFord INTERSECTS cars WHERE 'info.brand == "ford"' FENCE DETECT inside,outside [...]

With this command the result was the same

from tile38.

tidwall avatar tidwall commented on May 23, 2024 1

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.

from tile38.

iwpnd avatar iwpnd commented on May 23, 2024 1

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"}
>> 

from tile38.

iwpnd avatar iwpnd commented on May 23, 2024

Try

SETCHAN channelFord INTERSECTS cars WHERE 'info.brand == "ford"' FENCE DETECT inside,outside [...]

from tile38.

EmersonLopes avatar EmersonLopes commented on May 23, 2024

Got it, thanks for the help guys.
Enter, exit really works
I will use enter, exit

from tile38.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.