Is there a general / standard / generally accepted way to model GPS objects (waypoints, tracks)?

This question somewhat overlaps knowledge in geospatial information systems, but I think it belongs here, not GIS.StackExchange

There are many applications related to GPS data with very similar objects, most of which are defined by the GPX standard. These objects will be collections of routes, tracks, waypoints, etc. Some important programs, such as GoogleMaps, serialize more or less the same objects in KML format. There are many other online mapping applications (ridewithgps, strava, runkeeper, to name a few) that process this kind of data in a different way, but at the same time allow more or less equivalent "operations" with the data. Examples of such operations are:

  • Direct manipulation of tracks / tracks with the mouse (including drawing over the map);
  • Merging and splitting based on time and / or distance;
  • Replacing GPS collection altitude with increasing DEM / SRTM;
  • Calculation of the properties of a part of the track (total ascent, average speed, distance, time elapsed);

There are several small libraries (e.g. GpxPy ) that attempt to model these objects AND THEIR METHODS in a way that would ideally allow for an encapsulated, possibly language-independent library / API.

The fact is that this problem has existed long enough to ensure the emergence of a “generally accepted standard”, isn't it? On the other hand, most GIS programs are very professionally oriented towards geospatial analysis, topographic and cartographic applications, while typical travel tracking and travel planning applications seem to be more consumer-oriented, which can explain quite projects / applications consider and model the problem .

Thus, considering all the above, the question arises: is there currently or is there a standard way to model the most used GPS / Tracklog objects and their canonical attributes and methods in a canonical, object-oriented way?

There is a GPX scheme, and it is very close to what I imagine, but it contains only objects and attributes, not methods.

Any information would be much appreciated, thanks!

+4
source share
2 answers

As far as I know, there is no standard library, interface, or even a set of established best practices when it comes to storing / processing / processing route data. We put a lot of effort into these issues in Ride with GPS, and I know that the same thing can be said on other sites that solve related problems. I wish there was a standard, and I would like to work with someone on one.

GPX is fine and seems standard ... at least until you start processing GPX files and find that each one simultaneously adds its own custom extensions to a format for processing data such as heart rate, speed power etc. In addition, there is no standard way to associate a waypoint with a track point. Your "bread path" of the route is represented as a series of trkpt elements, and course points (for example, "turn left onto 4th street") are presented in a separate rtept series of elements. Ideally, you want to associate a given course point with a specific track point, and not just point the course point to latitude and longitude. If your path makes several cycles along the same streets, it may introduce some ambiguity in where the course points should be attached along the route.

The KML and Garmin TCX format is similar to the GPX with its pros and cons. After all, these formats only serve to transfer data between programs. They do not consider how to present data in your program, or what types of operations can be performed on data.

We save our track data as an array of objects with keys corresponding to various attributes, such as latitude, longitude, height, time from the beginning, distance from the beginning, speed, heart rate, etc. In addition, we store some metadata along the route to indicate the details of each section. When analyzing our array of track points, we use this metadata to divide the route into a series of segments. Segments can be divided, combined, deleted, attached, reversed, etc. They also encapsulate the method of generating trackpoints, whether by interpolating points along a straight line or by querying a path representing directions between endpoints. These methods make it easy to implement drag / drop editing and other general manipulations. You can use the Route object to handle operations with multiple segments. For example, if you have a route consisting of segments — some directions of movement, straight lines, walking routes, whatever — and want to change the route. You can ask each segment to cancel itself, saving its settings in the process. At a higher level, we use the Map class to connect the interface, send commands to the Route, and save a series of snapshots or transition functions that are updated properly to intelligently support cancellation / redo.

Manual manipulation and generation is one of the goals. Others aggregate summary statistics, structuring data for effective visualization / interaction. To some extent, these problems have been solved by any system that will receive data and create a linear graph. This is not a completely new territory. One interesting characteristic of route data is that you will often have two variables that you can choose for the x axis: time from start and distance from start. Both monotonously increase, and both offer a useful but different interpretation of the data. Looking at the height graph with the x-axis of the distance, you will see that the bike path rises and falls along the hill as symmetrical. Using the x axis of time, the lift height is much wider. It is not only about visualizing the data on the chart, but also about the decisions that you make when processing the data into summary statistics. Some weighted average values ​​make sense based on time, some on distance. The operations that you ultimately want are the minimum, maximum, weighted (depending on your choice of the independent var) average, the ability to filter points and perform min / max / avg filtering (use only those points at which you moved, ignore emissions, etc.), various smoothing functions (for example, to calculate the overall increase in altitude), the basic concept of map / reduction functionality (how much time I spent between 20-30 mph, etc.) and fixed moving averages which are associated with some inter by polarity. The latter is necessary if you want to determine your fastest 10 minutes or 10 minutes of the highest average heart rate, etc. Finally, you will need a simple and effective way to perform any calculations that you perform on a subset of your trackpoints.

Here you can see an example of all this in action if you are interested: http://ridewithgps.com/trips/964148

The chart below can be flipped, dragged to enlarge. The X axis has a link for switching between distance / time. On the left side panel below you will see the best 30 and 60 second efforts - this is done with fixed moving averages with interpolation. In the right sidebar, click the Metrics tab. Drag-select to enlarge in the section on the graph, and you will see all updates of indicators to reflect your choice.

We are happy to answer any questions or work with someone on some standard or open implementation of some of these ideas.

This is probably not quite the answer you were looking for, but thought that I would suggest some details on how we do something in Ride with GPS, since we don’t know any real standards, as you seem to are looking for.

Thanks!

+3
source

After more in-depth research, I feel obligated, to record and to help future people who are looking for this, mention a fairly extensive work on a topic made by two entities, sometimes working together: ISO and OGC.

From ISO (International Organization for Standardization) section TC 211 - Geographic Information / Geomatics contains almost everything.

From OGS (Open Geospatial Consortium), their Abstract characteristics are very extensive, while being redundant and free for ISO.

I'm not sure that it contains object methods related to the proposed application (gps track and waypoint analysis and manipulation), but, of course, the basic concepts contained in these documents are quite strong. UML is their schematic representation of choice.


ISO 6709 "[...] defines the representation of coordinates, including latitude and longitude, that will be used in data exchange. In addition, it indicates the representation of the horizontal location of a point using coordinate types other than latitude and longitude, and also indicates the height and depth that can be associated with horizontal coordinates. The view includes units and order of coordinates. "

ISO 19107 "defines conceptual schemes for describing the spatial characteristics of geographic features and a set of spatial operations corresponding to these schemes. It considers vector geometry and topology of up to three dimensions. Spatial operations for use in accessing, querying, managing, processing and exchanging geographic information data for spatial (geometric and topological) objects with an accuracy of up to three topological dimensions embedded in coordinate spaces of up to three axes. "


If I find something new, I will come back to edit it, including links when they are available.

+1
source

Source: https://habr.com/ru/post/1442124/


All Articles