Let's assume that we have a simple GIS-like application, which presents (using Google Maps or anything similar) recorded tracks. Each track consists of points (data portions) with geo-data and additional information, like speed, altitude and similar.
Basing on these additional params, I want to calculate some extra information, like average speed. What kind of data should web client receive and on which side is it the best to perform necessary calculations:
- client side: client receives (via AJAX) pure array of data (points with additional params) and all the calculations are done in Javascript in browser,
- server side: client receives a content ready to be put to propers places, like value of average speed, and all the calculations are done on server.
Personally I was always choosing (somehow automatically) first option, as I thought (correctly, if I'm wrong) this gives me more flexibility. But, right now, after reading some docs and pages, I can see clearly, that I may be wrong. So, what is the best practice in such situation?
(please, migrate to GIS, if I asked this question in incorrect place)