Specification to reduce waypoint data volume

Example of reducing waypoint data volume (GPX file size) on Google Maps

GPX Editor and Viewer can reduce the number of waypoints without changing the route shape as much as possible. It is very important to reduce the number of waypoints because GPX files are written in text format.

Dialogs and parameters for executing data reduction processing with GPX Editor and Viewer

GPX Editor and Viewer reduces the amount of waypoint data using two types of parameters. The "minimum distance" parameter specifies the minimum distance threshold between two waypoints in meters. GPXEV deletes waypoints with a distance shorter than the specified threshold. The "route deviation" parameter specifies the allowable route separation in meters before and after deleting the waypoint. GPXEV deletes waypoints that fall within the specified threshold.

The detailed specifications for reducing waypoints are described below.

1. Minimum Distance

Figure that calculates the distance between two waypoints

First, how to reduce the amount of data using the parameter "minimum distance" is explained. If there are two waypoints, w1 and w2, the distance between the waypoints is defined as d. If distance d is shorter than the threshold, either w1 or w2 is deleted.

Success and failure examples of deleting waypoints without changing the route shape

GPXEV will select the best waypoint to delete. For example, in the figure on the left, w1 and w2 are close to each other, but deleting w1 will change the shape of the route. On the other hand, deleting w2 does not change the route shape.

How to find changes in route direction to reduce the number of waypoints without changing the route shape

GPXEV calculates the angle at which the direction of travel changes for each waypoint. A waypoint with a lower value is better suited for deletion. As a specific example, when deleting either w1 or w2, the amount of change θ1 or θ2 in the direction of travel is calculated. Then, delete the waypoint with the smaller value of θ.

GPXEV does not delete a locked waypoint

Data reduction processing does not delete a locked waypoint. For example, if w1 and w2 are close and w1 is locked, w2 is deleted unconditionally.

2. Route Deviation

Example of reducing the number of GPX file waypoints on the route on Google Maps

The following explains how to reduce the data volume using the parameter "route deviation". Using this parameter is suitable for reducing the amount of data on long straight roads or roads that are gently curved.

3 waypoints

The following is an example when there are three Waypoints, w1, w2, and w3. Now consider whether w2 can be deleted.

Figure to find the distance between waypoints

First, calculate the distance r between w1 and w2.

Figure to find the direction of travel and distance when waypoint is deleted

Next, find the point p that is on the straight line connecting w1 and w3 and is at a distance r from w1.

Figure of how to calculate the distance from the original route by deleting waypoints in the data amount reduction processing of GPX file

Calculate the distance d between w2 and p. If d is less than the threshold, w2 is deleted. Therefore, the upper limit of the distance d deviated from the original route is the threshold value.

Diagram showing a perpendicular line connecting two waypoints

The straight line indicating the distance d obtained here is not a perpendicular line connecting w1 and w3. It is easy to determine the perpendicular line on the plane. But it is difficult to find a perpendicular line on the surface of a sphere using latitude and longitude. Therefore, GPXEV uses the distance d calculated simply without using the perpendicular line.