Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 08-08-2024, 00:20   #1
Registered User

Join Date: Aug 2024
Posts: 2
Modify Tracks in OpenCPN

Hi Together,


I am new to OpenCPN and use is for the first season. It works great so far and I am still learning about all the features.
I just didn't find a way to edit single points a the recorded track. My problem is, that during a long passage, my GPS somehow got some weird location info. So my track has some ugly spikes all over the screen. These single points I want to delete?

Is there a way? Where is the track data written to? Is the a file that can be edited?

Thanks in advance


Matthias
matthias-mw is offline   Reply With Quote
Old 08-08-2024, 00:48   #2
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,315
Re: Modify Tracks in OpenCPN

Properties for a track can be seen by the right click menu or Tools->Route & Mark manager but here is no way to edit single marks.

Routes, tracks and marks are stored in "navobj.xml" in the same folder as the log file. (On Win normally "C:\ProgramData\opencpn")
Theoretically this file can be edited if you're good at handling XML code. A safe copy is created once every O session called navobj.xml.1 (up to 5)

If your false positions are very short you may benefit from increase the "Filter NMEA Course and speed data" handled in Options->Connect.

Also be sure to use latest OCPN release. I think there have been some attempts to sort out similar not relevant positions. In any way it's discussed before.
Hakan is offline   Reply With Quote
Old 08-08-2024, 03:07   #3
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 515
Re: Modify Tracks in OpenCPN

Editing tracks can indeed only be done external. You could edit the navobject.xml file, however it is safer / easier to export the track, do the editing and import again. Don't forget to delete the original track.
__________________
Navigation is know where you are and what to do to get where you want.
But also: Know where you don't want to be and what to do to don't get there.
rooiedirk is offline   Reply With Quote
Old 09-08-2024, 01:36   #4
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 320
Or do it in JavaScript

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);
__________________
If all else fails, read the instructions.
Antipole is offline   Reply With Quote
Old 10-08-2024, 01:11   #5
Registered User

Join Date: Aug 2024
Posts: 2
Re: Modify Tracks in OpenCPN

Hi all together,


thanks for the replies. I am on a trip at the moment and therefore internet is not always available, thats why I reply so late.


I will try the tips you gave me as soon as I find a the the time for it.


Thanks everybody


Matthias
matthias-mw is offline   Reply With Quote
Old 10-08-2024, 02:16   #6
Registered User

Join Date: Sep 2012
Location: Baikal
Posts: 600
Re: Modify Tracks in OpenCPN

It was previously stated that a filter for large coordinate jumps was introduced
does it work or not, or is such a function not implemented?
Baikal is offline   Reply With Quote
Reply

Tags
enc, opencpn

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Repair and Modify Windlass Base ... reiner Construction, Maintenance & Refit 1 11-08-2012 18:08
Owners Version - or Modify Eight Berths ? Summersail Multihull Sailboats 3 21-07-2011 15:27
Modify Car A/C for Use on Sailboat - Thoughts? Fishman_Tx Plumbing Systems and Fixtures 49 16-08-2009 14:55
Modify Mast Step? palagic456 Construction, Maintenance & Refit 1 12-05-2009 11:00
Modify ferro cockpit hooked on water Construction, Maintenance & Refit 2 15-02-2008 00:28

Advertise Here
  Vendor Spotlight
No Threads to Display.


All times are GMT -7. The time now is 23:57.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.