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 25-10-2022, 16:35   #1
Registered User

Join Date: Oct 2022
Posts: 2
OpenCPN as lineplanning tool

Hi, looking to my OpenCPN software to plan some survey lines and export to other Nav solutions. The survey lines must be parallel lines that are equal length. Right now, the process is to use the route tool to create routes, and use the measure tool to fine-tune where those waypoints end up. There has to be a better way! Picture attached of a few lines. Haven't found a plug-in to help create and "copy" lines over, but I'm sure someone has figured this out before! Would be the ultimate Nav software if this was possible (already is, really).
Attached Thumbnails
Click image for larger version

Name:	Lines.jpg
Views:	74
Size:	208.2 KB
ID:	266330  
TomSeeker is offline   Reply With Quote
Old 25-10-2022, 23:18   #2
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,202
Re: OpenCPN as lineplanning tool

Tom....
You may like to explore the SAR plugin. Sound like what you're asking for.
In the Options->Plugins.

Moro info here.
Hakan is offline   Reply With Quote
Old 25-10-2022, 23:25   #3
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 309
Smile Use the JavaScript plugin

Quote:
Originally Posted by TomSeeker View Post
Haven't found a plug-in to help create and "copy" lines over, but I'm sure someone has figured this out before!.
This would be straight forward using a script in the JavaScript plugin.

There is a built-in function to calculate a position a given vector (distance and bearing) from a given position.

Code:
toPosition = OCPNgetPositionPV(fromPosition, vector);
So you can easily create a two-point route with start and end points a given vector from an existing route.

All the required information is in the User Guide for the plugin.
Antipole is offline   Reply With Quote
Old 27-10-2022, 00:48   #4
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 309
Script for you

Here's a JavaScript for you that does exactly what you want. I have tested it.

As configured, it assumes you have created the first 'route' with the name Line0.
You configure things at the start - such as the number of lines and their spacing.
See the plugin User Manual to understand the OCPN interfacing.

You can modify as required - enjoy!

Code:
name = "Line"
number = 3;	// number of parallel lines to add
space = 1;	// line spacing in nm

// find base line
baseName = name + "0";
routeGUIDs = OCPNgetRouteGUIDs();
found = false;
for (i = 0; i < routeGUIDs.length; i++){
	route = OCPNgetRoute(routeGUIDs[i]);
	if (route.name == baseName) {
		found = true;
		break;
		}
	}
if (!found) throw("Cannot find base line ", baseName);
if (route.waypoints.length != 2) throw("Route " + route.name + " does not comprise just two waypoints");

// calculate the vector to move each waypoint
linebearing = OCPNgetVectorPP(route.waypoints[0].position, route.waypoints[1].position);
vector = {bearing: (linebearing.bearing+90)%360, distance: space};

// create extra lines
for (i = 1; i <= number; i++){
	route.name = name + i;
	start = route.waypoints[0].position;
	end = route.waypoints[1].position;
	route.waypoints[0].position = OCPNgetPositionPV(start, vector);
	route.waypoints[1].position = OCPNgetPositionPV(end, vector);
	delete route.waypoints[0].GUID;	//need to delete this so new waypoint created
	delete route.waypoints[1].GUID;
	OCPNaddRoute(route);
	}
Antipole is offline   Reply With Quote
Old 27-10-2022, 14:40   #5
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,695
Images: 2
Re: OpenCPN as lineplanning tool

I think you should try OcpnDraw plugin. It has several drawing tools that will help.
rgleason is offline   Reply With Quote
Old 01-11-2022, 16:07   #6
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,695
Images: 2
Re: OpenCPN as lineplanning tool

I like antipole's solution. Ocpn-draw does have a parallel line tool used for creating convenient navigation offsets.
rgleason is offline   Reply With Quote
Reply

Tags
enc, opencpn


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
Favorite Barnacle tool? Tropic Cat Construction, Maintenance & Refit 23 29-04-2016 15:28
Let's See Your Boat's Workbench, Tool Shed, Tool Box . . . Ocean Roads Construction, Maintenance & Refit 46 12-10-2010 16:22
Norwolf's 'Missing Link' Tool ? GordMay Construction, Maintenance & Refit 3 15-02-2008 12:38
Miracle tool Alan Wheeler Construction, Maintenance & Refit 26 11-09-2007 00:09
Google Earth a Great Sailing Tool Frank4 General Sailing Forum 24 27-12-2006 10:30

Advertise Here


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


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.