Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 2.00 average. Display Modes
Old 03-10-2009, 17:45   #31
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 305
Dan and others trying to use libbsb in windows,

I hope I am not misunderstanding but...you don't need to compile libbsb to be able to use it in WindowsXP.

I am writing this quite thoroughly as I think some readers of the forum are not comfortable using a command window. Please bare with.

Just download the file libbsb-0.0.7-win32.zip from here:
Browse libbsb - read/write/convert BSB images Files on SourceForge.net

Then unzip it to a folder of your liking, e.g straight under c:\
c:/libbsb-0.0.7
You will have to add the path statement by clicking
start->settings->control panel->system
then choose the "advanced" tab, click on "environment variables"
Scroll down in the lower box to "path" and click "edit", add ";c\libbsb-0.0.7" at the end of the existing line. Observe the leading semicolon! And be careful, making a mistake here will create problems for those not used to fiddle with this!
(The path variable means that windows will find the program when we need it later)

Now you are done. Let us try:

1. Create a new directory, e.g. c:\kap
2. Copy the file "c:\libbsb-0.0.7\tests\australia4c.tif" to "c:\kap"
3. Create a header file. We can do this by opening c:\libbsb-0.0.7\australia4c.kap with wordpad. Erase all lines with garbled text! (all lines after the line starting with: RGB/4,226,65,6)
4. Save the file as c:\kap\header.kap
5. We now have two files in "c:\kap", one header file (.kap) and one image file (.tif). Let us make ourselves a "new" kap to use in Opencpn.
6. Open a command window; click:
start->run and write cmd in the box and click "ok". A command window will open. Write the following to commands:
c:\>c: (and press enter)
c:\>cd c:\kap (and press enter)
These two commands will make us move to the "c:\kap" directory
Check were you are and what files are there by writing:
c:\kap\dir
You should see two files "header.kap" and "australia4c.tif"
7. Let us try converting, write:
C:\kap>tif2bsb (and press enter, you will see the following instructive text)
Usage:
tif2bsb [-c colormap-size] template.kap input.tif output.kap
Try it out, write:
c:\kap>tif2bsb -c 4 header.kap australia4c.tif calibrated.kap
Now you should have a new calibrated file. Check by writing:
c:\kap\dir
You should have three files now!

The tif2bsb is the command used to actually create the new kap file.
-c 4 indicates that it is a 4 color tif.
The actual tif2bsb.exe file is found by the path we set earlier, it is located in c:\libbsb-0.0.7.

Some hints:
-It is a good idea to read the c:\libbsb-0.0.7\readme file. (open it in WordPad, not in Notepad)
-Read all the info about the libbsb package on sourceforge.
-Make another new directory were you place the calibrated kap files. otherwise opencpn will try to use the header files and they contain only headers, no image!

My conclusions:
The programs in libbsb-0.0.7 seem to work ok in Windows XP, the problem is that they don't give any error messages with useful information. Any mistake in the command line, the tif file or the kap file will make the tif2bsb crash.
This makes it hard to find out why the header.kap files you make yourself don't work. It would be great with a front end program to tif2bsb similar to the Seaclear "MapCal II" program for it to be of practical use for us windows people.

Anyway, I hope this make it possible for more people to try it out and try to figure out more about how to make the kap files. I had no luck with the nz53.tif file which was discussed earlier. It converted just fine but was not possible to use in Opencpn or Seaclear for me. (but the australia4c.kap works fine in both)

/Jonas
__________________

__________________
jonasaberg is offline   Reply With Quote
Old 03-10-2009, 17:46   #32
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,743
I reported it to the list. They say that has been fixed in the latest release. So I got it, figured out gunzip and tar, and it went through the ./configure, make, make check and make install. I got the logs if you want to see them.

So, theoretically I have libtiff installed. But I still can't get libbsb to see that it's there.

Code:
Dan@xxx ~/libbsb-0.0.7
$ ./configure
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... no
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking tiff.h usability... no
checking tiff.h presence... no
checking for tiff.h... no
configure: WARNING: *** TIFF conversion tools will not be built ***
checking png.h usability... no
checking png.h presence... no
checking for png.h... no
configure: WARNING: *** PNG conversion tools will not be built ***
checking for valgrind... no
configure: creating ./config.status
config.status: creating tests/Makefile
config.status: creating tests/at_wrap
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing tests/atconfig commands

Dan@xxx ~/libbsb-0.0.7
$ find / -name tiff.h
/home/Dan/tiff-3.9.1/libtiff/tiff.h
/local/include/tiff.h

Dan@xxx ~
$ echo $PATH
.:/usr/local/bin:/mingw/bin:/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/Syste
m32/Wbem:/c/Program Files/QuickTime/QTSystem/:/c/MinGW/bin:/c/Program Files/GnuW
in32/include:/local/include:/local
-dan
__________________

dacust is offline   Reply With Quote
Old 03-10-2009, 17:50   #33
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,743
I posted my last before I saw this. THANKS! I will try that route.

-dan

Quote:
Originally Posted by jonasaberg View Post
Dan and others trying to use libbsb in windows,

I hope I am not misunderstanding but...you don't need to compile libbsb to be able to use it in WindowsXP.

...

/Jonas
dacust is offline   Reply With Quote
Old 04-10-2009, 02:28   #34
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,250
Quote:
My conclusions:
The programs in libbsb-0.0.7 seem to work ok in Windows XP, the problem is that they don't give any error messages with useful information. Any mistake in the command line, the tif file or the kap file will make the tif2bsb crash.
This makes it hard to find out why the header.kap files you make yourself don't work. It would be great with a front end program to tif2bsb similar to the Seaclear "MapCal II" program for it to be of practical use for us windows people.

Anyway, I hope this make it possible for more people to try it out and try to figure out more about how to make the kap files. I had no luck with the nz53.tif file which was discussed earlier. It converted just fine but was not possible to use in Opencpn or Seaclear for me. (but the australia4c.kap works fine in both)
Jonas, thanks for helping out here.

I don't get much in the way of error messages with libbsb on linux either. If we restrict ourself to the NZ tiffs for now, I only ever see a message about a non recognized tag in the picture, but a kap file is still produced. If you make a mistake in the template.kap file, you get no messages. It is very important that all the "," and "." are correct, and that you use the correct signs for lat and long ( +N,-S,+E,-W), etc...

What exactly happens when you try NZ53 on OpenCpn???
Do you get log messages like this?
Code:
10:16:12: Create ChartTable Entry for /opt/Navigation/Raster2Bsb/NZ/INT638.KAP
10:16:33: Initializing Chart /opt/Navigation/Raster2Bsb/NZ/INT638.KAP
If you tick the box "Show Chart Outlines", can you then see the outlines of the chart in opencpn?

Thomas
__________________
cagney is offline   Reply With Quote
Old 04-10-2009, 04:37   #35
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,743
With the Windows version, yes it works with the australia map. But when I try a NOAA map, it doesn't.

bsb2tif worked. Gave me a tiff of the chart (11402_1).

Code:
C:\libbsbwork>bsb2tif .\from\11402_1.KAP .\to\11402_1.tif
Then I created the header file and tried the other way.

Code:
C:\libbsbwork>tif2bsb .\to\11402_1.tif .\to\11402_1.KAP .\to\11402_1_new.KAP
.\to\11402_1.KAP: Not a TIFF file, bad magic number 3361 (0xd21).
Could not TIFFOpen ".\to\11402_1.KAP"
From the libbsb docs, I find this:
Not a TIFF file, bad magic number %d (0x%x). The magic number in the header was not (hex) 0x4d4d or (hex) 0x4949

So, maybe we need a hex editor?

But, I think the way to go is look at the australia map. I thought I might learn something from the headers in the NOAA file, but they got lots of stuff in there... 26k of headers.

Among other things:
  • 10 RGB values
  • 10 more RGB values for each of the different color schemes - DAY, DSK, NGT, NGR, GRY, PRC, PRG
  • 135 REFerence points (with a corresponding 135 ERR points)
  • and a bunch of other stuff

I think the RGB values may be a problem when working on other unknown charts. But that may be the least of it.

-dan
dacust is offline   Reply With Quote
Old 04-10-2009, 04:53   #36
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,250
Dan

Usage:
tif2bsb [-c colormap-size] template.kap input.tif output.kap

You have the wrong order between the arguments.
Your error message is because a .kap is not a tiff.
Check my earlier posts.
Thomas
__________________
cagney is offline   Reply With Quote
Old 04-10-2009, 05:42   #37
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,743
Quote:
Originally Posted by cagney View Post
Dan

Usage:
tif2bsb [-c colormap-size] template.kap input.tif output.kap

You have the wrong order between the arguments.
Your error message is because a .kap is not a tiff.
Check my earlier posts.
Thomas
Yep, I figured that out. I will try again later, but right now I am heading down a different road...
dacust is offline   Reply With Quote
Old 04-10-2009, 05:56   #38
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,743
I have been paring down the header file to see what might be optional.

This is from the australia4c example.

Red means I deleted it.

Code:
! libbsb sample BSB file
! Map of Australia - not for navigational use
VER/3.0
BSB/NA=Australia 30000000
    NU=,RA=625,480,DU=300
KNP/SC=30000000,GD=,PR=LAMBERT CONFORMAL CONIC,PP=140.000000
    PI=0.000000,SP=Unknown,0,SK=0.0,TA=90
    UN=,SD=,DX=6000.0,DY=6000.0
KNQ/EC=NOT_APPLICABLE,GD=NOT_APPLICABLE,VC=NOT_APPLICABLE,SC=NOT_APPLICABLE,PC=LE
    P1=135.00000000000000,P2=-25.00000000000000
    P3=-35.00000000000000,P4=-27.84280833333333
    P5=-25.00000000000000,P6=-35.00000000000000
    GC=NOT_APPLICABLE,RM=NONE
CED/SE=1,RE=1,ED=03/05/2004
OST/1
REF/1,1,1,-8.25404666666667,112.72859333333334
REF/2,620,1,-7.66159166666667,156.57827333333333
REF/3,620,470,-40.89653000000000,164.28394166666666
REF/4,1,470,-41.14970000000000,106.53042166666667
PLY/1,-8.25404666666667,112.72859333333334
PLY/2,-7.66159166666667,156.57827333333333
PLY/3,-40.89653000000000,164.28394166666666
PLY/4,-41.14970000000000,106.53042166666667
DTM/0.000000,0.000000
IFM/3
RGB/1,199,231,252
RGB/2,174,234,84
RGB/3,255,254,206
RGB/4,226,65,6
It still displays fine. On their webpage, they didn't know what the P values were. And if the RGB isn't needed, that would help a lot.

-dan
dacust is offline   Reply With Quote
Old 04-10-2009, 06:21   #39
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,250
There is a lot of text in the headers of different .kap files that I don't understand, and that don't seems to be necessary.
See post #5 for a basic template. You don't need RGB values in the template file as tiff2bsb is creating its own.

What I'm more concerned about is the REF/, lines, reference points for geo referencing. This has to do with the accuracy of the finished file. For a large scale chart, such as a harbor plan, the four corners will probably do, but for small scale charts that spans thousands of miles in north - south direction you need more points to help opencpn. I'm still pondering the finer points of this.

Do you have any success making NZ53 using the template file I attached i #5 ?

Thomas
__________________
cagney is offline   Reply With Quote
Old 04-10-2009, 07:58   #40
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Would it help to use a tag viewer like this?

X360 Exif & Tiff Tag Viewer ActiveX Control helps application developers and programmers to get all embed image information including EXIF tags, TIFF tags and GPS tags. Also, you can use it as a simply image viewer ActiveX with many useful viewing functions. The ActiveX works on most of the Windows operating system. The functionality of the product can be accessed from most programming languages like C++, Visual Basic, Visual FoxPro, Delphi, MS Access, VB.NET and C#.

With X360 Exif & Tiff Tag Viewer ActiveX Control, you can:

Get all embed information from Jpeg, Png and Tiff image.

Embed image information include Exif tags, Tiff tags and Gps tags.

Get count, display value, hexadecimal value and type of all tags.

Write some information to Jpeg, Png and Tiff image.

Information include artist, copyright, date time, document name, equipment make, equipment model, host computer, image description, image title, ink names, page name, software used, and user comment

Visualize your images and convert them to different formats.

View Bmp, Emf, Gif, Jpeg, Png, Wmf and Tiff image files.

Save images as Jpeg, Png and Tiff.

Save Jpeg images with user-defined quality level.

Save Tiff images with different compression include CCITT3, CCITT4, LZW and Packbits Macintosh RLE.

Provide tools to access the image within the preview

Image alignment, flip, rotate, zoom-in, zoom-out and zoom-to-fit the image.

Hand tool for moving image using the mouse drag.

Adjust the style and color of the preview window.

Set border on/off, background color, background style and foreground color.

Scroll the image smoothly, and provide a location bookmark tools.

Save or bookmark a specified position of the scroll bar, and then auto scroll to the restored position.

Get the coordinate of the image.

Print images with specified size.

The following image file formats are supported:

BMP (standard Windows Bitmap file format).

EMF (Enhanced Windows Metafile format).

GIF (Graphics Interchange file Format).

JPEG (Joint Photographic Expert Group file format).

PNG (Portable Network Graphics file format).

TIFF (Tagged-Image File Format).

WMF (standard Windows Metafile format).

The following TIFF file compressions are supported:

CCITT Group 3 fax encoding.

CCITT Group 4 fax encoding.

LZW compression.

Packbits - Macintosh RLE compression.
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 04-10-2009, 09:23   #41
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

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

I downloaded libbsb-0.0.7 and configured system path as follows:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;C:\Programfiler\Common Files\Ulead Systems\MPEG;C:\Windows\QTSystem\;c\libbsb-0.0.7D:\Programfiler;

(NOTE: My Vista is in Norwegian,hence the path:c:\Programfiler)

When I run C:\>kap>tif2bsb I get the message 'ingen tilgang' 'no access' ??

I created the two file directories c:\libbsb-0.0.7 and c:\kap

What could be the problem?
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 04-10-2009, 10:06   #42
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,743
Quote:
Originally Posted by sinbad7 View Post
Jonas #31

I downloaded libbsb-0.0.7 and configured system path as follows:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;C:\Programfiler\Common Files\Ulead Systems\MPEG;C:\Windows\QTSystem\;c\libbsb-0.0.7;D:\Programfiler;

(NOTE: My Vista is in Norwegian,hence the path:c:\Programfiler)

When I run C:\>kap>tif2bsb I get the message 'ingen tilgang' 'no access' ??

I created the two file directories c:\libbsb-0.0.7 and c:\kap

What could be the problem?
One thing I see is a missing simicolon. I added it above. And you say c:\Programfiler, but your path has D:\Programfiler.

-dan
dacust is offline   Reply With Quote
Old 04-10-2009, 10:07   #43
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

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

Am I in the right systems box??
Attached Thumbnails
Click image for larger version

Name:	miljovariabler.jpg
Views:	219
Size:	63.8 KB
ID:	10299  
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 04-10-2009, 12:57   #44
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,743
You are in the right place. In the lower box highlight "Path" and click "Edit"



-dan
dacust is offline   Reply With Quote
Old 04-10-2009, 14:52   #45
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

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

Exactly what I did but I am advised 'no access' ? I have tried using both 'PROGRAM FILES' as well as the Norwegian 'Programfiler' without any luck,and this is where I'm stuck!

Any chance you could try another conversion for me? nz5322.tif in my dropbox
__________________

__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Reply

Tags
charts, kml, raster2bsb, tiff2bsb, bsb

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
Charts on CD stxboy Navigation 43 28-01-2014 11:40
Charts for BC Charlie Navigation 11 19-04-2007 04:39
Used Charts daven Navigation 2 28-11-2006 17:47
Looking at charts - where to go to next Rippy Other 19 10-03-2006 05:27



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 13:26.


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.