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:

  1. 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
    1. Location Description: this is taken over from Google Maps as a 'descriptive' way of knowing where the user was ;
    2. Distance To Previous Point: in the current location point, we enter in 'kilometers' the distance from the previous location point to this one.
    3. Processed: the entry is marked as 'processed'
  2. if there is NO location point, registered max. 5 min. before this location entry, the following will happen:
    1. Location Description: the same way, overtaken by Google Maps
    2. Distance to Previous Point: stays on 0, as no calculation of distance takes place
    3. Processed: the entry is also marked as 'processed'

 

Installation

This service must be installed under the IIS

Technically: TpDistanceCalculatorService