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 20-03-2010, 13:16   #151
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
Try loading your bitmap map in Gimp2 and make sure it is in 127 col and save it in .png format to your mc2bsbh directory for processing.
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 20-03-2010, 13:55   #152
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Marco will probably explain it all in a while. Meanwhile...
MD5 is used to check the version of the chart picture.
Most likely you have downloaded a chart(picture) that has been updated since the calibration was done.
The message is a warning that the chart calibration must be checked for possible changes.

Thomas
cagney is offline   Reply With Quote
Old 20-03-2010, 16:19   #153
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Quote:
Originally Posted by r.fairman View Post
I use Kapgen when i run Kapgen to create a BSB I get the error message HEADER DOES NOT CONTAIN A VALID MD5 Any ideas

thanks richard fairman
Hello,

can you explain better and with more details what you are doing? If you are calibrating maps by yourself, you have to put the MD5 of the source image by hand in the comment field of MapCal. Please, read the KapGen Reame carefully. And do not hesitate to write here if you still have problems. Try also to attach your CHARTCAL.DIR.


Ciao, Marco.
GPS-Marco is offline   Reply With Quote
Old 22-03-2010, 06:56   #154
Marine Service Provider

Join Date: Feb 2010
Posts: 279
Error message with kapgen

Sounds Ok to me Where do I find the MD5 to put into the comments?

thanks
r.fairman is offline   Reply With Quote
Old 22-03-2010, 07:17   #155
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Quote:
Originally Posted by r.fairman View Post
Sounds Ok to me Where do I find the MD5 to put into the comments?

thanks
An example of comment field of MapCal for later use of CHARTCAL.DIR in KapGen is the following:

Code:
BSBHDR CED/SE=2008,RE=167,ED=2009
BSBHDR KNP/SD=LOWEST ASTRONOMICAL TIDE,PP=-26
GETMAP http://charts.linz.govt.nz/tifs/nz5323.tif
MD5SUM c77f88ed78805d9d2744bb56ef33cb07
IMGMOD nz5323.tif 0 6632 466 2745 1713
MAPCPR Sourced from Land Information New Zealand data. Crown Copyright Reserved.
CALCPR Calibration by Marco Certelli. Free for NON COMMERCIAL use only.
WARNING! Not to be used for navigation.
All the above stuff shall be inserted by hand (copy-paste is you friend here...).

Anyway the row with MD5SUM is the only one that is non optional and then must be always there. To calculate the md5 value of the source file, open the CMD shell inside KapGen folder and type:

Code:
bin\md5sums Img\IMAGEFILENAME.tif
and you will get the md5 value of the file IMAGEFILENAME.tif. (just copy-paste from the shell to the MapCal comment field after having typed by hand MD5SUM keyword).

Ciao, Marco.
GPS-Marco is offline   Reply With Quote
Old 22-03-2010, 07:23   #156
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 r.fairman View Post
Sounds Ok to me Where do I find the MD5 to put into the comments?

thanks
Google calculate md5 and you get lots of choices. MD5 is a standard hash formula.

You'll need to run the md5 utility of your choice against the image and put it into the comment in the header. Then, kapgen will compare the md5 you put in with the md5 it calculates for the image you are creating.

For what you are doing, this might seem silly. But what it's designed to do is make it so you can distribute or post your CHARTCAL.DIR and someone else can use it. But, it will only work if they have the exact same image you used when creating it. This is in case they download a different image, or the image that is posted gets updated, in which case, it's possible the calibration might be inaccurate.

(I see Marco posted while I was writing this. But since mine addresses some different points, I'm posting it, anyway.)

-dan
dacust is offline   Reply With Quote
Old 22-03-2010, 07:41   #157
Marine Service Provider

Join Date: Feb 2010
Posts: 279
Error message with kapgen

Thanks for the information

Now I come clean I am writing a book called SeaClear Unleashed aimed at SeaClear users. Using Mapcal is a part of the book and I am sure SeaClear users would ne interested in producing BSB files.

Please don't shoot me just a poor techniacl author making a living.

regards

Richard Fairman BA JP
r.fairman is offline   Reply With Quote
Old 24-09-2010, 07:28   #158
Registered User

Join Date: Sep 2010
Location: Canada
Boat: Niagara 35
Posts: 7
mc2bsbh comments

Just joined this group, but have spent the past few weeks reading what great things are being done here! Using the info posted here, I have converted several charts I have that are in an obsolete format. Here are my observations so far.

The following was taken from part of a finished .kap file:
BSB/NA=MyChart converted NU=X3,RA=3891,5586,DU=160
KNP/SC=192000,GD=WGS84,PR=MERCATOR,PP=UNKNOWN
PI=UNKNOWN,SP=UNKNOWN,SK=0.0,TA=90.0
UN=METERS,SD=LOWEST ASTRONOMICAL TIDE
DX=30.5,DY=30.5

This is from a official NOAA chart:
BSB/NA=OLCOTT NEW YORK,NU=1003,RA=1482,1985,DU=254
KNP/SC=10000,GD=NAD83,PR=MERCATOR,PP=43.338,PI=0.500,S P=New York West,2000
SK=0.0000000,TA=90.0000000,UN=METRIC
SD=LOW WATER DATUM 242.8 FT IGLD55 LAKE ONTARIO,DX=1.00,DY=1.00
KNQ/EC=RF,GD=NARC,VC=UNKNOWN,SC=,PC=MC,P1=UNKNOWN,P2=4 3.338
P3=NOT_APPLICABLE,P4=NOT_APPLICABLE,GC=NR,RM=POLYN OMIAL

A few comments.
1. SP= . Besides the above entry, I have also seen in this field the following: UNKNOWN,0
The value of 'UNKNOWN' does not appear correct. Most files contain just SP=,
2. Almost all 'real' bsb files I have looked at have values for PP= and PI=, PP seems to be the Lat midway on the chart and also printed on the chart after MERCATOR. Does anyone know what PI is? I know PP is 'Projection Parameter (value depends upon Projection) a.k.a. central meridian for Transverse Mercator Projections', but what does this mean?
3. When creating a .kap file using
tif2bsb [-c 127] chart.hdr chart.tif chart.kap
I have found that if the tiff file already has less than 127 colors, it is best *not* to use the -c parameter and let tif2bsb figure out how many colors are actually used in the pic. Using -c 127 will force tif2bsb to generate 127 RGB/ entries and the entry IFM/7. This added overhead creates larger .kap files due to smaller compression taking place. One chart I converted was smaller by .5M when I did not use the -c parmeter.
4. I downloaded a .kap file that someone in this group created using mc2bsbh beta07. It will not open in The Capn (a commercial pgm), however it will display on my homemade PalmOS BSBViewer pgm. Looking at the header, it was missing a few things: I added an OST/ entry, a CPH/ entry, changed UN=UNKNOWN to UN=METRES, and changed SD=UNKNOWN to SD=LAT (the later I am sure makes no difference). Still no luck getting The Capn to accept it ... actually, this .kap file crashes The Capn! The only thing left for me to try is looking at the color palette. This .kap file has 127 RGB/ entries and the graphics image uses all 127 entries (I know because I analyzed the bsb raster image). Perhaps this is what The Capn is upset about since it loads .kap with smaller color palettes.
I am quite sure this .kap file can be opened in OpenCPN, but I do not have OpenCPN running. My point in raising this issue is in order to create .kap files that are more towards the BSB standard format, whatever that is! ;->
chartnut is offline   Reply With Quote
Old 24-09-2010, 08:35   #159
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

Chartnut..

The easiest way to convert charts to .kap format compatible with most programs is "Chartconvert".

Download Chartconvert and all neccessary files here:

1. Use a .jpg format and compress the file
2. Use Gimp2 and convert to 127 col and save to Chartconvert directory as .png
3. Use MapCal2 to calibrate and save the CHARTCAL.DIR header file.
4. Use Chartconvert which automatically creates the .kap file

NOTE. Remember to insert 6 characters, (I use GE9999) in MapCal's '#' box at the top right corner of the input form. This will ensure compatability with most programs.
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 24-09-2010, 10:05   #160
Registered User

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

1) meaning of SP value is unknown... anyway the value (UNKNOWN,0,...) shoud not make any difference.

2) PP value is the meridian of projection of transverse mercator charts and is the parallel of true scale in mercator charts. This is what we know.

3) you are right. I never convert to 127 colours unless the source has more than 127 colours.

4) try to use latest mc2bsbh (beta9) for building your charts (it correctly sets CPH, OST, etc.). To fix an old chart: if you make changes with a text editor, remember to use at the end the bsbfix tool (from libbsb) to rebuilt the correct kap format.

Other info in kapgen (readme and cmd), from this site
http://mce66.altervista.org/software...al_Raster_Maps

Ciao, Marco.
GPS-Marco is offline   Reply With Quote
Old 24-09-2010, 10:26   #161
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Quote:
Originally Posted by GPS-Marco View Post
Chartnut:

1) meaning of SP value is unknown... anyway the value (UNKNOWN,0,...) shoud not make any difference.


Ciao, Marco.
The only reference I have found is in a Brazilean text. Anyone out there with a better translation than Google?

Thomas
Attached Thumbnails
Click image for larger version

Name:	sp.jpg
Views:	227
Size:	7.3 KB
ID:	19561  
cagney is offline   Reply With Quote
Old 24-09-2010, 10:27   #162
Obsfucator, Second Class
 
dacust's Avatar

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

Thanks for the input!

Next time I edit the mc2bsbh site I will add the recommendation that if your original image is a palette type image, don't use the C parm and let tif2bsb decide how many colors to use. They can also use ImageMagick (or other utility) to see how many colors are actually in the image.

They can also experiment with the number of colors when converting RGB type images to optimize size vs. quality.

-dan
dacust is offline   Reply With Quote
Old 24-09-2010, 16:42   #163
Registered User

Join Date: Jan 2010
Location: Montevideo, Uruguay
Posts: 242
Quote:
Originally Posted by cagney View Post
The only reference I have found is in a Brazilean text. Anyone out there with a better translation than Google?

Thomas
I don't speak Portuguese, but it looks like:

SP: Specifies the coordinate system of the chart and the interval in feet.
dpons is offline   Reply With Quote
Old 25-09-2010, 06:33   #164
Registered User

Join Date: Sep 2010
Location: Canada
Boat: Niagara 35
Posts: 7
Thanks for all the quick responses!

SP field: I agree with dpons comment - "Specifies the coordinate system of the chart and the interval in feet". This field contains 2 parameters separated by a comma. Sorry, I am a syntax freak! I do believe that mc2bsbh should be updated to remove the UNKNOWN from the "SP=" entry and leave it blank.

I will be adding to the conversion activities in MapCal to override the PP= field via mc2bsbh with the 'Natural scale at Lat xx xx.x' which is usually printed on the chart (e.g. PP=12.6666667). Still looking for what should go in the PI= field.

GPS-Marco: Thanks for all your valuable comments. I am doing exactly what you are saying and I am using the latest versions ... The file I downloaded was created using an older mc2bsbh version. I am still in the process of analyzing this file. Since I am new to "graphics", I need to figure out how to change the color palette of a graphic using some type of windows pgm.

Sinbad7: I am new to graphics, but I thought the jpeg format was not a lossless format, especially when compressed. If my understanding is correct, using jpeg in the conversion process will diminish the quality of the end product. I have been sticking to GIF, TIF, or PNG during the conversion process because all these formats are lossless.
chartnut is offline   Reply With Quote
Old 25-09-2010, 09:31   #165
Registered User

Join Date: Sep 2010
Location: Canada
Boat: Niagara 35
Posts: 7
Further to my above post 158 (and 164), the problem of 127 colors in the palette is a bug in The Capn v5.x (commercial pgm). I changed the graphics to 16 colors using ImageMagick and rebuilt the .kap file and this file loaded ok. This has nothing to do with mc2bsbh, sorry.
chartnut 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 18:30.


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.