Link to home
Get AccessLog in
Avatar of Fritz41
Fritz41Flag for Afghanistan

asked on

Process GPS coordinates in real time


I am not familiar with GPS hardware and data protocols, so please excuse my ignorance with this question.

I have a database with items which have GPS coordinates as part of their attributes. I have an application that can display the items located within a certain radius of a GPS coordinate. What I now need to do is get a GPS tracking device and the software must then take the output from the device (say) every 20 seconds, and display items in the area of the current GPS coordinate. My client wants to drive around with the GPS tracking plugged into his laptop and have the database automatically filter and display items based on his location.

I have a pretty good idea how to program the software. If I can get the GPS coordinates into a text file or something every X seconds, then I can have the software read the text file content every X seconds and do the rest automatically (filter based on the last GPS coordinates).

My Question:
1. Are there devices that can continuously update the current GPS location in a file every X seconds?
2. If this is possible - where should I start looking for more information about devices and drivers to do what I want.
3. Any other advice welcome!


Avatar of alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

1. Any GPS device should be able to give you GPS at least in NMEA format (see e.g. here
Mobile phones may have embedded GPS receiver. Anyway, GPS receivers usually pump the data to the com port, so you need to read it and handle. If you were running on some mobile OS, you could have more convenient APIs for getting GPS coordinates - so it'll be different for Android, WinMo, iOS, S60 etc. But in your case it seems to be reading from COM port and handling NMEA - mainly I guess converting from NMEA lat/lon format to decimal

2. It all depends on your GPS receiver - but I wouldn't expect anything extra if you're gonna plug it in into the laptop (assuming running some sort of Windows, although it would work with anything)

3. I assume you already have the code to calculate distances etc etc, but you might want to look at something like this library: - it's in c#.
For coordinates conversion, if you don't already have it, just google and you''ll see a lot of examples.
Avatar of Fritz41


Thanks Alexey for your useful comment. This definitely helps me a lot, especially the link to the NMEA information. I am OK with using the GPS coordinates once I have it in memory. But I am still a bit vague as to how to get the NMEA code onto my computer, and how this works in practice.

Can you tell me if I am seeing this correctly:

1. I buy a device, e.g Garmin GPS. I plug it into my windows laptop with USB port.
2. I install software that comes with the device (???)
3. MOST IMPORTANT FOR ME - I use the software to tell the device WHERE (and how often) it should write the NMEA output to, e.g. (:C:\myGPSData\). Is this correct or am I totally wrong???.
4. The NMEA data is written every x seconds to a location, from where a listener program (.Net Windows program) can read the file, parse longitude and latitude from the NMEA code, and send a query to the database. Is this correct?

If any of the above assumptions are wrong or off-track, any re-direction will be much appreciated.

well, in my understanding, all pp1-4 are wrong :), apart fro may #2 (ie you might need to install the software or drivers). GPS receivers usually have serial interface, not USB.

If I were you and need to do it on Windows, I'd have a look at the products like GpsGate (, which hide many low-level details from you and allow redirecting GPS input to various sources.
Avatar of Fritz41


Thanks again Alexey. I don't think my problem is with the serial vs USB port, but whether or not I can configure the device to write the coordinates to a specific file and location.

I have emailed to see if their software can do what I need. If they can, I will mark your solution with A grade. If they do not come back to me I may hold out another few days to see if someone gives me a full solution. I hope that sounds fair to you?
Avatar of alexey_gusev
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
Avatar of Fritz41


Thanks Alexey. I downloaded GPS gate and, using the simulator function, I seem to be able to do what I need. I have not been able to test it with an actual GPS device, but I guess that will not be part of this problem.

Thanks again.