Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Distances for geofences #141

Closed
tidwall opened this issue Feb 7, 2017 · 0 comments
Closed

Distances for geofences #141

tidwall opened this issue Feb 7, 2017 · 0 comments
Labels

Comments

@tidwall
Copy link
Owner

tidwall commented Feb 7, 2017

The DISTANCE keyword output the distance of an object for the NEARBY command. It works with standard queries, but does not output for geofences when the FENCE keyword is specified.

This works:

> NEARBY fleet DISTANCE POINT 33 -115 10000
{"ok":true,"objects":[{"id":"hello","object":{"type":"Point","coordinates":[-115.001,33.002]},"distance":241.15}],"count":1,"cursor":0,"elapsed":"206.496µs"}

This does not:

> NEARBY fleet FENCE DISTANCE POINT 33 -115 10000
{"ok":true,"live":true}
{"command":"set","group":"5899a597d5eefdb400c8c50c","detect":"inside","key":"fleet","time":"2017-02-07T03:46:47.830532366-07:00","id":"hello","object":{"type":"Point","coordinates":[-115.001,33.002]}}

The "distance" field should appear at the same level as "hello" and "object".

I suspect that the reason is distance calculation for standard queries is happening outside of the scanWriter.writeObject method, and the geofence logic is not including the calculation.

@tidwall tidwall added the bug label Feb 9, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant