PHP GPS parser

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

PHP GPS parser

Post by patrikG »

I've looked far and wide on phpclasses.org, sourceforge, freshmeat, googled for it but can't find a satisfactory GPS-parsing class.
There are a number of promising projects like Google Map GPS Cell Phone Tracker (of which I'd only need the GPS-parser) but the main problem appears to be that there are so many different formats GPS-data is stored in: GPX, NMEA, RINEX etc. etc.

There are some fine online solutions (e.g. http://www.gpsvisualizer.com/), some Java-applets and such, but nothing in PHP. The classes I've found on phpclasses.org are useless - either extremely narrow in scope or incomplete.

Does anyone know of a good class to parse GPS data (in different formats, if possible) with?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Do you have links to the specs of each of the storage formats?
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

GPX: http://www.topografix.com/GPX/1/1/gpx.xsd

had a look at their site, nothing of use even in the developer's section.
Will check for NMEA and get back to you.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

http://www.geoaps.com/NMEA.htm for NMEA - csv instead of XML. And NMEA apparently has various "dialects"... Alas - I'm surprised no-one has created a universal GPS-class in PHP, yet, to deal with the Babylon of GPS-formats.

edit: Looks like I'll be using http://sourceforge.net/projects/gpsbabel via exec().
edit 2: Unfortunately, gpsbabel doesn't have an auto-detect feature for the GPS-format used via the command-line, only for the GUI.
Does anyone know of or has seen a wrapper-class for gpsbabel? And, I know, I'll probably have to write it myself, lazy as I am... ;)
Last edited by patrikG on Sat Oct 13, 2007 6:10 am, edited 1 time in total.
Post Reply