If your problem is a one-off, you might indeed be best to export the problem track as XML, delete the offending points and
import it back, as @rooiedirk suggests.
However, if you have this as a regular issue, you could create a script for the JavaScript
plugin to filter your track points within
OpenCPN. No export required. You could then run the script as often as required.
Here is a starter script for you. I have numbered the lines so I can comment:
Line 7: set to identify the track you want to filter
Line 15: The condition to omit this point. To illustrate, I have omitted any with latitude > 60. You could choose distance greater than some limit since last point etc.
Line 23: For
safety, rather than updating the track, I create a new track with the selected point omitted. You can then view both and compare them.
If you need further help after you have familarised yourself with the
plugin and played with this script,
open a discussion here.
Code:
1: Position = require("Position");
2:
3: trackGuids = OCPNgetTrackGUIDs();
4: track = false;
5: for (t = 0; t < trackGuids.length; t++){ // for each track
6: track = OCPNgetTrack(trackGuids[t]);
7: if (track.name != "name of my track") track = false;
8: else break;
9: }
10: if (!track) stopScript("Track not found");
11: print(track.name, " has ", track.waypoints.length, " waypoints\n");
12: thinned =[]; // to hold wapoints we keep
13: for (p = 0; p < track.waypoints.length; p++){ // for each point in track
14: pos = track.waypoints[p].position;
15: if (pos.latitude > 60){ // condition for deletion
16: print("Removing position ", new Position(pos).formatted, "\n");
17: }
18: else thinned.push(track.waypoints[p]); // keep this one
19: }
20: track.waypoints = thinned
21: track.name += " thinned";
22: print(track.name, " has ", track.waypoints.length, " waypoints\n");
23: OCPNaddTrack(track);