tile38
tile38 copied to clipboard
Is it possible to send the Distance from the GeoFence
Just want to know if I have created Hooks and I get the exit notifications like this
{'detect': 'exit', 'group': '5c5046da4ec8885ee87c9f15', 'fields': {'eventTime': 1547642987, 's': 54}, 'object': {'type': 'Point', 'coordinates': [78.05278222222222, 25.236991111111113]}, 'hook': 'geoId_17663', 'command': 'set', 'key': 'fleet', 'time': '2019-01-29T18:00:17.1238811+05:30', 'id': 'xxxxxx1'}
Will it be possible in case of 'detect': 'exit', I can also get 'distance': of exit point from the respective geofence ? The distance should be Haversine Distance
Abhit
That's not possible atm. Though I could see how it would be pretty useful.
There could be a way, if I set hook with META and having fields with all the bounding box points, and when the respective detect:'exit' will occur I can calculate the Haversine at my received end
Abhi
Seems like a reasonable approach.
Another thing {'detect': 'exit', 'group': '5c5046da4ec8885ee87c9f15', 'fields': {'eventTime': 1547642987, 's': 54}, 'object': {'type': 'Point', 'coordinates': [78.05278222222222, 25.236991111111113]}, 'hook': 'geoId_17663', 'command': 'set', 'key': 'fleet', 'time': '2019-01-29T18:00:17.1238811+05:30', 'id': 'xxxxxx1'}
Will it be possible to also send time in milliseconds too
Abhi
@tidwall is it possible ?
The time member contains enough information to get the milliseconds.
I am not denying that it can't be converted.. I am just asking if we can convert into milliseconds we would save some bytes getting transferred via hooks because of time as string YYYY-MM-DD ... Format. And for every hooks recv there would be a complexity of O(N), where N is the length of time string, converting into milliseconds .. Though the complexity is minimal but if there are a million hooks and tens of million set points happen with in an hour, it will be helpful for the whole entropy of stack. It was a suggestion.
Abhi
I see what you mean. Yes, it would be fewer bytes and faster parsing. The change would need to be optional, in order to keep backward compatibility. I would consider this.
@tidwall 👍 , any tentative timeline for the same, when I should expect the change ?
Abhi :wq
Unfortunately, I can’t say when I’d personally be able get around to this change. I’d accept a PR.