Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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 05-10-2021, 02:26   #1
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 315
Adding a waypoint to a route - what is going on?

OpenCPN has excellent capabilities for constructing and editing a route. This is much enhanced in the imminent v5.5.

A route can comprise 'private' routepoints which by default get sequential names 001, 002, 003 et seq. A route can also include a free-standing waypoint, such as "Clear of Rocky Head".

This process may not always be what it seems.

Method A

The waypoint is simply included in the route. Suppose another hazard is discovered off Rocky Head and the waypoint is moved further off. This takes effect in all the routes around the head, even if the route is not visible at the time the waypoint is moved.

If a route is deleted, OpenCPN knows which included routepoints are waypoints and does not delete them along with the private routepoints.

Method B

I have a script for the JavaScript plugin that lists duplicate route and waypoint names. As expected, this shows up duplicates of, say, 001, 002 in multiple routes.

In my case it also shows some duplicates of my free-standing waypoints that have been included in routes - up to seven duplicates of some waypoints and dozens overall.

It seems that sometimes when a waypoint is included in a route, OpenCPN creates a duplicate to include in the route. This is not normally apparent to the user, as the duplicate exactly overlays the original. But if you open the attributes of one of these waypoints and edit its position very slightly, it moves aside to reveal the underlying one. You can then see the original waypoint and the corresponding routepoint.

When a route is deleted, all the routepoints are simply deleted - there is no need to check whether a routepoint is also a waypoint and should be left.

A consequence of this strategy is that if I move my 'Clear of Rocky Head' waypoint to a safer position, a duplicate in a route will not be moved - beware


I have not determined why there are two strategies nor when one is used over the other. None of my waypoints or routes are in layers, which might make them immutable and led to use of Method B.

I have not delved into the innards of OpenCPN here but would be very interested to have some light shone on this. What is going on?

Postscript: I have just realised that these routes may be ones I imported from my previous system and the duplication arises because of the non-uniqueness of routepoint names.

I have just realised that these routes may be ones I imported from my previous system and the duplication arises because of the non-uniqueness of routepoint names.
How to fix? Unfortunately, there is no API to replace a routepoint with one with a different GUID so this cannot be scripted and automated. But if you drag one of these routepoints aside, you can then see the free-standing waypoint. Since OpenCPN v5.5 you can then drag the routepoint over the waypoint and OpenCPN will offer to replace it with the nearby waypoint.
Antipole is offline   Reply With Quote
Old 06-10-2021, 05:43   #2
Registered User

Join Date: Oct 2011
Location: Apeldoorn
Boat: Ovni 385
Posts: 340
Re: Adding a waypoint to a route - what is going on?

Quote:
Originally Posted by Antipole View Post
OpenCPN has excellent capabilities for constructing and editing a route. This is much enhanced in the imminent v5.5.

A route can comprise 'private' routepoints which by default get sequential names 001, 002, 003 et seq. A route can also include a free-standing waypoint, such as "Clear of Rocky Head".

This process may not always be what it seems.
You are right. If you have two routes with (some) shared waypoints, export both, delete your routes, import the two routes again, you have a different situation than the one you started with. First you had two routes with shared waypoints, you end up with two routes with separate waypoints. To get is right again, you have to move all waypoints to be shared a little and answer yes to the question posed each time.

One could think of a command in O doing this for you.

Douwe Fokkema
Douwe Fokkema is offline   Reply With Quote
Old 06-10-2021, 05:56   #3
Registered User

Join Date: Jun 2010
Location: St. Petersburg, Florida
Boat: Gemini 3200
Posts: 983
Re: Adding a waypoint to a route - what is going on?

Quote:
Originally Posted by Douwe Fokkema View Post
You are right. If you have two routes with (some) shared waypoints, export both, delete your routes, import the two routes again, you have a different situation than the one you started with. First you had two routes with shared waypoints, you end up with two routes with separate waypoints.

That's not true for 4.8.8 and I don't believe the logic has been updated since then. If you have two routes with shared waypoints, export both, delete both, and import both you will have two routes with the same shared waypoints.
fgd3 is offline   Reply With Quote
Old 06-10-2021, 07:13   #4
Registered User

Join Date: Oct 2011
Location: Apeldoorn
Boat: Ovni 385
Posts: 340
Re: Adding a waypoint to a route - what is going on?

Quote:
Originally Posted by fgd3 View Post
That's not true for 4.8.8 and I don't believe the logic has been updated since then. If you have two routes with shared waypoints, export both, delete both, and import both you will have two routes with the same shared waypoints.
You are right. I imported the same route twice, then all waypoints are doubled.
Douwe Fokkema is offline   Reply With Quote
Old 06-10-2021, 11:41   #5
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 315
Resolving duplicate waypoints

You could resolve the duplicate waypoint issue using the JavaScript plugin. In outline:

1. Read in all waypoints
2. Identify duplicates (Same name and position)
3. Decide which is to become the master and which will be replaced, noting the GUIDs
4. Read through all routes looking for waypoints to be replaced and replace with the master one.
5. Delete the waypoints no longer being used.
Antipole is offline   Reply With Quote
Old 06-10-2021, 20:49   #6
Registered User

Join Date: Jun 2010
Location: St. Petersburg, Florida
Boat: Gemini 3200
Posts: 983
Re: Adding a waypoint to a route - what is going on?

Quote:
Originally Posted by Douwe Fokkema View Post
You are right. I imported the same route twice, then all waypoints are doubled.

That's not the way it works for me. I imported a route, then imported it again. The route showed up twice in the route manager but when I went to the Waypoints tab the waypoints in the route (all shared) showed up just once for each waypoint in the route. When I deleted one copy of the route the list of waypoints did not change. When I deleted the other copy the waypoints disappeared from the Waypoints tab as well.
fgd3 is offline   Reply With Quote
Old 07-10-2021, 02:47   #7
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 315
Re: Adding a waypoint to a route - what is going on?

I have added a script to the JavaScript script library called DuplicateCounter.js

When you run this it produces a report for all duplicate route and waypoint names including the count of how many times the name is used.
Names like 001, 002 are used many times, of course. But I was surprised to discover some of my 'permanent' waypoints existed as many as eleven times!
Antipole is offline   Reply With Quote
Old 08-10-2021, 19:20   #8
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,755
Images: 2
Re: Adding a waypoint to a route - what is going on?

Quote:
Originally Posted by Antipole View Post
I have added a script to the JavaScript script library called DuplicateCounter.js

When you run this it produces a report for all duplicate route and waypoint names including the count of how many times the name is used.
Names like 001, 002 are used many times, of course. But I was surprised to discover some of my 'permanent' waypoints existed as many as eleven times!

It sounds like OpenCPN could use a waypoint cleanup script eventually.
rgleason is offline   Reply With Quote
Old 09-10-2021, 02:04   #9
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 315
Re: Adding a waypoint to a route - what is going on?

Quote:
It sounds like OpenCPN could use a waypoint cleanup script eventually.
Yes - the more I think about it, the more I see can be checked out and resolved.
But FS#2803 is essential before it can be done.
Antipole is offline   Reply With Quote
Old 21-10-2021, 04:12   #10
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,755
Images: 2
Re: Adding a waypoint to a route - what is going on?

Antipole wrote:

How to fix? Unfortunately, there is no API to replace a routepoint with one with a different GUID so this cannot be scripted and automated. But if you drag one of these routepoints aside, you can then see the free-standing waypoint. Since OpenCPN v5.5 you can then drag the routepoint over the waypoint and OpenCPN will offer to replace it with the nearby waypoint.

With bdbcats recent changes of routes in api is this abilty covered? I think so.
rgleason is offline   Reply With Quote
Reply

Tags
route


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
Adding waypoint from outside OpenCPN Caglar Markus OpenCPN 18 24-12-2020 07:34
Plugin: Adding waypoint with a hyperlink Rasbats OpenCPN 3 19-08-2017 06:18
Raymarine C-Series Waypoint and Route Import + Export scotte Marine Electronics 42 18-09-2012 20:30
Insert existing waypoint into existing route? Beausoleil OpenCPN 16 17-06-2012 06:49
Fugawi Route/Waypoint Question ssullivan Navigation 7 03-01-2007 12:27

Advertise Here


All times are GMT -7. The time now is 00:17.


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.