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 26-10-2009, 15:54   #31
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
Marco...

Here's my pennies worth of the accumulating Chartcal.Dir file.
I now re-name the file like 'NorthAtlantic-CHARTCAL.DIR' and store them in a special directory for future reference,having first deleted any un-wanted data. The file upload is not working tonight it seems so here is the listing:

[NATLANTIC.BMP]
NA=The North Atlantic
FN=NATLANTIC.BMP
GR=0
PY=1
QU=0
SC=10000000
BC=4
B1=45.8311272648189,-103.302140797505
B2=-13.2030240180558,-102.899391623284
B3=-12.83004273726,-0.693874240108138
B4=45.7284884968816,-1.12193451763188
CC=8
C1=7507,6239,5.160400000000,-35.485133333333
C2=4679,4504,10.493916666667,-61.069900000000
C3=2556,2728,25.590950000000,-80.099283333333
C4=3684,600,41.671666666667,-69.951050000000
C5=10452,1258,37.023183333333,-8.996850000000
C6=9471,2338,28.835750000000,-17.780750000000
C7=9511,4023,14.722933333333,-17.502933333333
C8=10595,5189,4.308333333333,-7.455766666667
GD=WGS84
NU=
PR=1
DS=0,0
WI=11345
HE=7281
DX=714.66
DY=714.66
LAT0=0
LON0=0
DT=0
LATS=0
LATN=0
DU=0
PC=0

[PACIFIC-4051.BMP]
NA=The Pacific
FN=PACIFIC-4051.BMP
GR=0
PY=1
QU=0
SC=10000000
BC=4
B1=41.1787129400953,-166.011676057188
B2=-15.0478302471328,-165.745844654376
B3=-13.1943867686084,-73.8042152773058
B4=42.4036471045372,-74.124189282255
CC=4
C1=5042,3091,0.911866666667,-89.429550000000
C2=735,1727,19.518516666667,-154.810700000000
C3=2792,265,38.957883333333,-123.741500000000
C4=3980,1670,20.399950000000,-105.714050000000
GD=WGS84
NU=
PR=1
DS=0,0
WI=6074
HE=4062
DX=1226.21
DY=1226.21
LAT0=0
LON0=0
DT=0
LATS=0
LATN=0
DU=0
PC=0
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 26-10-2009, 17:17   #32
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Quote:
Originally Posted by jonasaberg View Post
Dan
Reply to your #15
Please find an example file. I added .txt to the end, just remove.

(I made this file by converting a kap file I own to tif, and then converting it to png, calibrated it and converted back to kap just to learn...)

/Joans
Can you (or anyone) confirm that there will always be a space in the first position of all continuation lines?

As for the multiples, I am considering this possibility:

A switch -b for batch. -b extension

If run in batch mode, it will look for [nz1404.png] file in the header, then create a file of nz1404.extension

It will just loop through and create multiples.

Now that I have said that, we'll see if I can do it.

What do you think?

-dan
dacust is offline   Reply With Quote
Old 27-10-2009, 10:18   #33
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 309
Dan,
I think your suggestion with a -b switch make sense. That makes it possible to go through and create calibrations for a bunch of files and then create tif2bsb templates in batch, or if the user prefers ultimate control, to create them one at a time.

I suggest that if there is more then one set of calibration data in the chartcal.dir file and the user does not use the -b switch, that there is an error message in this approximate style:
"Error: Multiple errors in the chartcal.dir file. Please use the -b switch or erase all but one entry in the chartcal.dir file."

I dont know for a fact that multiple lines start with a blank, but it certainly seems so. I think it seems fairly safe to assume this is the case, at least for the CR parameter.

/J
jonasaberg is offline   Reply With Quote
Old 27-10-2009, 17:35   #34
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Quote:
Originally Posted by jonasaberg View Post
Dan,
I think your suggestion with a -b switch make sense. That makes it possible to go through and create calibrations for a bunch of files and then create tif2bsb templates in batch, or if the user prefers ultimate control, to create them one at a time.

I suggest that if there is more then one set of calibration data in the chartcal.dir file and the user does not use the -b switch, that there is an error message in this approximate style:
"Error: Multiple errors in the chartcal.dir file. Please use the -b switch or erase all but one entry in the chartcal.dir file."

I dont know for a fact that multiple lines start with a blank, but it certainly seems so. I think it seems fairly safe to assume this is the case, at least for the CR parameter.

/J
My thinking, also. I'll see how hard it is to implement.

And the CR part will be pretty easy.

Thanks,

-dan
dacust is offline   Reply With Quote
Old 28-10-2009, 04:19   #35
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
I need to re-adjust a previously calibrated name.kap file.
MapCal can read name.bsb files but will not accept our conversions.
Is there any other way to re-adjust calibrations than doing it all over again?
Basically I just want to adjust the frame corner geo locs.
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 28-10-2009, 06:45   #36
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
Marco/Dan...

I re-calibrated my Pacific.tif map,using only the scaled corners to obtain the geo locs and also the x,y, parameters from the same corners. The resulting Pacific.kap map shows the red map outline perfectly EXCEPT at the top where the frame is well outside the scaled frame. Any ideas why? Consequently my AIS target locations are not showing the correct geo loc in OpenCPN. I have reverted to the old Pacific.kap file based on 6 sequentially selected geo locs on the map,plus the 4 corner locs as it gives a much more accurate if not EXACT locations of my AIS targets. I am comparing the geo locs between the AIS query boxes and the OpenCPN locations. The scale of this chart is 1:10 mill
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 28-10-2009, 08:17   #37
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Hi

I checked that maps created with mc2bsbh do not load in MapCal nor in polarview. The simple modification to make them loadable is to add the row in the header specifing the bsb version. So just add the following line

VER/2.0

This line should be the first after the copyright. The header should look like as:

Code:
! Created by mc2bsbh-0.00.01 - Use at your own risk!
! 
VER/2.0
BSB/NA=North Pacific Ocean - Southeastern Part
......
Ciao, Marco.
GPS-Marco is offline   Reply With Quote
Old 28-10-2009, 08:26   #38
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Quote:
Originally Posted by GPS-Marco View Post
Hi

I checked that maps created with mc2bsbh do not load in MapCal nor in polarview. The simple modification to make them loadable is to add the row in the header specifing the bsb version. So just add the following line

VER/2.0

This line should be the first after the copyright. The header should look like as:

Code:
! Created by mc2bsbh-0.00.01 - Use at your own risk!
! 
VER/2.0
BSB/NA=North Pacific Ocean - Southeastern Part
......
Ciao, Marco.
I'll do that this evening. Don't have time to work on the batch version right now, but I can do quick stuff like this.
dacust is offline   Reply With Quote
Old 28-10-2009, 12:55   #39
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
Marco..

Tried your solution,BUT,look at the result in MapCal. Attached the header details.
Attached Thumbnails
Click image for larger version

Name:	MAPCALTEST.jpg
Views:	198
Size:	133.8 KB
ID:	10758   Click image for larger version

Name:	PACIFIC HEADER TEST.jpg
Views:	190
Size:	68.1 KB
ID:	10759  

__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 28-10-2009, 14:37   #40
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Quote:
Originally Posted by sinbad7 View Post
Marco..

Tried your solution,BUT,look at the result in MapCal. Attached the header details.
It looks as you have modified something in the .kap map with a text editor. Try bsbfix.exe (in libbsb)

Ciao, Marco.
GPS-Marco is offline   Reply With Quote
Old 28-10-2009, 20:12   #41
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Fixes

  • VER/2.0 added.
  • Multi-line CR entries now handled as multi-line comments. Sorry, but the lines may not break the same place as the original.

Code and .exe uploaded.

I don't think there is anything outstanding except for the batch processing enhancement. Have I missed anything?

-dan
dacust is offline   Reply With Quote
Old 29-10-2009, 10:17   #42
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Dan
When trying to compile on linux I get the following error:
Code:
   $ g++ mc2bsbh.cpp -o mc2bsbh
mc2bsbh.cpp: In function 'int main(int, char**)':                                                    
mc2bsbh.cpp:294: error: 'strtod' was not declared in this scope
mc2bsbh.cpp:320: error: 'strtod' was not declared in this scope
To take care of this I added this:
Code:
#include <cstdlib>
after the other "includes".

With these changes made and using -Wall, always a good idea:
Quote:
g++ -Wall mc2bsbh.cpp -o mc2bsbhmc2bsbh.cpp:
In function 'int main(int, char**)':
mc2bsbh.cpp:20: warning: unused variable 'incoming_work'
mc2bsbh.cpp:32: warning: unused variable 'argcount'
The line
Quote:
using std::string;
can be deleted. You have already declared that you are
Quote:
using namespace std;
Can't you wrap up the code repeat at the end, in a function?

I hope this helps!

Looking forward to test your utility.

Thomas
cagney is offline   Reply With Quote
Old 29-10-2009, 10:27   #43
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Cagney,

Thanks for the help.

I have yet to figure out how to do functions. I could use them a lot. It'll probably be one of the next techniques I try.

I'll do start on that and do some cleanup this weekend.

-dan
dacust is offline   Reply With Quote
Old 30-10-2009, 16:13   #44
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
Marco ..Dan..

Think you have forgotten to include the DEPTH feature,i.e. feet,fathoms or meters...
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 31-10-2009, 01:38   #45
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 309
Sinbad,

I checked and in MapCalII "Edit->Chart Information" the "Depth Unit" parameter sets a parameter "DU" in the chartcal.dir file.
DU=0 for unknown
DU=1, for meter, 2 for feet and 3 for fathoms.

This is correctly translated to the "UN" parameter by the mc2bsbh.exe converter when I try.

Did this not work for you?

Regards
Jonas
jonasaberg is offline   Reply With Quote
Reply

Tags
bsb


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
Bahamas Explorer Charts in BSB Format? geoffschultz Navigation 29 16-05-2015 10:21
Free (and Legal) BSB Charts from Maptech! exposure Navigation 15 31-07-2013 11:51
Sales Agreements - Template Anyone? cyberkitty Dollars & Cents 3 11-02-2010 14:49
OpenCPN with BSB v4 selkie Navigation 4 03-08-2009 11:32
Survey Template bbhflts Construction, Maintenance & Refit 3 23-06-2009 22:42

Advertise Here


All times are GMT -7. The time now is 08:31.


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.