tile38 roaming-geofences 试用

tile38 支持动态实时的移动对象的数据监控

环境准备

  • docker-compose 文件
version: "3"
services:
  app:
    image: tile38/tile38
    ports:
    - "9851:9851"
  benthos:
    image: jeffail/benthos
    volumes:
    - "./conf/webhook.yaml:/benthos.yaml"
    ports:
    - "4195:4195"
 
 
  • webhook 配置文件
input:
  type: broker
  broker:
    inputs:
      - type: http_server
        http_server:
          path: /
        processors:
          - type: text
            text:
              operator: prepend
              value: "get email message: "
output:
  type: stdout
 
 

启动&&试用

  • 启动
docker-compose up -d
  • 使用
    添加roaming-geofences ,容器内部 docker-compose exec app sh
 
SETHOOK myhook http://benthos:4195/ NEARBY people FENCE ROAM people * 5000
{"ok":true,"elapsed":"103.615µs"}

添加数据

SET people bob POINT 33.01 -115.01
SET people alice POINT 33.02 -115.02
SET people dalong POINT 33.02 -115.02
SET people dalong2 POINT 33.02 -115.02
SET people dalong3 POINT 33.02 -115.02

webhook 数据

benthos_1 | get email message: {"command":"set","group":"5c39df96bc958a00013da996","detect":"roam","hook":"myhook","key":"people","time":"2019-01-12T12:37:42.052125403Z","id":"dalong","object":{"type":"Point","coordinates":[-115.02,33.02]},"nearby":{"key":"people","id":"alice","object":{"type":"Point","coordinates":[-115.02,33.02]},"meters":0}}

说明:
目前测试坐标点不同的,没有成功,需要在看看,可能是bug,同时如果key 包含的对象有多个的话,会有多次webhook 的调用
参考测试:

 
benthos_1 | get email message: {"command":"set","group":"5c39e037bc958a00013da998","detect":"roam","hook":"myhook","key":"people","time":"2019-01-12T12:40:23.389819225Z","id":"dalong3","object":{"type":"Point","coordinates":[-115.02,33.02]},"nearby":{"key":"people","id":"dalong","object":{"type":"Point","coordinates":[-115.02,33.02]},"meters":0}}
benthos_1 | get email message: {"command":"set","group":"5c39e037bc958a00013da998","detect":"roam","hook":"myhook","key":"people","time":"2019-01-12T12:40:23.389819225Z","id":"dalong3","object":{"type":"Point","coordinates":[-115.02,33.02]},"nearby":{"key":"people","id":"dalong2","object":{"type":"Point","coordinates":[-115.02,33.02]},"meters":0}}
benthos_1 | get email message: {"command":"set","group":"5c39e037bc958a00013da998","detect":"roam","hook":"myhook","key":"people","time":"2019-01-12T12:40:23.389819225Z","id":"dalong3","object":{"type":"Point","coordinates":[-115.02,33.02]},"nearby":{"key":"people","id":"alice","object":{"type":"Point","coordinates":[-115.02,33.02]},"meters":0}}

参考资料

https://tile38.com/topics/roaming-geofences/

posted on   荣锋亮  阅读(617)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示