Previous in Forum: Radio Frequency Communications   Next in Forum: Out of Phase Voltages
Close
Close
Close
4 comments
Rate Comments: Nested
Associate

Join Date: Jan 2009
Location: Bangalore, India
Posts: 51

Best Way to Store GPS Coordinates? (What Data Type?)

07/16/2010 8:30 AM

I am creating a logger where I have to store GPS coordinates (in flash memory, it is an embedded system). I am wondering what is the best way to store these coordinates. At first I thought I would have to store a long ASCII string with complete long/lat and this would take more than 10 bytes. But then I understood that actually there is a decimal representation of this and thought maybe I should store the coordinates as floats. What is the best way? Are there any dradeoffs in terms of accuracy when moving from one way to another?

Thanks

__________________
Znago
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru
Panama - Member - New Member Hobbies - CNC - New Member Engineering Fields - Marine Engineering - New Member Engineering Fields - Retired Engineers / Mentors - New Member

Join Date: Dec 2006
Location: Panama
Posts: 4273
Good Answers: 213
#1

Re: Best Way to Store GPS Coordinates? (What Data Type?)

07/16/2010 11:45 PM

I would suspect that the best way to store the data would be in the original NMEA format with which it is sent.

Register to Reply Score 1 for Good Answer
Associate

Join Date: Jan 2009
Location: Bangalore, India
Posts: 51
#2
In reply to #1

Re: Best Way to Store GPS Coordinates? (What Data Type?)

07/17/2010 12:18 AM

Actually the question is about the long/lat and it seems that the best format is to store them as floats and then transform the decimal degrees to other format if needed.

__________________
Znago
Register to Reply
Power-User

Join Date: Sep 2009
Location: N38º3', W085º3'
Posts: 326
Good Answers: 19
#3

Re: Best Way to Store GPS Coordinates? (What Data Type?)

07/17/2010 8:10 PM

From all the software I use to manage gps coordinates, it seems the most used formats are .loc for simple waypoint name, longitude, latitude and .gpx for the same plus descriptions, pictures, files, and tons of other information.

it seems most downloads of coordinates come to me in one of these formats or are eventually converted to them.

both formats can be edited and manipulated with spreadsheet or text programs.

Here are some links to their descriptions.

.loc

and

.gpx

The .gpx files are also used by the Garmin line of gpsr's and I frequently use the drag and drop method to bring the files in and out of the Garmin units

__________________
There's a theory stating if anybody discovers exactly what the Universe is for & why it is here, it will instantly disappear & be replaced by something even more bizarre & inexplicable. There's another theory stating this has already happened.D Adams
Register to Reply
Commentator

Join Date: May 2008
Location: St. Paul , MN
Posts: 79
Good Answers: 6
#4

Re: Best Way to Store GPS Coordinates? (What Data Type?)

07/19/2010 8:50 AM

If all you care about preserving is the long/lat I would use a pointf data type. It would save on memory and neatly encapsulate the data you wish to retain.

Register to Reply
Register to Reply 4 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

cwarner7_11 (1); Daddio926 (1); Geode Hunter (1); Znago (1)

Previous in Forum: Radio Frequency Communications   Next in Forum: Out of Phase Voltages
You might be interested in: GPS Instruments and Modules, GPS Chips, GPS Software

Advertisement