Cruisers Forum
 


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 03-01-2011, 14:03   #16
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 oem View Post
I'm sorry I haven't seen this utility before now. I'll continue when I get some spare time again :-)

But I wonder if gdal_translate would be able to do the same, that is transform from Gtiff/tiff to KAP with some GCP's as parameters.

See GDAL: gdal_translate and the -gcp option.

I have not yet tested the -gcp option of gdal_translate.

When I get some spare time again :-)
However, gdal does not support writing BSB, it will only read it.

-->GDAL Raster Formats

Not saying gdal_translate may not be useful for this, just that it won't be a one step process.

I think we will need something like:
  • gdal_list to a file
  • Something like mc2bsbh to read the file and create the .hdr file (this would be new code)
  • tif2bsb to create the file
That is, if geotiffs are always palette style tiffs. If not, there would be a couple of ImageMagick "convert"s in there.

Good news: It should be able to be coded to be totally automatic.
Bad news: GeoTiff is very, very flexible. I forsee the distinct possibility of constantly running into a different flavor of GeoTiff that would require tweaking the code.

-dan
dacust is offline   Reply With Quote
Old 03-01-2011, 14:20   #17
Registered User

Join Date: Dec 2008
Posts: 24
Trying to be a bit philosofical here:

SW is developing all the time. In most cases it is the data produced and used by the SW that is the really valuable thing. A new SW that can not use the existing data is somewhat lost. OpenCPN seems certainly on its way, but not quite yet.

Remember how Bill Gates killed Word Perfect and Lotus 123? Do you think he would have managed that if all existing users of WP and 123 would have had to hand-convert all their historic files?

/Magnus
MagnusS is offline   Reply With Quote
Old 03-01-2011, 15:14   #18
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Quote:
Originally Posted by dacust View Post
However, gdal does not support writing BSB, it will only read it.

-->GDAL Raster Formats

-dan
Just one quick correction with gdal_translate:

When one line of code in 'bsbdataset.cpp' is uncommented, then gdal supports the creation of BSB-files. For copyright reasons that line was commented out, to avoid any risc of breaking Maptech copyright rules, that's all explained in 'bsbdataset.cpp' in a letter to Frank Warnerdam from thr guy who finally succeded in 'decoding' the BSB-format.

I changed the line in VC2008 express, compiled, and it works perfectly. I posted a number of entries in this forum on my attempts for converting Gtiffs to BSB and it's so close, so close. The problem is my lack of understanding on projections and datums, therefore I don't create the right BSB-header information. Unfortunately I'm busy with other things right now, but I'll come back asap :-) My next attempt will be gdal_translate with some GCP's specified and some more QGis 1.6.0 georeferencing.

Thanks for your ideas and comments :-)
oem is offline   Reply With Quote
Old 03-01-2011, 15:21   #19
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Sorry the mail is in 'BSB_read.c'. It's from Mike Higgins to Frank Warnerdam.

and here is the uncommented line from bsbdataset.cpp:
//Disabled as people may worry about the BSB patent
#define BSB_CREATE
oem is offline   Reply With Quote
Old 03-01-2011, 15:22   #20
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 oem View Post
Just one quick correction with gdal_translate:

When one line of code in 'bsbdataset.cpp' is uncommented, then gdal supports the creation of BSB-files. For copyright reasons that line was commented out, to avoid any risc of breaking Maptech copyright rules, that's all explained in 'bsbdataset.cpp' in a letter to Frank Warnerdam from thr guy who finally succeded in 'decoding' the BSB-format.

I changed the line in VC2008 express, compiled, and it works perfectly. I posted a number of entries in this forum on my attempts for converting Gtiffs to BSB and it's so close, so close. The problem is my lack of understanding on projections and datums, therefore I don't create the right BSB-header information. Unfortunately I'm busy with other things right now, but I'll come back asap :-) My next attempt will be gdal_translate with some GCP's specified and some more QGis 1.6.0 georeferencing.

Thanks for your ideas and comments :-)
Awesome.

Sad thing is, now that you've said it, I seem to remember hearing that before, a long time ago.

Thanks for the correction.

That means, of course, creating a release of gdal_translate for our BSB creations. Better yet, would be to extract the code we need. But we are quickly getting beyond my abilities.

-dan
dacust is offline   Reply With Quote
Old 03-01-2011, 15:41   #21
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Quote:
Originally Posted by dacust View Post
Awesome.

Sad thing is, now that you've said it, I seem to remember hearing that before, a long time ago.

Thanks for the correction.

That means, of course, creating a release of gdal_translate for our BSB creations. Better yet, would be to extract the code we need. But we are quickly getting beyond my abilities.

-dan
Yes, - I originally got it here, from manimaul:
http://www.cruisersforum.com/forums/...tml#post322600


We're beyond my abilities too. But I can do lots of google, a little coding, and a lot of test. And I have som charts in GTiff.. So I must try to find a solution. Maybe extend my abilities :-)
oem is offline   Reply With Quote
Old 12-08-2011, 03:05   #22
Registered User

Join Date: Aug 2011
Location: Netherlands (Meppel area)
Boat: Doerak 1000LX
Posts: 12
Re: Convert TIFF Image into Map KAP

Creating KAP from Mapcal....

Hallo all,
(my first post on this forum...)

Just had some time available and was looking for a convenient way to create KAP files from mapcal calibrated charts.
So i wrote a small utility using Nconvert, Mc2bsbh and tif2bsb, with a graphical interface. Written in VB6 (yes good old times....)
It's a first attempt, tested on XP. Could someone else have a look at it as i am not able to test it on another PC. After starting the application, just browse to the folder where chartcal.dir is located and browse to an outputfolder. The rest is easy and hopefully working. Put this exe and the forementioned tools in one folder and doubleclick Helpcal.exe. That should do it. It may be neccessary to instal the VB6 runtime environment, can be downloaded at Download the Visual Basic 6 Runtime library (vb6 dll)
(rename the attached file to HelpCal.exe)
Good Luck!!
Comments welcome!
Attached Files
File Type: doc helpcal.doc (48.0 KB, 322 views)
Erik Holewijn is offline   Reply With Quote
Old 12-08-2011, 08:07   #23
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Convert TIFF Image into Map KAP

Quote:
Originally Posted by Erik Holewijn View Post
Creating KAP from Mapcal....

Hallo all,
(my first post on this forum...)

Just had some time available and was looking for a convenient way to create KAP files from mapcal calibrated charts.
So i wrote a small utility using Nconvert, Mc2bsbh and tif2bsb, with a graphical interface. Written in VB6 (yes good old times....)
It's a first attempt, tested on XP. Could someone else have a look at it as i am not able to test it on another PC. After starting the application, just browse to the folder where chartcal.dir is located and browse to an outputfolder. The rest is easy and hopefully working. Put this exe and the forementioned tools in one folder and doubleclick Helpcal.exe. That should do it. It may be neccessary to instal the VB6 runtime environment, can be downloaded at Download the Visual Basic 6 Runtime library (vb6 dll)
(rename the attached file to HelpCal.exe)
Good Luck!!
Comments welcome!
Hi Erik!
Nice to have a GUI!
nogo for me on XP yet..I have VB6 and I think I've done everything per mc2bsbh,nconvert in the helpcal folder.Nconvert seem to go ok but I get this message...mc2bsbh not ok
and "Trying to start Mc2bsbh..
Could not open file SYSTEM\helpcal.dir"

but Helpcal DID write a "helpcal.dir"..well,I'll try some more things..

Click image for larger version

Name:	helpcalerror.jpg
Views:	287
Size:	76.4 KB
ID:	30416
HappySeagull is offline   Reply With Quote
Old 12-08-2011, 08:10   #24
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Convert TIFF Image into Map KAP

here's the log:
Code:
8/12/2011 7:33:46 AM program start
8/12/2011 7:46:22 AM program start
8/12/2011 7:46:38 AM nconvert.exe -out tiff -colors 64 -o helpcal.tif "d:\KEEPERS\Navigation\BSBconversion\MAPCAL+MCBSBH SYSTEM\29122.BMP">helpcal.txt
8/12/2011 7:46:45 AM mc2bsbh -s 29122 -o helpcal.hdr d:\KEEPERS\Navigation\BSBconversion\MAPCAL+MCBSBH SYSTEM\helpcal.dir>helpcal.txt
8/12/2011 7:47:00 AM mc2bsbh not OK!!
8/12/2011 7:47:24 AM program start
8/12/2011 7:47:32 AM nconvert.exe -out tiff -colors 64 -o helpcal.tif "d:\KEEPERS\Navigation\BSBconversion\MAPCAL+MCBSBH SYSTEM\29122.BMP">helpcal.txt
8/12/2011 7:47:39 AM mc2bsbh -s 29122 -o helpcal.hdr d:\KEEPERS\Navigation\BSBconversion\MAPCAL+MCBSBH SYSTEM\helpcal.dir>helpcal.txt
8/12/2011 7:49:38 AM mc2bsbh not OK!!
8/12/2011 7:59:29 AM program start
8/12/2011 7:59:36 AM nconvert.exe -out tiff -colors 64 -o helpcal.tif "d:\KEEPERS\Navigation\BSBconversion\MAPCAL+MCBSBH SYSTEM\29122.BMP">helpcal.txt
8/12/2011 7:59:42 AM mc2bsbh -s 29122 -o helpcal.hdr d:\KEEPERS\Navigation\BSBconversion\MAPCAL+MCBSBH SYSTEM\helpcal.dir>helpcal.txt
8/12/2011 7:59:59 AM mc2bsbh not OK!!
HappySeagull is offline   Reply With Quote
Old 12-08-2011, 08:25   #25
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Convert TIFF Image into Map KAP

PS..I had borders on that first one so tried again without(Unless I do it,MapCal then creates borders at image edges,I know...) but still nogo.something simple like that wrong,I bet.I also tried putting mc2bsbh in ONE of my system folders but I will pop it into system32 and see.
HappySeagull is offline   Reply With Quote
Old 12-08-2011, 08:48   #26
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Convert TIFF Image into Map KAP

IT WORKS!
guess what it was...the NAME of my workfolder..."MAPCAL+BSBH SYSTEM\"
the space threw it off! a bad habit,that..spaces.
DOS_LIVES!

Borders ok,too!Nice work,Erik!
HappySeagull is offline   Reply With Quote
Old 15-08-2011, 00:35   #27
Registered User

Join Date: Aug 2011
Location: Netherlands (Meppel area)
Boat: Doerak 1000LX
Posts: 12
Re: Convert TIFF Image into Map KAP

Wonderful! That's why i stated in the Help: The tools are not supporting blanks in names... Same for foldernames (isn't it logical???
For this bl....... reasons i had to work with a copy of chartcal.dir and replace every blank by an "x".
If there are no blanks or special characters in the filename or folder it should be ok.
If you have any enhancements, please tell me.

Best regards, Erik (on my boat at this moment)
Erik Holewijn is offline   Reply With Quote
Old 15-08-2011, 01:54   #28
Registered User

Join Date: Aug 2011
Location: Netherlands (Meppel area)
Boat: Doerak 1000LX
Posts: 12
Re: Convert TIFF Image into Map KAP

By the way, Happy Seagull, did you notice the option of batch-processing all the maps in Chartcal.dir? On my system it works fine (take care of the spaces!)
Erik Holewijn is offline   Reply With Quote
Old 15-08-2011, 08:41   #29
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Convert TIFF Image into Map KAP

Hi Erik!help?help?Only thing I had was your first post.
As to spaces,hey,I'm just a windozing user,eh ...offer me a gui and I want intuitive..just clickn-clickn-clickn' at it.. ... some of my folder names and file names just happen to have spaces.. logicalisnotwhatI'dcallitratheradisciplinesuitedto amachine
Haven't given the batch a goodrunyetbutitworkswithtwook.
HappySeagull is offline   Reply With Quote
Old 15-08-2011, 10:58   #30
Registered User

Join Date: Aug 2011
Location: Netherlands (Meppel area)
Boat: Doerak 1000LX
Posts: 12
Re: Convert TIFF Image into Map KAP

Hi HappySeagull,

with "help" i mean the help button on the GUI...
Same with me, R.T.F.M., but i never do it...
Erik Holewijn is offline   Reply With Quote
Reply


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
Image Stabilization Binoculars Teej Product or Service Reviews & Evaluations 8 24-06-2009 10:14
Image stabilized binoculars bottleinamessage Monohull Sailboats 21 14-12-2007 15:31
No edit, no image Vasco Forum Tech Support & Site Help 3 12-10-2006 02:06
Am I retarded or?? how to put up an image? Bob Norson Forum Tech Support & Site Help 21 25-04-2006 16:55

Advertise Here


All times are GMT -7. The time now is 16:45.


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.