How should the data of a route be stored?

Asked

Viewed 245 times

8

I’m developing an application where a point route will be started A at the B and wish to save the coordinates to display the route later.

How should this data be saved? Monitor any changes in GPS and save the latitude and longitude and mount a great array or json?

Is there any pattern to be followed for that kind of information?

  • In fact, this would be a possibility: initially record a log of each of the coordinates visited, and then perform a post-processing on top of the coordinates.

  • 1

    If you are using Google Maps, this post lists some of the possibilities: http://stackoverflow.com/questions/17711468/create-a-route-using-a-list-of-coordinates-in-google-maps

1 answer

8


Save the data to a database table or json file, as you prefer. But you need to have the time it was registered and the position in order to trace 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.

exemplo

The pattern to be followed depends on the need to plot the route... the most commonly used for tracking. is for example: if the position of the distance more than 5 meters, it records the change, remembering that it is necessary to define a radius for tolerance, since q the GPS does not always maintain the accuracy.

In the image posted at all times I was recording the position, so even standing in the same place the GPS returned different values, I did not treat tolerance nor distance from the old position.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.