Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 25-10-2009, 16:57   #16
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
Quick Code Review...

Dan...

This is good looking CLI utility code. Grade B+.

Have a look at

Seekg - Wikipedia, the free encyclopedia

Nice job, and I look forward to seeing the fruits of the labor as a nice folio of worldwide raster charts!

Dave
__________________

__________________
bdbcat is online now   Reply With Quote
Old 25-10-2009, 17:04   #17
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 bdbcat View Post
Dan...

This is good looking CLI utility code. Grade B+.

Have a look at

Seekg - Wikipedia, the free encyclopedia

Nice job, and I look forward to seeing the fruits of the labor as a nice folio of worldwide raster charts!

Dave
Thanks for the seekg, I'll incorporate that. Keep the suggestions coming.

As for a B+, I'll only take that if you're taking into account my newbie-ness. Otherwise it's a D. Only reason I'd give it that high is because, amazingly, it actually works.

-dan
__________________

dacust is offline   Reply With Quote
Old 25-10-2009, 17:16   #18
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
Dan....

Poke around inside the opencpn code base if you want to see some quick-and-dirty code that I was going to fix "someday".

Sometimes, someday never comes, and doesn't really need to if it works. The CPU makes no value judgments. It just runs your code.

Dave
__________________
bdbcat is online now   Reply With Quote
Old 25-10-2009, 17:32   #19
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 bdbcat View Post
Dan....

Poke around inside the opencpn code base if you want to see some quick-and-dirty code that I was going to fix "someday".

Sometimes, someday never comes, and doesn't really need to if it works. The CPU makes no value judgments. It just runs your code.

Dave
Yep. I got some code like that in production. Nasty stuff. But it runs and they won't let me fix it.

I added the seekg. Looks better. Even works after I went through and fixed the mismatched brackets I screwed up while adding it...

-dan
dacust is offline   Reply With Quote
Old 26-10-2009, 07:47   #20
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
Has anyone tried to use the converted .kap maps with other nav. progs?
I tried using it in SeaClear but it was not accepted.??
__________________
"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, 08:17   #21
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
Has anyone tried to use the converted .kap maps with other nav. progs?
I tried using it in SeaClear but it was not accepted.??
Ah, the joys of software development...

I have SeaClear, so I guess I better start using it.

Among other things, I think I need to add the OST?, and other tags that we can default. Looking on the BSB page on Sourceforge they describe what some of them mean.

I'll probably have some time this evening to look at it.

-dan
dacust is offline   Reply With Quote
Old 26-10-2009, 08:36   #22
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 305
Sinbad,
Regarding your observation that tif2bsb files does not work in seaclear.

Yes, I tried this when I started fiddling around with the libbsb package earlier a couple of months ago and this is my experience too.

The kap files generated by tif2bsb does not work in Seaclear.

I think that the reverse engineered libbsb package has some flaws and/or seaclear has some flaws in the interpretation of the bsb "standard".

I am not sure how to get around that if we somehow can not get a hand on the bsb specification and modify libbsb to create "perfect" bsb files.

Seaclear has worked with all comersial bsb files I have bought and downloaded so it seems pretty good at interpreting bsb files.
The same goes for OpenCPN so it is probably a small difference that makes seaclear unable to read the libbsb kap files.

I do think it would be very good if we somehow could ascertain that the bsb files generated by libbsb are indeed according to the bsb standard instead of "just" be able to be read by OpenCPN. Otherwise we might get a problem later even if which problem that might be is not known yet.

/Jonas
__________________
jonasaberg is offline   Reply With Quote
Old 26-10-2009, 09:10   #23
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Quote:
Originally Posted by jonasaberg View Post
Sinbad,
Regarding your observation that tif2bsb files does not work in seaclear.

Yes, I tried this when I started fiddling around with the libbsb package earlier a couple of months ago and this is my experience too.

The kap files generated by tif2bsb does not work in Seaclear.

I think that the reverse engineered libbsb package has some flaws and/or seaclear has some flaws in the interpretation of the bsb "standard".

I am not sure how to get around that if we somehow can not get a hand on the bsb specification and modify libbsb to create "perfect" bsb files.

Seaclear has worked with all comersial bsb files I have bought and downloaded so it seems pretty good at interpreting bsb files.
The same goes for OpenCPN so it is probably a small difference that makes seaclear unable to read the libbsb kap files.

I do think it would be very good if we somehow could ascertain that the bsb files generated by libbsb are indeed according to the bsb standard instead of "just" be able to be read by OpenCPN. Otherwise we might get a problem later even if which problem that might be is not known yet.

/Jonas
I agree 100% that the produced BSB should be as much as possible standard. OCPN uses libbsb to open BSB charts so OCPN in not a good test to prove the correctness of a map produced with libbsb...

Anyway I did have no problem in loading BSB produced by tif2bsb both in mapcal and in seaclear.

Just one tip: if you open a kap chart in a text editor and change even a single char, the map will not be loaded anymore in mapcal. There should be something like a CRC. If you really need to modify something, try to run bsbfix.exe (libbsb) to fix the problem.

Ciao, Marco.

EDIT:

I can also load the BSB in PolarView without issues.

http://www.polarnavy.com/main/prod1

Ciao.
__________________
GPS-Marco is offline   Reply With Quote
Old 26-10-2009, 09:31   #24
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 and Marco..

The conversion sequence from MapCal to OpenCPN seems to work well now but I was a bit surprised to see that the created CHARTCAL.DIR also included my PREVIOUS chart details which had to be deleted before conversion. I assumed the new CHARTCAL.DIR would overwrite the old one.
__________________
"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, 09:59   #25
Registered User

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

The conversion sequence from MapCal to OpenCPN seems to work well now but I was a bit surprised to see that the created CHARTCAL.DIR also included my PREVIOUS chart details which had to be deleted before conversion. I assumed the new CHARTCAL.DIR would overwrite the old one.
Tor, do you mean that CHARTCAL.DIR may contain the calibration data of more than one chart?

I always renamed CHARTCAL.DIR with something like NZ53.DIR before starting a new calibration so I never experienced such behaviour.

Can you post the CHARTCAL.DIR containing the 2 calibration data?

Ciao, Marco.
__________________
GPS-Marco is offline   Reply With Quote
Old 26-10-2009, 11:14   #26
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 305
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
Attached Files
File Type: txt CHARTCAL.DIR.txt (889 Bytes, 126 views)
__________________
jonasaberg is offline   Reply With Quote
Old 26-10-2009, 11:22   #27
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
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
Thanks! I'll grab this tonight. -dan
dacust is offline   Reply With Quote
Old 26-10-2009, 11:44   #28
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almerķa, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551
Every so impressed Dan/Marco! This is turning into a bit of a dev community now
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 26-10-2009, 11:56   #29
Registered User
 
jonasaberg's Avatar

Join Date: Jul 2008
Location: Kristiansand, Norway
Boat: Wasa 410
Posts: 305
It seems MapCal keeps track of each calibrated file by making continued added entrys to the CHARTCAL.DIR file.
Each new entry is marked with the name of the imagefile name in straight brackets.

Please check the attached CHARTAL.DIR file. It contains two sets of data, the first the same as I sent an hour ago, the second a set of data for an NewZeeland chart.

As you see I added some information that there is no natural place for but might be nice to be able to read while navigating without having to zoom in and read the fine print on the chart.

I am not sure, but my suggestion is to warn the user if the Chartcal.dir contains multiple data or to just give a warning message that only chartcal.dir files with one set of data is allowed to be used.
It is potentially dangerous to mess up with the calibration of a chart...so it is a good idea to build some safety into it so that the right set of calibbration data is used when creating a kap file.

/Jonas

ps remove the trailing .doc on the filename...
Attached Files
File Type: doc CHARTCAL.DIR.doc (2.0 KB, 65 views)
__________________
jonasaberg is offline   Reply With Quote
Old 26-10-2009, 12:35   #30
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
It seems MapCal keeps track of each calibrated file by making continued added entrys to the CHARTCAL.DIR file.
Each new entry is marked with the name of the imagefile name in straight brackets.

Please check the attached CHARTAL.DIR file. It contains two sets of data, the first the same as I sent an hour ago, the second a set of data for an NewZeeland chart.

As you see I added some information that there is no natural place for but might be nice to be able to read while navigating without having to zoom in and read the fine print on the chart.

I am not sure, but my suggestion is to warn the user if the Chartcal.dir contains multiple data or to just give a warning message that only chartcal.dir files with one set of data is allowed to be used.
It is potentially dangerous to mess up with the calibration of a chart...so it is a good idea to build some safety into it so that the right set of calibbration data is used when creating a kap file.

/Jonas

ps remove the trailing .doc on the filename...
That is an important catch. Another thing for me to look at tonight. It should be easy to check for multiple sets and reject. Might be possible to allow a batch, either by defaulting the name to chars in the chart name, or reading a config file, or by using switches. We'll see what I can come up with.

-dan
__________________

dacust is offline   Reply With Quote
Reply

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



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 22:04.


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.