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 28-04-2023, 02:41   #1
Registered User

Join Date: Aug 2009
Location: Onboard, currently cruising in SE Asia
Boat: St. Francis 44 Mk II (Catamaran)
Posts: 181
Send a message via Skype™ to SoggyPaws
5.8 Hidden Layers don't stay fully hidden

Hi all,
I've noticed this randomly but always thought it was me and not 5.8.
I have a LOT of layer files... peoples' tracks, waypoint files, route files, for about 6 different countries (we are in SE Asia, and looking toward the Red Sea next year).
I have at least 2 layer files that are completely "routes". These are hidden most of the time. But I notice random waypoints from those routes being visible in OpenCPN after a re-start. I check the layer setting, and it is still hidden. If I unhide the layer, I see the routes that that waypoint is/are in, and when I hide the layer again, the routes and waypoints are all hidden. But if I then, without doing anything else, shut down OpenCPN and start it back up, I see the waypoint again, but not the routes, and not all waypoints.
Here is one of the offending waypoints. It doesn't seem special.
Code:
<rtept lat="20.728457114" lon="37.208184188">
      <time>2020-05-02T16:23:36Z</time>
      <name>035</name>
      <sym>diamond</sym>
      <type>WPT</type>
      <extensions>
        <opencpn:guid>5b2bffff-5ce6-404b-a263-c6db19950000</opencpn:guid>
        <opencpn:auto_name>1</opencpn:auto_name>
        <opencpn:arrival_radius>0.050</opencpn:arrival_radius>
        <opencpn:waypoint_range_rings visible="false" number="0" step="1" units="0" colour="#FF0000" />
      </extensions>
    </rtept>
This is more of an annoyance than a big deal, but it could be a sign of something else...? Maybe I've overflowed something? A search of my layers folder in ProgramData\opencpn\ indicates I have 167 items (54 items (files/folders) at the top level of /layers and a bunch of gpx files in folders, ie "Red Sea Tracks" folder holds 5-6 track gpx files that are other cruisers' tracks).
I haven't tried removing most of the layers folders to see whether this is related to "too much stuff" or whether it is something else. Anyone else notice random waypoints from hidden layers showing up after a restart?
Sherry
SoggyPaws is offline   Reply With Quote
Old 28-04-2023, 03:18   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,212
Re: 5.8 Hidden Layers don't stay fully hidden

Sherry...

I would probably first start looking for duplicates in guid and position across my library. The explanation will more likely be there than in anything else. But hard to tell from that single point, that of course looks absolutely normal.
nohal is online now   Reply With Quote
Old 28-04-2023, 23:39   #3
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 287
Re: 5.8 Hidden Layers don't stay fully hidden

Sheery... run the Housekeeper JavaScript. This will check for many oddities, including duplicate guids.

From OCPN 5.8, that script will, by default, only check ordinary objects and ignore layers. However, you could simply change the OCPNgetGUID calls to get layer objects only or both ordinary and layers. See the JavaScript plugin User Guide for how to do that. This script is large and complex and not to be meddled with lightly. But those changes are very simple. After the analysis, the script goes on to offer to fix anomalies. If you have changed it to include layer objects, it will happily fix them but those fixes will not be saved and would be lost on a restart of OCPN.

It is, theoretically, possible to include a layer waypoint in a non-layer route. What then happens if the layer is hidden and the route is not? Below is a JavaScript that checks for crossings between layers and ordinary routes and points. The script runs for me but I have no crossings to check.

Code:
const ordinary = 0;
const layer = 1;
crossed = 0;
ordinaryPoints = OCPNgetWaypointGUIDs(ordinary);
layerPoints = OCPNgetWaypointGUIDs(layer);
ordinaryRoutes = OCPNgetRouteGUIDs(ordinary);
layerRoutes = OCPNgetRouteGUIDs(layer);

// check for ordinary routes including layer points
for (r = 0; r < ordinaryRoutes.length; r++){
	route = OCPNgetRoute(ordinaryRoutes[r]);
	for (p = 0; p < route.waypoints.length; p++){ // each ordinary route
		pointGUID = route.waypoints[p].GUID;
		for (c = 0; c < layerPoints.length; c++){ // each layer point
			if (pointGUID == layerPoints[c]){
				point = OCPNgetSingleWaypoint(pointGUID);
				print("Ordinary route ", route.name, " includes ", (point.isFreeStanding ? "waypoint ":"routepoint "), point.markName, "  ", point.GUID, "\n");
				crossed++
				}
			}
		}
	}

// check for layer routes including ordinary points
for (r = 0; r < layerRoutes.length; r++){
	route = OCPNgetRoute(layerRoutes[r]);
	for (p = 0; p < route.waypoints.length; p++){	// each layer route
		pointGUID = route.waypoints[p].GUID;
		for (c = 0; c < ordinaryPoints.length; c++){	// each ordinary point
			if (pointGUID == ordinaryPoints[c]){
				point = OCPNgetSingleWaypoint(pointGUID);
				print("Layer route ", route.name, " includes ", (point.isFreeStanding ? "waypoint ":"routepoint "), point.markName, "  ", point.GUID, "\n");
				crossed++
				}
			}
		}
	}
scriptResult(crossed, " crossings found\n");
Antipole is offline   Reply With Quote
Old 29-04-2023, 00:54   #4
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 287
Re: 5.8 Hidden Layers don't stay fully hidden

I have managed to create the crossed situation I envisaged.
  1. Drop a waypoint and name it, say, Test Mark
  2. Create a test route which includes the Test Mark
  3. Export both to separate .gpx files
  4. Delete both route and mark from OpenCPN
  5. Add a temp layer by importing the test mark.
  6. Import the route as an ordinary route (not layer)
You now have a route which includes an mark in a layer. You can move most of the route points but not the test waypoint.
Hide the layer and hide the route. Now show the route. The mark in the layer is shown, even though the layer is 'hidden'.
If you then hide the route again, the layer waypoint remains visible, even though its layer is hidden.

Run my crossings script. It reports the issue.
Antipole is offline   Reply With Quote
Old 01-05-2023, 19:13   #5
Registered User

Join Date: Aug 2009
Location: Onboard, currently cruising in SE Asia
Boat: St. Francis 44 Mk II (Catamaran)
Posts: 181
Send a message via Skype™ to SoggyPaws
Re: 5.8 Hidden Layers don't stay fully hidden

Antipole,
I follow your logic and this could be what has happened.
I will look at the waypoints and routes a little more closely.
Thanks for the link to your script, I will play with it.
Sherry
SoggyPaws is offline   Reply With Quote
Old 01-05-2023, 21:21   #6
Registered User

Join Date: Mar 2016
Location: San Francisco
Boat: Morgan 382
Posts: 2,948
Re: 5.8 Hidden Layers don't stay fully hidden

I have found that having layers with lots of objects dramatically affects performance. Even if they are off. Rather than turning them off, I move the files to a separate folder, and only move them to the layers folder if I need them. It's a PITA, but seems to work better.

Not really a fix for your issue, but it wouldn't be an issue if you did it that way.
__________________
-Warren
wholybee is offline   Reply With Quote
Old 26-06-2023, 22:17   #7
Registered User

Join Date: Aug 2009
Location: Onboard, currently cruising in SE Asia
Boat: St. Francis 44 Mk II (Catamaran)
Posts: 181
Send a message via Skype™ to SoggyPaws
Re: 5.8 Hidden Layers don't stay fully hidden

I finally took the time to run down the source of this issue. And am posting at least my solution here in case anyone else runs into the same thing.

The key to me was that the entire layer was not visible, just some parts of it. This is probably a bug but not a very big one.

I have a set of planning routes and waypoints that a friend made around late 2018. He exported his routes and posted them so others could take advantage of his planning (passage to the Red Sea from India). It is this layer, and another one or two that were created around the same time, likely with the same version of OpenCPN, that when this data is put in a Layer, and then the layer is hidden, and OpenCPN is restarted, some waypoints in the layer are visible after restart even though the layer is turned off. Turning the layer on (making it visible) and turning it off again, will hide these waypoints, as well as the rest of the layer, and they stay hidden until O is restarted again. I don't think this happened in 5.6.x, but maybe I just didn't notice.

What I found was that the waypoints all had a common (unusual) entry.

<opencpn:shared>1</opencpn:shared>

If I remove this line from each waypoint's definition in the layer gpx, then they behave normally. I have attached a zip file of 3 of these layers (with the "shared" waypoints still there) if anyone wants to play with it to see what I mean.

What I suspect happened was that a previous version of OpenCPN added this in the waypoint definition if a waypoint was used in more than one route. But I tried testing if it was still doing it by creating 2 new routes that used the same waypoints in 5.8.4 and I don't see this placed in the automatically-generated waypoints, even if the waypoint is shared between 2 routes. So it's not likely that many recent users would notice this.

I don't know why my first example waypoint in my first post doesn't have a shared line in it. Maybe I randomly picked the wrong waypoint to show as an example.

Attachment wouldn't attach as a zip, so change .pdf to .zip after downloading.

Sherry
Attached Files
File Type: pdf Layers with unhiding wpts.pdf (57.1 KB, 11 views)
SoggyPaws is offline   Reply With Quote
Reply


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
Layers or layers? Aart K. OpenCPN 5 10-06-2020 06:19
Removable Stay(sail) or not to stay... jcmcdowell Monohull Sailboats 11 30-09-2018 15:10
St Augustine - To stay or Not to stay alsobrsp Atlantic & the Caribbean 1 17-01-2013 12:07
For Sale: Stay sail, Storm Sail, & Head Stay MoonlightSailor Classifieds Archive 1 18-12-2009 10:27
For Sale: Stay sail, storm sail, & head stay MoonlightSailor Classifieds Archive 0 31-10-2009 16:25

Advertise Here


All times are GMT -7. The time now is 15:20.


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.