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.
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.
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.
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.
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 θ.
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.
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.
The following is an example when there are three Waypoints, w1, w2, and w3. Now consider whether w2 can be deleted.
First, calculate the distance r between w1 and w2.
Next, find the point p that is on the straight line connecting w1 and w3 and is at a distance r from w1.
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.
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.