How should a route data be stored?

8

I'm developing an application where a route from point A to B will be started and I want to save the coordinates to display the route later.

How should these data be saved? Monitor any changes to GPS and save latitude and longitude and mount a large array or json ?

Is there a standard to follow for this type of information?

    
asked by anonymous 04.11.2016 / 20:25

1 answer

8

Save the data in a database table or json on file, as you prefer. But you need to have the time you were registered and position to be able to plot the route.

You need to set a time interval or distance to be recorded, for example every 5 meters or 1min you save the position.

Example.

The pattern to follow depends on the need to trace the route ... The most used for tracking. it is for example: if the position of distance exceeds 5 meters, it records the change, remembering that it is necessary to define a ray for tolerance, since GPS does not always maintain the precision.

In the image posted every time I registered the position, then even stopped at the same place the GPS returned different values, I did not tolerate and distance the old position.

    
08.11.2016 / 17:27