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 Rating: Thread Rating: 4 votes, 2.00 average. Display Modes
Old 27-12-2010, 16:58   #841
Registered User
 
sailorF54's Avatar

Join Date: Dec 2009
Location: Perros-Guirec, France
Boat: Jeanneau Sunshine 36
Posts: 999
Quote:
Originally Posted by sinbad7 View Post
Referring to BSB 4 PlugIn 'sailor54' #13



2. A more automatic way to generate a screen size display of a GoogleEarth map can be done using the 'GE2KAP' program.

The only problem is the missing soundings and other navigation marks.

Regds
Tore
Thanks for the tip, Tore. Funny, I was just trying to get the GE2KAP program to work (spotted it in another thread today on CruiserForum). I could not use the latest ooRexx4.1.0...exe , had to revert to ooRexx4.0.1... (with up to date Vista).
Seems to work fine, but some little shortcomings re Chartaid
It grabs the entire window, which is tricky to resize, and retains the Google logo and copyright notice on the chart.
sailorF54 is offline   Reply With Quote
Old 27-12-2010, 17:02   #842
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
Don.. #842. Thanks a lot,great utility.. I have sent following message to the author: Download:http://www.mylittlehost.com/dimmer.aspx
Quote:
Thank you,EXCELLENT facility we have been looking for...
We are a comunity of yachtsmen using the free OpenCPN navigation software and needed a dimming facility for chartwork at night. The problem is that the Microsoft palette only dims colours and not white areas. Most deep-water chart areas are white.

Perhaps your utility could become a plugin to OpenCPN?

I am copying this message to our message board.
Regards
Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 27-12-2010, 17:08   #843
Registered User
 
nv5l's Avatar

Join Date: Dec 2010
Location: Liveaboard
Boat: Allied Luders 33, Hull 98, 1971
Posts: 393
Images: 1
Cool, glad you liked it.
__________________
don
NV5L
S/V Aurora
nv5l is offline   Reply With Quote
Old 27-12-2010, 17:12   #844
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
sailorF54.

Although it takes a little longer to create,my 1. suggestion is better and allows virtually unlimited chart area to be created for later panning. You can also edit the bitmap as a .jpg and compress it before starting the conversion.

The Firefox 'Screengrab' plug-in is also a great facility when you need to capture bitmaps larger than the screen area.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 28-12-2010, 01:37   #845
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Quote:
Originally Posted by oem View Post
I have some charts in geotiff-format. I want to convert them to BSB3 with the use of gdal_translate. I managed to download gdal and even make it running in VC2008 express :-).
With the help of QGis and a lot of googling I think I found my way through, so I think I have now tested all possibilities for making BSB3-charts from Geotiff with GDAL. And the conclusion is that EITHER does GDAL not support the creation of BSB3-charts with proper georeferencing data OR does GDAL not support the reading of georeferencing data from geotiff's (and thus not being able to transfer it to the BSB3-file).

The frustrating thing is that it can only be a couple of days programming away, since both formats are more or less supported. So close, but yet not possible...

Confirmed?
oem is offline   Reply With Quote
Old 28-12-2010, 06:31   #846
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
oem...

In the meantime we continue converting bitmaps in 'the old way'.
No problem really,only takes a little longer.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 28-12-2010, 08:30   #847
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Quote:
Originally Posted by oem View Post
With the help of QGis and a lot of googling I think I found my way through, so I think I have now tested all possibilities for making BSB3-charts from Geotiff with GDAL. And the conclusion is that EITHER does GDAL not support the creation of BSB3-charts with proper georeferencing data OR does GDAL not support the reading of georeferencing data from geotiff's (and thus not being able to transfer it to the BSB3-file).

The frustrating thing is that it can only be a couple of days programming away, since both formats are more or less supported. So close, but yet not possible...

Confirmed?
I don't know more about gdal than you. I think that Hamish might be the man to ask.
But.....a geotiff is just a tiff with a text file. If it's just a question of a few charts just write the kap text header by hand (also called template) and use tif2bsb.
A simple script should also do, if geotiff text files are written to a standard? Compare with my script to convert ozi .map files + picture to a .kap chart. The only geotiffs I have access to are the Aussie test tiffs where one text file covers 3 charts.

Thomas
cagney is offline   Reply With Quote
Old 29-12-2010, 08:12   #848
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Quote:
Originally Posted by cagney View Post
I don't know more about gdal than you. I think that Hamish might be the man to ask.
But.....a geotiff is just a tiff with a text file. If it's just a question of a few charts just write the kap text header by hand (also called template) and use tif2bsb.
A simple script should also do, if geotiff text files are written to a standard? Compare with my script to convert ozi .map files + picture to a .kap chart. The only geotiffs I have access to are the Aussie test tiffs where one text file covers 3 charts.

Thomas
Thanks for your help.

My problem is that my source charts are in a proprietary format (.IT-format). I can automatically convert them to Gtiff, ecw, Jpg, Bmp and one or two more formats. It's a repeated (yearly) procedure, and there is approx 60-70 charts totally. For 2011 approx 30 of them are updated, so I have to 're-calibrate' them.

It can be done by hand, or by re-using my previous CHARTCAL.DIR and mc2bsbh, but after reading and testing GDAL with the full source-code in VC2008, and seeing how close it is, - I'm sold or at least very curious to see how far I can get in creating BSB-charts.

It seems that the BSB-header in GDAL (BSB_read.c, called through gdal_translate.cpp and bsbdataset.cpp) is always written as text constants, no matter what the input chart contains. My next attempt will be to change BSB_read.c to match one of my particular charts and see if I can get that chart readable by OpenCPN. That would be a proof-of-concept for gdal as BSB-chart creator.

GDAL's potential for being a chart-conversion machine to be integrated into a possible plugin to Opencpn might be the percpective..? QGis and OpenEV, that are both built upon gdal seem to be able to georeference charts (similar to MAPCAL), but my learning curve is very steep and slow so I have not yet managed to do it :-)
oem is offline   Reply With Quote
Old 29-12-2010, 14:58   #849
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Sure is christmas holiday, so time for some interesting tests of GE2KAP:

http://www.cruisersforum.com/forums/...p-43680-3.html
oem is offline   Reply With Quote
Old 01-01-2011, 06:06   #850
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Quote:
Originally Posted by oem View Post
My next attempt will be to change BSB_read.c to match one of my particular charts and see if I can get that chart readable by OpenCPN. That would be a proof-of-concept for gdal as BSB-chart creator.
Which is hereby confirmed. gdal_translate creates BSB charts readable by Opencpn without problems. I copied the BSB-header form one of my charts and hardcoded that into gdal, - and then ran

gdal_translate -of BSB input-chart.tif output-chart.kap.

Next task is to try to locate georeferences in the Geotiff files I have. They must be there.. Why should they be called GeoTIFF else?
oem is offline   Reply With Quote
Old 01-01-2011, 06:37   #851
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
Which is hereby confirmed. gdal_translate creates BSB charts readable by Opencpn without problems. I copied the BSB-header form one of my charts and hardcoded that into gdal, - and then ran

gdal_translate -of BSB input-chart.tif output-chart.kap.

Next task is to try to locate georeferences in the Geotiff files I have. They must be there.. Why should they be called GeoTIFF else?
I think this may be what you are looking for:

--> listgeo - Dump GeoTIFF Metadata

There used to be a Geotiff Examiner, but it was bought by AutoDesk and is no longer available for free.

-dan
dacust is offline   Reply With Quote
Old 01-01-2011, 10:05   #852
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
oem... I have converted around 9 of the aforesaid geotiff charts simply using the geo references shown in the charts top right and bottom left corners and they seem pretty accurate.

The listgeo utility mentioned by dan can be downloaded here:MapTools Download: /dl/geotiff/libgeotiff

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 01-01-2011, 10:36   #853
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
oem

Sure it's interesting to learn what the capabilities of gdal is in this case. But if the georef info in a geotiff can be extracted, a very lightweight script would do, like a simple rewrite of my map2kap (ozi explorer to kap).
In your particular case where you already have done the geo-referencing and only want to update your charts to include recent corrections, a rewrite of the ruby script below, that I use to give existing charts a dimming palette, would do.
Code:
#!/usr/bin/env ruby

#TH 2010-11-23,28

require 'fileutils'

unless ARGV[0] && ARGV[1]
        puts ""
	puts "This script ads dimming palettes to a kap file."
	puts "There are two ways to use this script:"
	puts "#{$0} -f  kap file to rewrite"
	puts "#{$0} -d directory containing kap files"
	puts "The oiriginal files are not touched. The new files are named D_old name."
	puts "If a directory is given as an argument, all the new files are in a dirctory called \"Fixed_Palette\"." 
	  puts ""
	exit(false)
 end
 
mode = ARGV[0] 
chart = ARGV[1] 

#############the rewrite function########################
def kap_rewrite(infile)
  if infile =~/\./
	outfile = infile.split(".")[0]
  end
  


 open("#{outfile}.hdr","w") do |h|
  lines = open infile
  lines.each do |line|
    
    #If at start of the binary part stop, we're done.
    
    if line =~/\0/
      break
    end
    
    #Keep everything, but the palette entries.
    
    unless line =~/RGB|DAY|DSK|NGT|NGR|GRY|PRC|PRG/
	h.puts line
    end
   end
 end    

 system("bsb2tif  #{infile}  #{outfile}.tif ")
 system("mytif2bsb -c 127  #{outfile}.hdr  #{outfile}.tif  D_#{infile}")
 system("rm #{outfile}.tif ")
 system("rm #{outfile}.hdr")
 puts "Fixed #{infile}"
end
###############################################

if mode == "-f"
kap_rewrite(chart)
end

if mode == "-d"
  Dir.chdir("#{chart}") 
  Dir.mkdir("Fixed_Palette") unless File.directory?("Fixed_Palette")
  Dir.foreach("#{chart}") { |x| kap_rewrite(x) unless File.directory?(x) }
  system("mv D_* Fixed_Palette")
end
Thomas
cagney is offline   Reply With Quote
Old 01-01-2011, 10:53   #854
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
Hi all.. I am un-successfully trying to read the header of a geotiff file using 'listgeo' as follows c:/TEMPFILE/listgeo [-tfw] [-proj4] kort142.tif but no receive no resulting file?
Using just c:/TEMPFILE/listgeo kort142.tif shows a quick screen flash but no file generated.

(listgeo.exe is located in my C:/TEMPFILE directory)

What am I doing wrong?

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 01-01-2011, 14:23   #855
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 sinbad7 View Post
Hi all.. I am un-successfully trying to read the header of a geotiff file using 'listgeo' as follows c:/TEMPFILE/listgeo [-tfw] [-proj4] kort142.tif but no receive no resulting file?
Using just c:/TEMPFILE/listgeo kort142.tif shows a quick screen flash but no file generated.

(listgeo.exe is located in my C:/TEMPFILE directory)

What am I doing wrong?

Tore
I'm not sure why it isn't working, but you should leave the brackets [] out of the command string.

From what I read, the second way you ran it should work. That is, it should display to screen.

Output to screen:
  • c:/TEMPFILE/listgeo kort142.tif

Output to file named kort142.txt:
  • c:/TEMPFILE/listgeo kort142.tif > kort142.txt

Output both a kort142.txt and a kort142.tfw world file.
  • c:/TEMPFILE/listgeo -tfw kort142.tif > kort142.txt

So, silly question, are you sure it's a GeoTIFF and not just a standard TIFF?

Another silly question, are you running it with:
  • 1. Start > Run > listgeo ....
Or,
  • 2. Start > Run > cmd > listgeo...
If you are doing 1, then try 2 instead.


If you can attach the .tif I'll check it out.

-dan
dacust is offline   Reply With Quote
Reply

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

Advertise Here


All times are GMT -7. The time now is 23:27.


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.