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 12-09-2017, 09:14   #1
Registered User

Join Date: May 2017
Location: Delft, NL
Boat: Hurley
Posts: 27
KAP header from scratch

Hi all, I'm working on a small applet to create my own OpenCPN charts from scratch (scratch==point-measurements from depths). I've gone all the way and now I'm up to the stage of converting my .png files into .kap charts. This is my first time creating headers, using imgkap, libbsb etcetera.

For each .png image, I have the N,E,S,W extents in degrees and the size in pixels. Is it true I can build an entire header from just this data? I have no clue about resolution or whatsoever.

Now well, I thought it was that simple. So using python I created some of my own headers. None of them succeeded after converting it using imgkap.
Then I just put a .png into MapCal, do the manual calibration and then convert it using imgkap. Now, the .kap file can be opened in FME (another geo-software-package), but is not showing up in OpenCPN.

Without the MapCal calibration (but my own) the log says:
5:37:53 PM: Loading chart data for C:\imgkap\zeeland.kap
5:37:53 PM: ...initialization failed for C:\imgkap\zeeland.kap
5:37:53 PM: CreateChartTableEntry() failed for file: C:\imgkap\zeeland.kap

With the MapCal calibration:
6:00:15 PM: Loading chart data for C:\imgkap\zeeland.kap
6:00:15 PM: Adding chart file: C:\imgkap\zeeland.kap

So it does seem to have effect. It's just not showing up on my screen. Can somebody point me in the right direction of what I'm doing wrong, or is it just a stupid setting?

I've also attached the .kap file. (replac the .doc)
Attached Files
File Type: doc zeeland.doc (180.8 KB, 30 views)
Baksteen is offline   Reply With Quote
Old 12-09-2017, 10:37   #2
Registered User

Join Date: Oct 2014
Posts: 274
Re: KAP header from scratch

Quote:
Originally Posted by Baksteen View Post
Hi all, I'm working on a small applet to create my own OpenCPN charts from scratch (scratch==point-measurements from depths). I've gone all the way and now I'm up to the stage of converting my .png files into .kap charts. This is my first time creating headers, using imgkap, libbsb etcetera.

For each .png image, I have the N,E,S,W extents in degrees and the size in pixels. Is it true I can build an entire header from just this data? I have no clue about resolution or whatsoever.

Now well, I thought it was that simple. So using python I created some of my own headers. None of them succeeded after converting it using imgkap.
Then I just put a .png into MapCal, do the manual calibration and then convert it using imgkap. Now, the .kap file can be opened in FME (another geo-software-package), but is not showing up in OpenCPN.

Without the MapCal calibration (but my own) the log says:
5:37:53 PM: Loading chart data for C:\imgkap\zeeland.kap
5:37:53 PM: ...initialization failed for C:\imgkap\zeeland.kap
5:37:53 PM: CreateChartTableEntry() failed for file: C:\imgkap\zeeland.kap

With the MapCal calibration:
6:00:15 PM: Loading chart data for C:\imgkap\zeeland.kap
6:00:15 PM: Adding chart file: C:\imgkap\zeeland.kap

So it does seem to have effect. It's just not showing up on my screen. Can somebody point me in the right direction of what I'm doing wrong, or is it just a stupid setting?

I've also attached the .kap file. (replac the .doc)
Your zeeland.kap file loaded and displayed okay in OpenCPN on my PC. Here is a screenshot.

Click image for larger version

Name:	zeeland.kap.png
Views:	130
Size:	292.9 KB
ID:	155955

This appears to have been created using MapCal2 and mc2bsbh and possibly KapGen.

In order to display the chart, I had to know the approximate latitude and longitude. So, I looked at the border polygon values in the header. Then, I centered my OpenCPN at that corner.

You could right click on the chart canvas in OpenCPN and select "Center View". Enter "51 42 N" for latitude and "4 27 E" for longitude. The Center View dialog box is in the screenshot. You might have to zoom in or out to see the chart. It is usually easier to find new charts if you have "Show Chart Outlines" enabled in O.

Paul
.Paul. is offline   Reply With Quote
Old 13-09-2017, 00:41   #3
Registered User

Join Date: May 2017
Location: Delft, NL
Boat: Hurley
Posts: 27
Re: KAP header from scratch

Thanks for checking Paul, but strangly it still doesn't work for me. I indeed know the location of the chart and chart outlines are also enabled (they work for others).

for now, the charts are indeed generated with the use of mc2bsbh and a manual MapCal calibration. But as soon I can see a little it of chart on my screen, I'll skip that step.

What is your openCPN version?
Baksteen is offline   Reply With Quote
Old 13-09-2017, 05:24   #4
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 511
Re: KAP header from scratch

@Baksteen,
Here the same, good looking on O4.8.
BTW if you come to zeilersforum.nl, you find more people working on simular charts. And the communication is in dutch;-)
Dirk
__________________
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 13-09-2017, 06:53   #5
Registered User

Join Date: May 2017
Location: Delft, NL
Boat: Hurley
Posts: 27
Re: KAP header from scratch

Thanks, after checking everything I reinstalled OpenCPN. Now they'll show up fine, strangely with use of the same versions..

@rooiedirk
I'm already on Zeilersforum Just thought there was more knowledge on openCPN and kap files over here. When the full workflow is done and results are satisfying for me, Ill definitely share it on Zeilersforum. But for now mainly the interpolation-part is a bit tricky. Give me a week!
Baksteen is offline   Reply With Quote
Old 13-09-2017, 08:27   #6
Registered User

Join Date: Oct 2014
Posts: 274
Re: KAP header from scratch

Quote:
Originally Posted by Baksteen View Post
Thanks for checking Paul, but strangly it still doesn't work for me. I indeed know the location of the chart and chart outlines are also enabled (they work for others).

for now, the charts are indeed generated with the use of mc2bsbh and a manual MapCal calibration. But as soon I can see a little it of chart on my screen, I'll skip that step.

What is your openCPN version?
Yesterday, when I made the screenshot, I used my build of OpenCPN 4.8.0 modified by commits through 07 Sep. 2017 made by bdbcat, the lead developer.

This morning, I used the official release of OpenCPN 4.8.0 for Windows, and it displays your sample chart the same as in my screenshot.

Whenever a KAP is added to OpenCPN's Chart Directories you should have the program run the "Scan Charts and Update Database". This also should be run if you make a change to a KAP that was previously in the chart database. Also, if you use chart groups other than the default "All Active Charts" group you must make sure that the new chart is included in the chart group that you are using.

Paul
.Paul. is offline   Reply With Quote
Old 13-09-2017, 23:54   #7
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: KAP header from scratch

Quote:
Originally Posted by .Paul. View Post
Whenever a KAP is added to OpenCPN's Chart Directories you should have the program run the "Scan Charts and Update Database". This also should be run if you make a change to a KAP that was previously in the chart database. Also, if you use chart groups other than the default "All Active Charts" group you must make sure that the new chart is included in the chart group that you are using.
We do have computers, haven't we?
Why the software doesn't do that by itself automatically?
There is something wrong.

Gerhard
CarCode is online now   Reply With Quote
Old 14-09-2017, 02:17   #8
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: KAP header from scratch

Quote:
Originally Posted by CarCode View Post
We do have computers, haven't we?
Why the software doesn't do that by itself automatically?
There is something wrong.

Gerhard
We don't all have super fast computers and we don't want the program wasting valuable time scanning for files that probably have not changed in many days. There is nothing wrong here.
transmitterdan is offline   Reply With Quote
Old 14-09-2017, 02:39   #9
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: KAP header from scratch

Quote:
Originally Posted by transmitterdan View Post
There is nothing wrong here.
Nothing a click on the "add to ignore list" button doesn't sort out
conachair is offline   Reply With Quote
Old 14-09-2017, 07:20   #10
Registered User

Join Date: Feb 2011
Posts: 1,108
Re: KAP header from scratch

It works OK except that the colours looks a bit weird, specially for the depth area. But good job otherwise.
Bye
P_Dub is offline   Reply With Quote
Old 14-09-2017, 08:43   #11
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: KAP header from scratch

Quote:
Originally Posted by transmitterdan View Post
We don't all have super fast computers and we don't want the program wasting valuable time scanning for files that probably have not changed in many days. There is nothing wrong here.
A modern operating system knows when a file or the content of a folder has changed. Anyway there is no support for 20 year old computers in OCPN. So this argumentation is wrong.
Changing or adding a chart file should result in a new database scan automatically. Any smart developer can code that.

Gerhard
CarCode is online now   Reply With Quote
Old 14-09-2017, 08:53   #12
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: KAP header from scratch

We await your pull request with great anticipation...
transmitterdan is offline   Reply With Quote
Reply

Tags
head


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
Header Tank To Eliminate Saildrive Salt Water Intrusion timbenner Propellers & Drive Systems 39 25-09-2023 05:33
Header Tank Question Dockhead Plumbing Systems and Fixtures 10 05-03-2016 15:02
High diesel filter location or header tank Snowpetrel Engines and Propulsion Systems 27 01-02-2015 08:55
Chart Header Modification turtleback OpenCPN 5 29-01-2015 09:53
.kap files header r2b2s OpenCPN 5 14-05-2012 09:13

Advertise Here


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


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.