[GIS] Parsing raw data from GPS tracker

gpsimporttracking

As a side project I've been hacking together a simple tracking system for my wayward dog using a cheap GPS / GPRS tracker.

I've successfully got it transmitting data to my server over GPRS but while the tracker display shows the correct LAT / LNG the data sent via. GPRS is out (by 8° LAT and -0.37° LNG) so I'm guessing I need to do some post processing?

Raw data

'#35682303151XXXX#uid1#0#9999#AUT#4#V#00402.6244,W,5556.4382,N,000.38,214#110913#165318#V#00402.6248,W,5556.4386,N,000.22,41#110913#165338#V#00402.6259,W,5556.4371,N,000.32,41#110913#165358#V#00402.6266,W,5556.4364,N,000.05,41#110913#165418##'

which has 4 fixes at 20s intervals which I've parsed out as;

[lat] => -4.026244
[lng] => 55.564382
[date] => 2013-10-15 16:53:18

[lat] => -4.026248
[lng] => 55.564386
[date] => 2013-10-15 16:53:38

[lat] => -4.026259
[lng] => 55.564371
[date] => 2013-10-15 16:53:58

[lat] => -4.026266
[lng] => 55.564364
[date] => 2013-10-15 16:54:18

Best Answer

So the answer was staring me in the face, the coordinates weren't returned in decimal notation they're degrees + minutes so;

55.564382° is actually 55° 56.4382" which in decimal is 55 + (56.4382 / 60) = 55.94063667°

Related Question