Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 2.00 average. Display Modes
Old 19-10-2009, 13:45   #181
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
It seems like the original authors of the Raster2Bsb frontend to libbsb, were way ahead what is going on in this very thread.
Check their, somewhat dated, website via the Google Translate
facility, or directly here, if your french is OK.


Thomas
__________________

__________________
cagney is offline   Reply With Quote
Old 19-10-2009, 13:58   #182
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almerķa, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551
In what way? Please elaborate..
__________________

__________________
idpnd is offline   Reply With Quote
Old 19-10-2009, 15:49   #183
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
Yet another successful conversion to Lyme Bay,UK. BUT, I must admit,it does take quite some time to prepare all the data for the template.kap. One thing is when you have the WHOLE chart with the geo loc of all the corners,scale etc. More time if you don't and perhaps have to use a third party calibration facility in order to detect the corners geo locs and have to make an estimate of the scale.. However,it's great fun if you have the time. Would be a lot quicker though with an 'in-house' raster calibration facility in OpenCPN. (Sorry for pestering you Dave)
Attached Thumbnails
Click image for larger version

Name:	LYME BAY.jpg
Views:	119
Size:	232.2 KB
ID:	10614  
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 19-10-2009, 15:55   #184
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 305
Cagney,
Well done!
I stumbled across this earlier but did not consider it since there were no obvious windows version or source code.

I spent some more time looking around and found a windows compiled version here.
ScanChart2BSB_Win.rar

please try!

My quick trial gave:
-Accepts several input grafic formats. (But it relyes on libbsb so all earlier experiences with 127 colors etc still holds...)
-No zoom function, a bit anoying...
-No way to set PLY points, a big drawback for many charts
-The REF points are tricky to set. I get a lot of error messages.
-It seems only possible to set REF points on separate Lat and Longitudes? Maybe this is intended as a feature to get better calibration?
-In general it feels a bit "unpolished" but on its way toward a working program.

Would be great if someone could find the source, add PLYs fix the annoying "error messages" and release it! I think the french site says it is open source?

Worst is: the resulting kap file looks weird and useless in OpenCPN. It is thin and very wide in the red outline and way to big when zoomed in. Maybe I made a mistake during my try...
Will be interesting to hear about your milage.

/J
__________________
jonasaberg is offline   Reply With Quote
Old 20-10-2009, 03:02   #185
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Another possibility for calibrating images is to use MapCal II (a tool included in SeaClear).

The only thing to do is a script or a simple program that converts the CHARTCAL.DIR in the Template.kap (we now know enough about kap header to do a "working" conversion)

This is an example of CHARTCAL.DIR produced by MapCal II and the resulting Template (I converted it by hand)

Code:
[NZ4314.PNG]
NA=Manukau Harbour
FN=NZ4314.PNG
GR=0
PY=1
QU=0
SC=48000
BC=16
B1=-36.8899689273687,174.341631581421
B2=-37.1650562040491,174.341510292845
B3=-37.1650709130473,174.763325319593
B4=-37.095008094068,174.763339168124
B5=-37.0950445671289,174.866720436627
B6=-36.8900075017051,174.866735233114
B7=-36.8899905583336,174.726670744505
B8=-36.924998422596,174.726663272868
B9=-36.9249898722861,174.646677364748
B10=-36.9299908361069,174.646677594158
B11=-36.9299880832591,174.600009410926
B12=-36.9566592871254,174.600007831208
B13=-36.9566572091881,174.529999425331
B14=-36.9166523546181,174.530005807175
B15=-36.9166550927912,174.500005869187
B16=-36.8899829746526,174.500007220602
CC=11
C1=2169,1229,-36.916666666667,174.416666666667
C2=9476,1229,-36.916666666667,174.750000000000
C3=9469,5779,-37.083333333333,174.750000000000
C4=2178,5781,-37.083333333333,174.416666666667
C5=5822,3501,-37.000000000000,174.583333333333
C6=7647,5777,-37.083333333333,174.666666666667
C7=4001,5779,-37.083333333333,174.500000000000
C8=2173,3505,-37.000000000000,174.416666666667
C9=4003,8005,-37.165000000000,174.500000000000
C10=9466,8007,-37.165000000000,174.750000000000
C11=547,8012,-37.165000000000,174.341666666667
GD=WGS84
NU=NZ4314
PR=2
DS=0,0
WI=12992
HE=8504
DX=4.08
DY=4.08
LAT0=0
LON0=174.583333333333
DT=0
LATS=0
LATN=0
DU=0
PC=0
Code:
VER/2.00
BSB/NA=Manukau Harbour,NU=,RA=12992,8504,DU=275
KNP/SC=48000,GD=WGS84,PR=TRANSVERSE MERCATOR,PP=0.0,PI=0.0,SP=
    SK=0.0000000,TA=90.0000000,UN=METERS,SD=MEAN LOW WATER SPRINGS
    DX=4.0,DY=4.0
CED/SE=2004,RE=1,ED=2008
PLY/1,-36.889999998417,174.341666667278
PLY/2,-37.1650000157545,174.341666666152
PLY/3,-37.1649999949208,174.763333334005
PLY/4,-37.0949999994051,174.763333332849
PLY/5,-37.0949999987611,174.866666666273
PLY/6,-36.8900000007883,174.86666666637
PLY/7,-36.8900000005597,174.726666666532
PLY/8,-36.9249999997684,174.726666666751
PLY/9,-36.9249999972423,174.646666672963
PLY/10,-36.9299999971769,174.646666673768
PLY/11,-36.9299999994768,174.600000010984
PLY/12,-36.9566666700056,174.60000001977
PLY/13,-36.9566666603615,174.530000000563
PLY/14,-36.9166666647178,174.530000002763
PLY/15,-36.9166666648246,174.500000001059
PLY/16,-36.8900000011726,174.500000000047
REF/1,2169,1229,-36.916666666667,174.416666666667
REF/2,9476,1229,-36.916666666667,174.750000000000
REF/3,9469,5779,-37.083333333333,174.750000000000
REF/4,2178,5781,-37.083333333333,174.416666666667
REF/5,5822,3501,-37.000000000000,174.583333333333
REF/6,7647,5777,-37.083333333333,174.666666666667
REF/7,4001,5779,-37.083333333333,174.500000000000
REF/8,2173,3505,-37.000000000000,174.416666666667
REF/9,4003,8005,-37.165000000000,174.500000000000
REF/10,9466,8007,-37.165000000000,174.750000000000
REF/11,547,8012,-37.165000000000,174.341666666667
If a programmer wants to write down a conversion tool, the whole bsb production process would be straigthforward. I can help a volunteer, but I'm not a programmer...

Ciao, Marco.
__________________
GPS-Marco is offline   Reply With Quote
Old 20-10-2009, 04:55   #186
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
Marco..

Good idea,I am all for avoiding the re-invention of the wheel. The MapCal developers have spent years improving their product and a simple conversion utility should not be beyond the capabilities of our technical gurus.

I would also suggest for Dave that an option is provided in the status bar to display the cursor position in decimal degrees, which will avoid having to do cumbersome calculations from degr/decimal min when preparing data for the tif2bsb header.
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 20-10-2009, 06:03   #187
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 GPS-Marco View Post
Another possibility for calibrating images is to use MapCal II (a tool included in SeaClear).

The only thing to do is a script or a simple program that converts the CHARTCAL.DIR in the Template.kap (we now know enough about kap header to do a "working" conversion)

This is an example of CHARTCAL.DIR produced by MapCal II and the resulting Template (I converted it by hand)

Code:
[NZ4314.PNG]
NA=Manukau Harbour
FN=NZ4314.PNG
GR=0
PY=1
QU=0
SC=48000
BC=16
B1=-36.8899689273687,174.341631581421
B2=-37.1650562040491,174.341510292845
B3=-37.1650709130473,174.763325319593
B4=-37.095008094068,174.763339168124
B5=-37.0950445671289,174.866720436627
B6=-36.8900075017051,174.866735233114
B7=-36.8899905583336,174.726670744505
B8=-36.924998422596,174.726663272868
B9=-36.9249898722861,174.646677364748
B10=-36.9299908361069,174.646677594158
B11=-36.9299880832591,174.600009410926
B12=-36.9566592871254,174.600007831208
B13=-36.9566572091881,174.529999425331
B14=-36.9166523546181,174.530005807175
B15=-36.9166550927912,174.500005869187
B16=-36.8899829746526,174.500007220602
CC=11
C1=2169,1229,-36.916666666667,174.416666666667
C2=9476,1229,-36.916666666667,174.750000000000
C3=9469,5779,-37.083333333333,174.750000000000
C4=2178,5781,-37.083333333333,174.416666666667
C5=5822,3501,-37.000000000000,174.583333333333
C6=7647,5777,-37.083333333333,174.666666666667
C7=4001,5779,-37.083333333333,174.500000000000
C8=2173,3505,-37.000000000000,174.416666666667
C9=4003,8005,-37.165000000000,174.500000000000
C10=9466,8007,-37.165000000000,174.750000000000
C11=547,8012,-37.165000000000,174.341666666667
GD=WGS84
NU=NZ4314
PR=2
DS=0,0
WI=12992
HE=8504
DX=4.08
DY=4.08
LAT0=0
LON0=174.583333333333
DT=0
LATS=0
LATN=0
DU=0
PC=0
Code:
VER/2.00
BSB/NA=Manukau Harbour,NU=,RA=12992,8504,DU=275
KNP/SC=48000,GD=WGS84,PR=TRANSVERSE MERCATOR,PP=0.0,PI=0.0,SP=
    SK=0.0000000,TA=90.0000000,UN=METERS,SD=MEAN LOW WATER SPRINGS
    DX=4.0,DY=4.0
CED/SE=2004,RE=1,ED=2008
PLY/1,-36.889999998417,174.341666667278
PLY/2,-37.1650000157545,174.341666666152
PLY/3,-37.1649999949208,174.763333334005
PLY/4,-37.0949999994051,174.763333332849
PLY/5,-37.0949999987611,174.866666666273
PLY/6,-36.8900000007883,174.86666666637
PLY/7,-36.8900000005597,174.726666666532
PLY/8,-36.9249999997684,174.726666666751
PLY/9,-36.9249999972423,174.646666672963
PLY/10,-36.9299999971769,174.646666673768
PLY/11,-36.9299999994768,174.600000010984
PLY/12,-36.9566666700056,174.60000001977
PLY/13,-36.9566666603615,174.530000000563
PLY/14,-36.9166666647178,174.530000002763
PLY/15,-36.9166666648246,174.500000001059
PLY/16,-36.8900000011726,174.500000000047
REF/1,2169,1229,-36.916666666667,174.416666666667
REF/2,9476,1229,-36.916666666667,174.750000000000
REF/3,9469,5779,-37.083333333333,174.750000000000
REF/4,2178,5781,-37.083333333333,174.416666666667
REF/5,5822,3501,-37.000000000000,174.583333333333
REF/6,7647,5777,-37.083333333333,174.666666666667
REF/7,4001,5779,-37.083333333333,174.500000000000
REF/8,2173,3505,-37.000000000000,174.416666666667
REF/9,4003,8005,-37.165000000000,174.500000000000
REF/10,9466,8007,-37.165000000000,174.750000000000
REF/11,547,8012,-37.165000000000,174.341666666667
If a programmer wants to write down a conversion tool, the whole bsb production process would be straigthforward. I can help a volunteer, but I'm not a programmer...

Ciao, Marco.
That looks relatively simple, I'll give it a try. May take a few days as I am a little busy.

-dan
dacust is offline   Reply With Quote
Old 20-10-2009, 06:28   #188
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..

That's what I like about this forum,good ideas,a lot of enthusiasm..and above all,programing experience.. Looking forward to see your progress.
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 20-10-2009, 07:57   #189
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 305
yepp,
See my post #75 in this thread...



I don't have a good tool for writing a script, but I would like it to bee a cross platform tool. My idea is to use Python which runs on all platforms but it takes a bit of learning...never used it before...

MapCalII is much better than ScanChart/Raster2BSB but it is not directly linked to libbsb.

The work flow would be:

1. convert scanned image from chart.* to chart.png with 127 colors (or less)
2. use MapCalII to create a chartcal.dir
3. Convert using a script/program as suggested to template.txt
4. convert png to tif (without changing the size in pixels)
5. Run tif2bsb with the template.txt and the chart.tif
Voala!

Step 1: png is a good open intermediate compact format that can be read by MapCalII. (*.jpg is typically not the best format for charts with big areas of the same color with sharp interfaces between areas)
Step 4 will create a file possible to use with tif.

I believe this would be the fastest route to a working conversion kit.
Also: If one use python it has good cross platform support for a graphical interface program and will be easier to learn and modify than C.
Its an interpreting language so not as fast as C but that doesn't matter for this type of application.

/Jonas
__________________
jonasaberg is offline   Reply With Quote
Old 20-10-2009, 08:30   #190
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 jonasaberg View Post
yepp,
See my post #75 in this thread...



I don't have a good tool for writing a script, but I would like it to bee a cross platform tool. My idea is to use Python which runs on all platforms but it takes a bit of learning...never used it before...

MapCalII is much better than ScanChart/Raster2BSB but it is not directly linked to libbsb.

The work flow would be:

1. convert scanned image from chart.* to chart.png with 127 colors (or less)
2. use MapCalII to create a chartcal.dir
3. Convert using a script/program as suggested to template.txt
4. convert png to tif (without changing the size in pixels)
5. Run tif2bsb with the template.txt and the chart.tif
Voala!

Step 1: png is a good open intermediate compact format that can be read by MapCalII. (*.jpg is typically not the best format for charts with big areas of the same color with sharp interfaces between areas)
Step 4 will create a file possible to use with tif.

I believe this would be the fastest route to a working conversion kit.
Also: If one use python it has good cross platform support for a graphical interface program and will be easier to learn and modify than C.
Its an interpreting language so not as fast as C but that doesn't matter for this type of application.

/Jonas
If someone else want's to write it in Python, that'd be cool.

As for me, I just picked up C++ so I'll write it in that. It can be compiled on most platforms. All I plan to write is the conversion program to go from the Mapcal output to a BSB template. BUT, if someone else knows Python and wants to do it, let me know so I don't waste my time.

I'd try to pick up Python myself, but at work I need to learn c++ and .net, so doing these projects in c++ serves me a dual purpose. So I don't want to waste effort learning a tool I don't need at work since there are ones that I DO need that will work for both.

So, here's a question. What formats does Mapcal support?

-dan
dacust is offline   Reply With Quote
Old 20-10-2009, 08:45   #191
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 305
Sure, Most important is to get it done!

The only advantage with python is that anyone can install and get it running witin a few minutes without having to compile the code for any platform. (I can write a bit longer explanation if needed...)

MapCalII supports (or at least have it in the file open dialogue):

WCI
BSB/KAP
GEO/NOS
PNG
BMP

/Jonas
__________________
jonasaberg is offline   Reply With Quote
Old 20-10-2009, 09:13   #192
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 jonasaberg View Post
The only advantage with python is that anyone can install and get it running witin a few minutes without having to compile the code for any platform. (I can write a bit longer explanation if needed...)
Java would accomplish the same thing and is probably supported on even more platforms. Java is another language I have to learn. If platforms were not an issue, Pearl would probably be the best. From what I've heard it has the best string handling features.

For something like this, I agree, an interpreted language is no problem. Takes longer to type in the command than it will to run, so what's a few extra milliseconds?

-dan
dacust is offline   Reply With Quote
Old 20-10-2009, 10:33   #193
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
OpenCPN is free software and licensed under the GPL.
Sure it would be nice with a program similar to SeaClears MapCal, but then that program ought to be free software as well. Maybe one in a group of support programs that could be distributed with OpenCPN.

idpnd forced me to think a bit (for once ) with his latest post.
It is a pain to write the template files, I waste a lot of time chasing down typing errors. OpenCPN is, very intolerant towards silly errors such as mixing "," with "." in a REF/ point, and it must be.
What I would like is a program that makes it easy create a template file to use with tif2bsb. ImageMagic is good at manipulating and converting images, and libbsb has little problems in it self.

I think that Raster2Bsb could be used as a starting point for a tool that creates the template files. The program is open source and written in c++ using the cross platform Qt toolkit. Qt can also be used with scripting languages as Perl, Ruby and Python.(though it should probably be ported to Qr4 instead of using the old Qt3).

Most of the code is probably already there. Template files are already created internally. The user interface needs to be developed a bit. I would like to see an editable list of created REF points for example.

It is a pity that SeaClear is created in the Windows tradition, where
free-ware program is not accompanied by the source code. It is really a bit difficult to understand, as no commercial interests are involved.

Thomas
__________________
cagney is offline   Reply With Quote
Old 20-10-2009, 10:44   #194
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almerķa, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551
Quote:
Originally Posted by cagney View Post
idpnd forced me to think a bit (for once ) with his latest post.
and rather pleased with himself he is!

There is also a version of Raster2BSB at Barcosoft; I should think the source code is there, although it's a bit tricky to get signed up..
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 20-10-2009, 11:32   #195
Registered User

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


Talking about the code. Here it is.
Change ".doc" to ".tar.gz"

Thomas
Attached Files
File Type: doc raster2bsb_0.0.1.doc (19.3 KB, 53 views)
__________________

__________________
cagney 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 21:50.


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.