0

I want to implement, for personal use, an object representing a structured collection of GPS data.

Currently, there are a lot of file formats to represent this data, all of them with some minor variation of this representation:

  • A trackpoint would be a 4 element tuple representing the fixed-ordered sequence (latitude, longitude, elevation, timestamp).
  • A tracksegment is a sequence (ordered collection) of trackpoints, ordered by timestamp, representing a continuous line.
  • A track is an ordered collection of tracksegments, ordered by "creation timestamp", representing a discontinuous line (or multiple continuous lines in a given order).

My question is: "from a object-oriented design good-practices point of view, how should I name a class to represent a (not necessarily ordered) COLLECTION OF TRACKS"?

For example, suppose I have a GPX file, a KML file and I want to save both to a single JSON file, the API calls would be:

kmldata = new GPS_Data("somefile.kml");
gpxdata = new GPS_Data("somefile.gpx");
merged = GPS_Lib.merge(kmldata, gpxdata);
merged.save_to_json("somefile.json");

I feel that "GPS_Data" is too broad. Also, this would be the structure usually serialized to a file, but "GPS_File" refers too much to implementation of persistence, but this is an incidental use of the object (serialization to disk), not the definition of it.

heltonbiker
  • 26,657
  • 28
  • 137
  • 252
  • For the interested, interesting concepts can be found here: https://developers.google.com/maps-engine/documentation/definitions – heltonbiker Jun 19 '13 at 22:34

1 Answers1

1

Usually you store tracks in a List of Track.
So you can call it Tracks or TrackList.

More generally, you simply use the plural word for the element of that collection: singular: "track" plural "tracks"

In java this would be

List<Track> tracks.
AlexWien
  • 28,470
  • 6
  • 53
  • 83
  • I'm inclined to say that this is a very valid response to my question... Just as a side-question: supposing I include also "Waypoints" and "Routes" (two other standard concepts in the field) to that collection, so that it contains no more only Track objects, but a (not necessarily ordered) set of an arbitrary number of Tracks, Routes and Waypoints intermixed, what name would you give then? (this is being very enlightening to me, thanks beforehand!) – heltonbiker Apr 22 '13 at 18:02
  • then GpsData, GeoData, AppData, NavigationData, NavigationItems but this then depend if it represent all of the user's recorded data, or a only a subset. – AlexWien Apr 22 '13 at 18:57
  • I'll go with GpsDataSet, since Tracks, Routes and Waypoints are pretty much all the primitives a GPS device might give, and the properties of their elements can be extended if needed. I think DataSet (in the sense of a `Set`) better conveys the idea of finitude and specificity. Thanks again! – heltonbiker Apr 22 '13 at 19:02