Distance calculator service
When TeamPlayer users are using the app, the location of the registrations is also stored. This way, one can find where a user was during the execution of his or her tasks.
In order to calculate the distance that a user has covered, Google Maps (c) is used to calculate this. As this takes some time to calculate, we have created a separate service to evaluate the distance between the points. Technically, this service has to be installed on the IIS (where TeamPlayer Web is installed too).
How does it work?
Every n minutes, the service checks in the location logbook if there are new location entries. If an entry is not flagged as 'calculated', the service will do as such:
- if there is also a location point registered max. 5 min. before this one, it will calculate the distance between the two points, following the most 'logical' road. By giving the points to Google Maps, we get the resulting location description (better than 'longitude and lattitude') back, and als the distance in kilometers. This is then registered in the location logbook
- Location Description: this is taken over from Google Maps as a 'descriptive' way of knowing where the user was ;
- Distance To Previous Point: in the current location point, we enter in 'kilometers' the distance from the previous location point to this one.
- Processed: the entry is marked as 'processed'
- if there is NO location point, registered max. 5 min. before this location entry, the following will happen:
- Location Description: the same way, overtaken by Google Maps
- Distance to Previous Point: stays on 0, as no calculation of distance takes place
- Processed: the entry is also marked as 'processed'
Installation
This service must be installed under the IIS
Technically: TpDistanceCalculatorService