Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-08-2016, 11:20   #1366
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 3,945
Re: Ocpn-Draw and Boundary

Sean...
Yes, you need to hack the plugin if you want the rest.

Pavel
__________________

__________________
nohal is offline   Reply With Quote
Old 06-08-2016, 14:26   #1367
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 872
Re: Ocpn-Draw and Boundary

Sean,
I would prefer that you don't "hack" the plugin, but would rather you create a pushable update, preferably tested. I think your changes 'may' introduce complexities for the users, so careful thought will be needed to ensure a novice user is not confused. Perhaps your requirements should be put in a flyspray so that they don't get lost in the forum, possibly with a bit more of an explanation. There are already a couple of other items that users would like so I think this should be for the 1.4 version of OD. This would allow us to create a 1.3 'testing' version without interrupting/impacting current users.

I cannot work on this plugin for the next 8 weeks or so as I am on the boat and don't have a suitable pc and internet access for more than very simple changes. Can this wait till then?

Jon
__________________

__________________
jongough is offline   Reply With Quote
Old 06-08-2016, 14:41   #1368
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 872
Re: Ocpn-Draw and Boundary

Sean,
Looking at your ideas can you expand on them a bit?
Quote:
2) click and raw bounding points to move them *
3) drag edges of boundaries to enlarge a boundary (moving 2 points) *
4) merge selected boundaries
5) convert a boundary to another boundary which is just lat/lon box with 4 points (I can do this in a script if needed)
In item 2 I am not quite sure what "click and raw" means. Do you mean left mouse button down and drag the point without invoking the popup menu? Or is it something else altogether?

In item 3 do you want three dragging modes:
  1. Drag boundary line maintaining direction but allowing movement both vertically and horizontally
  2. Drag boundary line maintaining direction and current latitudes of end points
  3. Drag boundary line maintaining direction and current longitudes of end points
In item 4 how do you want to merge boundaries?
  • Merge lines and maintain all boundary points
  • Merge boundaries but redraw lines to encompass all 'exterior' points deleting all 'interior' points
  • Merge boundaries, but allow complex shapes with windings and 'inclusion'/'exclusion' areas, i.e. holes in the boundaries
  • Create a completely new boundary as a sort of 'bounding box' to smooth out any 'indents' in the boundaries
  • Other?
In item 5 what do you mean by convert a boundary? Is this just a boundary copy so you get another boundary exactly the same as the original with a new GUID and, possibly, offset from the original to make selection easier? Or do you want a new 4 point boundary which is, essentially, a bounding box around the selected boundary? There is a request for a 'boundary copy' which I was thinking of putting in the next version.

Jon
__________________
jongough is offline   Reply With Quote
Old 06-08-2016, 14:47   #1369
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 872
Re: Ocpn-Draw and Boundary

Sean,
The current implementation of OD was built with the idea that 0 -> 100 boundaries may be used, it did no consider the use of thousands of boundaries.
Quote:
I am having some issues with the draw plugin not handling 20,000 boundaries reasonably and getting stuck "sorting" when the dialog isn't even visible etc...
Can you explain the issue you are having, what are the symptoms, etc, and what suggestions you have for improving the process. I am not really sure how the OD Manager can handle this number of objects reasonably. Possibly some sort of filtering by lat/lon, but....

Does the Route Manager in OCPN handle this number of objects OK? If so, I may be able to use a similar technique.

As a matter of interest, what are you using this number of boundaries for?

Jon
__________________
jongough is offline   Reply With Quote
Old 06-08-2016, 16:09   #1370
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: North Carolina
Boat: bristol 27
Posts: 2,721
Re: Ocpn-Draw and Boundary

Quote:
Originally Posted by jongough View Post
Sean,
The current implementation of OD was built with the idea that 0 -> 100 boundaries may be used, it did no consider the use of thousands of boundaries.
I am using thousands of boundaries.

I can work in smaller sets of a few hundred at a time, but it isn't ideal. It would be nice to work on each set (5 sets of 500-3000 boundaries) together.

The boundaries are regions of interest for generating kap charts from tile servers covering the entire world. There are 5 different zooms or scales. The smallest corresponds to level 17 which is used for narrow passes or harbors where you have 30 meters or less of channel width to navigate.

These boundaries can be used to automate chart creation covering areas or the entire world while minimizing data transfer and requests (avoiding areas over land or sea that are not interesting)

Quote:
Can you explain the issue you are having, what are the symptoms, etc, and what suggestions you have for improving the process. I am not really sure how the OD Manager can handle this number of objects reasonably. Possibly some sort of filtering by lat/lon, but....
It can handle just fine if it does what it does now but didn't take forever to perform certain operations.

Quote:
Does the Route Manager in OCPN handle this number of objects OK? If so, I may be able to use a similar technique.
I don't know about thousands of routes, possibly, but I do know it can handle tracks with millions of points.

Quote:
Originally Posted by jongough View Post
Sean,
Looking at your ideas can you expand on them a bit?


In item 2 I am not quite sure what "click and raw" means. Do you mean left mouse button down and drag the point without invoking the popup menu? Or is it something else altogether?
typo, sorry. I mean click and drag. I want to be able to drag the waypoints of the boundaries to move them. I also want to drag the edges (to move both points in the edge while preserving the length and orientation of the edge. And also be able to drag the entire boundary.
Quote:
In item 3 do you want three dragging modes:
  1. Drag boundary line maintaining direction but allowing movement both vertically and horizontally
  2. Drag boundary line maintaining direction and current latitudes of end points
  3. Drag boundary line maintaining direction and current longitudes of end points
Yes, exactly, using ctrl or shift modifiers to restrict movement to latitude or longitude.
Quote:
In item 4 how do you want to merge boundaries?
  • Merge lines and maintain all boundary points
  • Merge boundaries but redraw lines to encompass all 'exterior' points deleting all 'interior' points
  • Merge boundaries, but allow complex shapes with windings and 'inclusion'/'exclusion' areas, i.e. holes in the boundaries
I don't need this, but it might be useful...
  • Create a completely new boundary as a sort of 'bounding box' to smooth out any 'indents' in the boundaries
[quote]
My particular case, I just want to select 3 boundaries, and create a new boundary which is just a simple bounding box (4 points) that contains all the points in the boundary.

I realize this might be a special case so maybe I should make a special hack for it. The reason is I have 20,000 boxes but should have only 12,000 or so, because many of them are right next to each other and very narrow.
__________________
boat_alexandra is offline   Reply With Quote
Old 07-08-2016, 04:38   #1371
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 8,291
Re: Ocpn-Draw and Boundary

Sean, Jon. You guys are out of my league! but, you each ave different styles for programming, and needs. What about a "hack" by Sean so he can get things done, (it sounds like he needs the tools now for simplifying tiles) with the idea that he makes a pull request for some of the more typical boundary tools that users might want?
-Just to let you know, I enjoyed your dialogue, had a few chuckles while trying to figure out what Sean was trying to do...20000 boundaries (tiles) for the world? Hope you can automate some of it Sean!
__________________
rgleason is offline   Reply With Quote
Old 07-08-2016, 16:22   #1372
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 872
Re: Ocpn-Draw and Boundary

Sean,
You can move individual boundary points by right mouse clicking on the point and select "Move Boundary Point" then left mouse button down and drag. The point "which should be highlighted" will move with the mouse until the left mouse button is released.

You can also move a whole boundary by right mouse clicking the boundary line and selecting "Move Boundary". Then left mouse button down and drag.

What operations are taking the time? I cannot setup and test this at the moment, but I would like to get a handle on where the improvements may be needed.

Do you need these changes now, or can you wait until Oct?

If you want to change the code go for it, but if you want it incorporated into the mainline OD stuff can you please use a simplistic coding style, I have difficulty understanding the more 'advanced' styles (I have to keep on rethinking what is being done and how)?

It looks like there are a number of changes that need to go into the next version:
  • Better bounding boxes and checking of these in the API/JSON (I have bee waiting for your changes to make it into OCPN and then use those)
  • Move boundary lines with non constraint, lat constraint, lon constraint
  • Copy boundaries
  • Merge boundaries
  • Bounding box around multiple boundaries
  • Possibly rework the display and update of boundaries/points in the path manager (use a smart list only slightly bigger than the display and use smart scrolling)
Are there any others to do with boundaries?


Jon
__________________
jongough is offline   Reply With Quote
Old 10-08-2016, 13:26   #1373
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 8,291
Re: Ocpn-Draw and Boundary

Jon,
I like your idea, I think this thread should remain the development thread and a new one be made for "ODraw Use & Interaction" with other plugins.
__________________
rgleason is offline   Reply With Quote
Old 13-08-2016, 01:04   #1374
Registered User

Join Date: Mar 2009
Location: Currently in Malaysia
Boat: Valiant Esprit 37
Posts: 116
Re: Ocpn-Draw and Boundary

Finally uploaded from 4.0 to 4.4 and was able to install the Draw Plugin and take a quick test drive. Thanks so much for the EBL lines! Just what I've wanted.

Do have one possible suggestion and I don't know if it's already been asked or answered. It would be nice if there was a way that we could turn on/off an option that would display a small box on the screen near the waypoint that shows the current bearing and distance to the waypoint, and update that information as the boat travels so you don't have to hover over the EBL line to see that information. Similar to the small box that shows when you want to "move" the EBL waypoint. It only needs 2 pieces of information, Bearing and distance.

Thanks for putting this all together! It's a great tool!

Gene
__________________
reflectionsv37 is offline   Reply With Quote
Old 14-08-2016, 07:24   #1375
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: North Carolina
Boat: bristol 27
Posts: 2,721
Re: Ocpn-Draw and Boundary

I did not get the boundary menu, and also now other crashes because you are using chcanv.h directly by the plugin which is not in sync with my opencpn. The plugins are meant to use the plugin interface only.


Another problem:

If I move a boundary, I can't undo it? Can't we re-use the undo interface somehow? Maybe you should embed the move logic more into opencpn and create iterfaces to access it rather than recreate the menu in the plugin. This would allow for undo automatically, but also other plugins could take advantage of this interface (like weather routing) to move and select waypoints etc without any duplicated code anywhere.
__________________
boat_alexandra is offline   Reply With Quote
Old 14-08-2016, 15:07   #1376
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 872
Re: Ocpn-Draw and Boundary

Sean,
All the code from OCPN that I am using is within the project. All the OCPN header files are in ocpninclude and source is in ocpnsrc. I am not using any code that is in OCPN project, if i did windows will not compile/run. So it should all work OK. I have not heard of the right click popup not showing for OD objects so I am not sure what is wrong. Can you try a standard installation of the plugin and see if the right click works then? I have tested on win 7 & 10, arm and Ubuntu and it all seems to work OK. Most of the included header files from OCPN are their as they are referenced in other headers, but OD does not use them. As far as I know I am only using the plugin interface (again windows builds will not work if you access functions directly).

In the early days of the plugin I removed the undo code (commented it out) as it was not working, and as yet, no one has asked for it. Can you raise a flyspray request for it so that I can work on it when I get back from the boat?

I wanted the boundary code to be in the mainline but Dave wanted it to be a plugin, so that is what it now is. OD does not use waypoints, routes or tracks, although the code is/was heavily based on that, instead it uses points and paths which are then used to construct all the OD object types. I think it could do routes, waypoints and tracks quite easily so that these could be removed from the mainline code (make the main modules in OCPN MUCH smaller and easier to maintain), but this is for others to decide.

Interacting with the mainline menus was too difficult when OD was built and would require more api's. It is possible, but is it worth the effort?

I think the OCPN undo code is specific to its objects and would require rework to be made generic. Its a bit like the navobj.xml code, ODnavobj.xml is based on it but is now quite different as there is no real standard for the object types that OD is using. The same goes for SignalK (there don't yet appear to be any extensions that can be used).

Jon
__________________
jongough is offline   Reply With Quote
Old 15-08-2016, 04:19   #1377
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: North Carolina
Boat: bristol 27
Posts: 2,721
Re: Ocpn-Draw and Boundary

Quote:
Originally Posted by jongough View Post
Sean,
All the code from OCPN that I am using is within the project. All the OCPN header files are in ocpninclude and source is in ocpnsrc. I am not using any code that is in OCPN project, if i did windows will not compile/run. So it should all work OK. I have not heard of the right click popup not showing for OD objects so I am not sure what is wrong. Can you try a standard installation of the plugin and see if the right click works then? I have tested on win 7 & 10, arm and Ubuntu and it all seems to work OK. Most of the included header files from OCPN are their as they are referenced in other headers, but OD does not use them. As far as I know I am only using the plugin interface (again windows builds will not work if you access functions directly).
You have extern to cc1 but did not clone chcanv.cpp, only the header. This is why it was crashing. It may work with one version of opencpn, but not with the branch I am working on.
Quote:
In the early days of the plugin I removed the undo code (commented it out) as it was not working, and as yet, no one has asked for it. Can you raise a flyspray request for it so that I can work on it when I get back from the boat?
ok

Quote:
I wanted the boundary code to be in the mainline but Dave wanted it to be a plugin, so that is what it now is. OD does not use waypoints, routes or tracks, although the code is/was heavily based on that, instead it uses points and paths which are then used to construct all the OD object types. I think it could do routes, waypoints and tracks quite easily so that these could be removed from the mainline code (make the main modules in OCPN MUCH smaller and easier to maintain), but this is for others to decide.
We cannot remove tracks routes or waypoints from the core. Instead we could add a new API to define new types, but maybe they should remain separate for now.

Is there anyway to just move the boundary points by dragging them rather than having to right click and select move first?
Quote:
Interacting with the mainline menus was too difficult when OD was built and would require more api's. It is possible, but is it worth the effort?
Possibly
Quote:
I think the OCPN undo code is specific to its objects and would require rework to be made generic. Its a bit like the navobj.xml code, ODnavobj.xml is based on it but is now quite different as there is no real standard for the object types that OD is using. The same goes for SignalK (there don't yet appear to be any extensions that can be used).

Jon
__________________
boat_alexandra is offline   Reply With Quote
Old 15-08-2016, 14:13   #1378
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 872
Re: Ocpn-Draw and Boundary

The use of cc1 for cursor pointers may need another api to fix the issue, one to get the pointer to the particular pointer icon that is to be used. The pointer icon needs to be accessible to mainline as it will use this to draw the pointer in use (this was added to stop the pointer from flickering when a plugin wanted to change it).

Currently you have to right click on OD objects to get the dropdown menu and then select move from there. It would be possible to move the object by just left draggibg it, but this will also require changes to the boundary point dialog and the save/restore code. Can you raise a flyspray on this? Do other OD objects also require this functionality?

I only have a tablet accessing the internet, badly due to poor coonection, at the moment, so doing too much is a pain. Even email is hit and miss

Jon
__________________
jongough is offline   Reply With Quote
Old 05-11-2016, 13:23   #1379
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 872
Re: Ocpn-Draw and Boundary

Hi,
I am now back on a system I can work on. I have started a new version of OD, 1.3, as a beta test of some of the stuff being discussed. Currently 1.3.0 has the following in it:
  • Move boundary with no constraint, latitude only, longitude only using Ctrl and Shift keys to modify the behaviour
  • Move boundary line segment with no constraint, latitude only, longitude only using Ctrl and Shift keys to modify behaviour
  • Move Path point (Boundary Point, EBL Point and GZ Point) with no constraint, latitude only, longitude only using Ctrl and Shift keys to modify the behaviour
  • Move any isolated ODPoint (Boundary Point, Text Point) no constraint, latitude only, longitude only using Ctrl and Shift keys to modify the behaviour
  • Removed code referring to cc1 cursors
  • Implemented Seans improved LLBox code into all objects
I am currently thinking about the left click and drag of objects, the merging/surrounding of selected boundaries by a single boundary, parallel lines (possibly based on EBL's) and also the 'undo' code, but not sure about this one yet.

Any others?

Jon
__________________
jongough is offline   Reply With Quote
Old 05-11-2016, 15:54   #1380
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 8,291
Re: Ocpn-Draw and Boundary

Just an idea, at this point:

Using EBL code, but perhaps make a new object "Vector" with two parameters
1. Speed
2. Direction

Create a simple nmea inteface/filter which will "catch" user defined nmea data types which have speed & direction to populate the "Vector" object.

Allow naming, style (color & thickness),etc of the vector object.

Allow the Vector object
1. Be fixed position
2. Move with the boat.
3. Attached to the arrow of another vector
4. Attached to the shaft of another vector

PS: Jon, welcome back! Where did you go? Hope you had a great voyage!
__________________

__________________
rgleason is offline   Reply With Quote
Reply

Thread Tools
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
Rookie questions - boundary circles; exporting options; GPX files fredgmeyer OpenCPN 5 23-05-2014 22:22
Buoys out in Boundary Bay, BC Carogan Liveaboard's Forum 0 27-08-2012 06:41
For Sale: Cascade Designs Seal Line Boundary 70 Dry Bag thesparrow Classifieds Archive 0 14-03-2011 15:27
Current draw and insulation of portable fridges troppo Plumbing Systems and Fixtures 6 06-03-2011 09:00
amperage draw for Garmin radar and MFD janders Marine Electronics 8 16-12-2008 17:00


Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

Automotive Communities

Our Automotive communities encompass many different makes and models. From U.S. domestics to European Saloons.

» More about our Automotive Communities

Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities


Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 01:50.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.