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 03-08-2017, 05:56   #1
Registered User

Join Date: Aug 2017
Posts: 4
Plugin development... How to receive chart objects in my plugin?

Hi,
My plugin wants to read objects found in the vector charts.
I've seen that a flag WANTS_VECTOR_CHART_OBJECT_INFO sends object information to plugins.
But it's far from working (for what I expected it to do...).
First of all, chart objects seem to be parsed (and sent to plugins) before the plugins have been loaded. Have I missed some plugin option?
Second, not all objects are sent to the SendVectorChartObjectInfo in pluginmanager. For example, not the SOUNDG.
Third, I would like to have the full S57Obj, not only lat, lon and scale.

I'm going to be a well thinker, and suppose that this flag is not broken, but there are some case uses that make it's functionality what it is now.

How can I then get that objects I want in my plugin?

If that required to modify the plugin interface and create a new version, would it be okay to push my modifications to OpenCPN?
dmartinez is offline   Reply With Quote
Old 03-08-2017, 06:24   #2
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,737
Re: Plugin development... How to receive chart objects in my plugin?

Can you perhaps explain a bit more what you want to implement?
The objects and attributes you want to use?
bcn is offline   Reply With Quote
Old 03-08-2017, 10:24   #3
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 511
Re: Plugin development... How to receive chart objects in my plugin?

Maybe it could be done for S57 charts, but not for the encrypted S63 or oeSENC charts.
Having access to the objects of the encrypted charts would make it rather easy to write a plugin that would export unencrypted charts from encrypted sources.
__________________
Navigation is know where you are and what to do to get where you want.
But also: Know where you don't want to be and what to do to don't get there.
rooiedirk is offline   Reply With Quote
Old 03-08-2017, 23:03   #4
Registered User

Join Date: Aug 2017
Posts: 4
Re: Plugin development... How to receive chart objects in my plugin?

Quote:
Originally Posted by bcn View Post
Can you perhaps explain a bit more what you want to implement?
The objects and attributes you want to use?
I want to use SetPositionFix's latitude and longitude to estimate expected depth in that point. I think I can take the soundings in the chart: latitude, longitude and depth, which are also rendered in the canvas, and with some mathgic get the depth for any point. I could then print the depth in Dashboard or an overlay.

The proof-of-concept of the first part is working already: I print traces from the rendering or ingest methods, work the traces outside OpenCPN and lookup some points for their depth.

If I cannot work this through a plugin, I still can use a simpler plugin just to throw the fix out of OpenCPN, and then return the depth to OpenCPN through NMEA.

I prefer the plugin thing, because OpenCPN will keep evolving and a plugin is easier to use than a patch to the code, and it can contribute to the OpenCPN ecosystem. I haven't seen other plugins doing similar things.
dmartinez is offline   Reply With Quote
Old 03-08-2017, 23:47   #5
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,737
Re: Plugin development... How to receive chart objects in my plugin?

So something like a "preventive depth checker"?

Would fit nice into a concept of a route checker.

As Dirk explained not that an issue with plain S-57, but a different story with the encrypted formats, where you have to prevent that the charts get "harvested".

But I can imagine a function for the chart plug-ins to warn about hazards a given position (depth, rocks, land fall, protected areas, fish farm...).
Handy for auto-routing or autonomous vessels too. Watchdog relies today either on the GSSHG map or Boundaries from theDraw-PI.

Hubert
bcn is offline   Reply With Quote
Old 04-08-2017, 00:44   #6
Registered User

Join Date: Aug 2017
Posts: 4
Re: Plugin development... How to receive chart objects in my plugin?

Quote:
Originally Posted by rooiedirk View Post
Maybe it could be done for S57 charts, but not for the encrypted S63 or oeSENC charts.
Do you mean "can't" or "mustn't"? I know nothing about those formats, but if OpenCPN can open those charts and render the information in them, then that information could be extracted via printing traces anyway.

Quote:
Originally Posted by bcn View Post
... a different story with the encrypted formats, where you have to prevent that the charts get "harvested".
(I saw this comment during the "preview post".) So "mustn't". I guess the best I can do is that to extract data *out* of OpenCPN is not easier with the plugin than without it, i.e., still requiring to modify sources, place traces and so.

I expected to be problems with licensing. I hope processing them the way I want to (know them outside the render method, maybe extract them outside OpenCPN, do maths on them...) won't get me in jail.

For example, NOAA ENCs User Agreement say "The NOAA ENCs are intended for navigational use. They are intended to be used in their electronic form only. You may download, use, and redistribute them without restriction, and without payment to NOAA, except as noted herein". I guess that as long as I use these for navigation, or at least for planning navigation, or education for future navigation, I won't get in trouble. Not that I'm trying to write a videogame or do underwater real estate prospection.

Other particular sources licenses could be more restrictive. But should the plugin be aware of that, if I just want to print extended information not directly available in the charts, but depending directly on them?

Still, I'd like to know if there are other licensing issues I should be careful with.
dmartinez is offline   Reply With Quote
Old 04-08-2017, 00:56   #7
Registered User

Join Date: Aug 2017
Posts: 4
Re: Plugin development... How to receive chart objects in my plugin?

Quote:
Originally Posted by bcn View Post
So something like a "preventive depth checker"? Would fit nice into a concept of a route checker.
[...]
warn about hazards a given position (depth, rocks, land fall, protected areas, fish farm...). Handy for auto-routing or autonomous vessels too.
Heck, I was so focused in the soundings just to show depth thing, that I didn't even considered the last and most safety important line of "soundings" which is the coastline That will be a TODO for the moment.

But, yes, that would be the general idea, being able to do a bit more than just painting things. With the same plugin interface other plugins could do all you suggest.
dmartinez is offline   Reply With Quote
Reply

Tags
men, plug


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
OpenCPN PlugIn Development bdbcat OpenCPN 161 04-09-2019 12:50
4.6.x always shows chart information objects Sail323 OpenCPN 1 25-04-2017 07:54
APRS Plugin Development alawatsakima OpenCPN 8 21-09-2015 12:21
Plugin Development Question pelle2004 OpenCPN 3 04-07-2012 01:00
New Plugin Development on Linux globalkeith OpenCPN 5 03-05-2012 07:16

Advertise Here


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


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.