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 14-02-2022, 05:28   #1
Registered User
 
Ivanm's Avatar

Join Date: Jan 2015
Posts: 282
SelectWaypoints

@Antipole

I have done so made the marks named then appropriately, imported marks to be edited into route&mark manager from a gpx file, copy the script and run for a few seconds and nothing happen just show "script timed out"

Ivan
Ivanm is offline   Reply With Quote
Old 15-02-2022, 00:26   #2
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 316
Re: SelectWaypoints

By way of explanation, this thread is about selecting a subset of waypoints and @Ivanm is using the SelectWaypoints script for the JavaScript plugin.

Quote:
Originally Posted by Ivanm View Post
@Antipole
I have done so made the marks named then appropriately, imported marks to be edited into route&mark manager from a gpx file, copy the script and run for a few seconds and nothing happen just show "script timed out"
Ivan
I guess you may have the Route & Mark Manager window open. Each time a waypoint is updated, OpenCPN updates the tables used by the manager.

I have about 440 waypoints plus route points and with the manager window open it takes about 8 seconds. With the manager closed, it seems instantaneous.

If you really need it, a script can allocate itself more time. See the User Guide for how to do this.
Antipole is offline   Reply With Quote
Old 15-02-2022, 08:05   #3
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 316
Re: SelectWaypoints

I have added to FlySpray a request for a route line style of No line.

If we had this, a group of waypoints could be created as points in a route (in arbitrary order). Then the whole group could be shown or hidden by showing or hiding the route.

It would be possible to create these groups with a JavaScript.

If you think this a good idea, please vote for it here.
Antipole is offline   Reply With Quote
Old 15-02-2022, 10:23   #4
Registered User
 
Ivanm's Avatar

Join Date: Jan 2015
Posts: 282
Re: SelectWaypoints

Quote:
Originally Posted by Antipole View Post
By way of explanation, this thread is about selecting a subset of waypoints and @Ivanm is using the SelectWaypoints script for the JavaScript plugin.





I guess you may have the Route & Mark Manager window open. Each time a waypoint is updated, OpenCPN updates the tables used by the manager.



I have about 440 waypoints plus route points and with the manager window open it takes about 8 seconds. With the manager closed, it seems instantaneous.



If you really need it, a script can allocate itself more time. See the User Guide for how to do this.
I tried with route & mark manager open and closed same result every time. I tried with 150 waypoints also not. I tried Housekeeper also dit not work show , wpguids length 47080 , but SetWaypointScale does work for me.

Ivan
Ivanm is offline   Reply With Quote
Old 15-02-2022, 13:57   #5
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 316
Re: SelectWaypoints

You are reporting 47,080 waypoint GUIDs. This is massive and surely far beyond what OpenCPN can reasonably be expected to handle, let alone a JavaScript.
You have some serious pruning to do but I do not know how you can do it.

For SelectWaypoints.js. you could insert this statement at the start of the loop which starts around line 33:

Code:
if (i%1000 == 0) print("i: " , i, "\n");
This will print the value of i every 1000 times around the loop, which will help you learn how far it is getting. You may have to allocate much more time. Make sure the Mark & Route Manager is closed - it makes big difference.

It would be worth running HouseKeeper to see what it reports. But again, it will probably need lots of time. It has to calculate the distance of each point from every other point. Go for lunch or maybe run it over night
Be aware that when it comes to fixing things up, HouseKeeper displays what it proposes to fix in dialogues. In your case it may try and display so much information that it pushes the action button off the bottom of the screen. But at least the report may give you some insight.
Antipole is offline   Reply With Quote
Old 16-02-2022, 03:03   #6
Registered User
 
Ivanm's Avatar

Join Date: Jan 2015
Posts: 282
Re: SelectWaypoints

Quote:
Originally Posted by Antipole View Post
You are reporting 47,080 waypoint GUIDs. This is massive and surely far beyond what OpenCPN can reasonably be expected to handle, let alone a JavaScript.
You have some serious pruning to do but I do not know how you can do it.

For SelectWaypoints.js. you could insert this statement at the start of the loop which starts around line 33:

Code:
if (i%1000 == 0) print("i: " , i, "\n");
This will print the value of i every 1000 times around the loop, which will help you learn how far it is getting. You may have to allocate much more time. Make sure the Mark & Route Manager is closed - it makes big difference.

It would be worth running HouseKeeper to see what it reports. But again, it will probably need lots of time. It has to calculate the distance of each point from every other point. Go for lunch or maybe run it over night
Be aware that when it comes to fixing things up, HouseKeeper displays what it proposes to fix in dialogues. In your case it may try and display so much information that it pushes the action button off the bottom of the screen. But at least the report may give you some insight.
Thanks for that, so it look like the script see the layers in route & mark manager even if it is set to not visible ,that help a lot so I can delete some of the layers to get less waypoints to work with at a time maybe it wil help thanks.

Ivan
Ivanm is offline   Reply With Quote
Old 16-02-2022, 03:21   #7
Registered User
 
Ivanm's Avatar

Join Date: Jan 2015
Posts: 282
Re: SelectWaypoints

@Antipole

Ok I deleted a layer with 30000 waypoints and now seem to work except it also removes waypoints to the north of TopLeft mark I see it does not process the waypoints in the layers as it should be but the amount of Waypoints in the layers does influence the speed of the script.

Ivan
Ivanm is offline   Reply With Quote
Old 16-02-2022, 04:11   #8
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 316
Re: SelectWaypoints

Quote:
Originally Posted by Ivanm View Post
@Antipole

... except it also removes waypoints to the north of TopLeft mark...

Ivan
I found an error in the logic that might explain. I have updated the script and you need to download it again.

The crucial bit is to set inside to true or false being whether that point should be shown.

Code:
inside =
	(waypoint.position.latitude <= top) && (waypoint.position.latitude >= bottom)  &&
	(waypoint.position.longitude >= left) && (waypoint.position.longitude <= right);
show(waypoint, inside);
Antipole is offline   Reply With Quote
Old 16-02-2022, 05:16   #9
Registered User
 
Ivanm's Avatar

Join Date: Jan 2015
Posts: 282
Re: SelectWaypoints

Quote:
Originally Posted by Antipole View Post
I found an error in the logic that might explain. I have updated the script and you need to download it again.



The crucial bit is to set inside to true or false being whether that point should be shown.



Code:
inside =

(waypoint.position.latitude &lt;= top) && (waypoint.position.latitude &gt;= bottom)  &&

(waypoint.position.longitude &gt;= left) && (waypoint.position.longitude &lt;= right);

show(waypoint, inside);
Thanks working good now.

Ivan
Ivanm 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


Advertise Here


All times are GMT -7. The time now is 14:02.


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.