Jul 05 2018
04:25 AM
- last edited on
Apr 07 2022
05:13 PM
by
TechCommunityAP
Jul 05 2018
04:25 AM
- last edited on
Apr 07 2022
05:13 PM
by
TechCommunityAP
I have location data which is timestamped. I use the data to calculate the distance traveled.
First I have the function which is used for calculating the distance between coordinates:
let getDistance = (lat1:double, lon1:double, lat2:double, lon2:double) { let R = 6371; let dLat = radians(lat2-lat1); let dLon = radians(lon2-lon1); let a = sin(dLat/2) * sin(dLat/2) + cos(radians(lat1)) * cos(radians(lat2)) * sin(dLon/2) * sin(dLon/2); let c = 2 * atan2(sqrt(a), sqrt(1-a)); R * c };
LocationData_CL | where TimeGenerated > ago(60d) | where AssetId_s == "test" | order by TimeGenerated | project TimeGenerated, distance = getDistance(Lat_d, Lon_d, prev(Lat_d), prev(Lon_d))
| summarize sum(distance) by bin(TimeGenerated, 1d)
QUERY ABORTED
The query was aborted by the server.
Details: It looks like the accumulated data on the server exceeded the limit.
Support id: e15414e1-8bab-47b9-aaab-6638d1e91c9f
Jul 05 2018 06:19 AM
Jul 05 2018 06:29 AM