Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The best way to store GPS coordinates (track) on server

What is the best way to store GPS coordinates (track) on server (MySQL or Oracle or maybe in any file)? How is it implemented it the GoogleMaps, for example? I want to save and compare tracks for same parts.

P.S. I have all necessary data.

like image 230
Konstantin.Efimenko Avatar asked Nov 16 '12 13:11

Konstantin.Efimenko


People also ask

How are GPS data stored?

The data stored on this kind of GPS tracking system is usually stored in internal memory or on a memory card, which can then be downloaded to a computer at a later date for analysis.

How often do apps that track locations update and store their GPS location?

On Android, updates are sent by the app to our servers every 5 minutes.

How can I find a GPS location?

First, open Google Maps on your Android device and search for the location you are interested in. Once you have found the location, make sure you zoom in as far in as possible. Now press and hold anywhere on the screen and Google Maps will drop a pin onto that location.


1 Answers

If I were you I'd use a TRACK and a POINT table.

The TRACK table would contain a row for each distinct track

  TRACK_ID      int not null  (PK)
  NAME          varchar(40)
  DESCRIPTION   varchar(255)
  other identifying information

The POINT table would contain multiple rows per track, one for each point in the track

  POINT_ID     int not null  (PK)
  TRACK_ID     int not null  (FK to TRACK)
  LAT          float  degrees  .. positive means north
  LONG         float  degrees  .. positive means east, negative means west
  ALT          float (elevation if you have it)
  TS           timestamp of point

A couple of notes about this. Keep the rows of the POINT table short; you will have lots of them and you want to be able to crunch them quickly. Also, don't succumb to the temptation of using double instead of float; the float data format has plenty of precision for a typical point (unless you are a land surveyor and know about stuff like universal transverse mercator projections).

like image 197
O. Jones Avatar answered Oct 04 '22 15:10

O. Jones