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-10-2010, 06:00   #1
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
map2kap - OziExplorer to OpenCPN

Here is my first version of a (semi) automatic tool for conversion of
OziExplorer charts to bsb charts.

Quote:
map2kap .map-file picture-file [scale] [Sounding Units] [Soundings Datum]
[lat adj to wgs84 in seconds][long adj to wgs84 in seconds]
If an argument is left out and others follows put 'unknown' as a place holder.
It is alright to, for example, just give the scale and Soundings Unit and nothing else."
map2kap will produce usable charts with just the mapfile and picturefile as arguments, but it is worthwhile to open the chart picture and get some basic information:
The chart scale.
Sounding units - for example METERS or FATHOMS
Sounding Datum for example LAT,lowest astronomical tide.
Information is often available on the chart for applying corrections to the chart to agree with WGS84, Reverse the signs! This may be included in the map file, but not always.

The PP is handled by map2kap by averaging lat for mercs and long for tmercs.
Ozi separates REFs and PLYs, I have chosen to include all the ozi PLYs as REFs as well, as the geo referencing info is there.
Most picture formats are handled, but not always in the most efficient way, especially if the picture already is a tif.

An example
Quote:
./map2kap.rb ROU3.map ROU3.jpg 30000 METERS MSL
Here I'm converting the Uruguayan chart ROU3. Chart scale is 1:30,000, soundings in meters and the datum for soundings is the mean sea level. There is no information available about the Geodetic Datum.When the script has finished, there is a kap file available with the same name as the map&picture file.

Dependencies: ruby, libtif, libbsb, ImageMagic
For this version of map2kap to work on windows you probably need cygwin installed.

I'm looking for Ozi charts that are Transverse Mercator, also chart that actually contains WGS84 corrections.

Feedback, as always, welcome

Thomas
Attached Files
File Type: doc map2kap.rb.zip.doc (2.6 KB, 1019 views)
cagney is offline   Reply With Quote
Old 03-10-2010, 10:17   #2
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
Thomas..

Here's a link where you might find some useful OziExplorer charts:
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 06-10-2010, 01:29   #3
Registered User

Join Date: Jan 2010
Location: Montevideo, Uruguay
Posts: 242
Quote:
Originally Posted by cagney View Post
Here is my first version of a (semi) automatic tool for conversion of
OziExplorer charts to bsb charts.



map2kap will produce usable charts with just the mapfile and picturefile as arguments, but it is worthwhile to open the chart picture and get some basic information:
The chart scale.
Sounding units - for example METERS or FATHOMS
Sounding Datum for example LAT,lowest astronomical tide.
Information is often available on the chart for applying corrections to the chart to agree with WGS84, Reverse the signs! This may be included in the map file, but not always.

The PP is handled by map2kap by averaging lat for mercs and long for tmercs.
Ozi separates REFs and PLYs, I have chosen to include all the ozi PLYs as REFs as well, as the geo referencing info is there.
Most picture formats are handled, but not always in the most efficient way, especially if the picture already is a tif.

An example


Here I'm converting the Uruguayan chart ROU3. Chart scale is 1:30,000, soundings in meters and the datum for soundings is the mean sea level. There is no information available about the Geodetic Datum.When the script has finished, there is a kap file available with the same name as the map&picture file.

Dependencies: ruby, libtif, libbsb, ImageMagic
For this version of map2kap to work on windows you probably need cygwin installed.

I'm looking for Ozi charts that are Transverse Mercator, also chart that actually contains WGS84 corrections.

Feedback, as always, welcome

Thomas
I didn't know you were working on this, as I did something similar. I'll check your stuff later.

Diego
dpons is offline   Reply With Quote
Old 06-10-2010, 03:24   #4
jjt
Registered User
 
jjt's Avatar

Join Date: Jul 2006
Location: Buenos Aires, Argentina
Boat: F&C 39
Posts: 56
Ozi charts

Diego:

Here you can find a bunch of charts for Ozi Explorer from your living area:
Descarga de Cartas Nauticas

Juan José
jjt is offline   Reply With Quote
Old 06-10-2010, 03:59   #5
Registered User

Join Date: Jan 2010
Location: Montevideo, Uruguay
Posts: 242
Quote:
Originally Posted by jjt View Post
Diego:

Here you can find a bunch of charts for Ozi Explorer from your living area:
Descarga de Cartas Nauticas

Juan José
Gracias, parecen ser las mismas que yo he conseguido, pero las voy a revisar. Si logro poner los.kap en un sitio web te las paso.

Saludos

English:

Thanks, they seem the same ones I got, I'll check. If I can get a web site I'll post the corresponding .kap's I made.
dpons is offline   Reply With Quote
Old 06-10-2010, 11:13   #6
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Quote:
Originally Posted by dpons View Post
I didn't know you were working on this, as I did something similar. I'll check your stuff later.

Diego
I hardly knew it myself
I came across some documentation for map files. At the same time I realized that I had spent to much time converting ozi chart pictures by hand. Time to do something about it. Your suggestions got me thinking more about the problem as well.
I will look into your code, but as you can see, Ruby makes the solution easier. If you prefer it can also be seen as quick prototyping for a C++ program. In this case, I don't think that a compiled program will run much quicker, as the bottleneck is "convert".

Thomas
cagney is offline   Reply With Quote
Old 03-01-2011, 11:50   #7
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
Thomas..
Found your original MAP2KAP utility and downloaded map2kap.rb but my Vista CMD does not recognise (.rb) The previous download you suggested from opencpn.org had no suffix just 'map2kap-v1.6' which did not work either.

This is the command line used: map2kap.rb VAN.map VAN3.jpg 30000 METERS MSL

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

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Tore
Make sure you have ruby installed. RubyInstaller for Windows
You also need some dependencies, which you, probably, already have:
libbsb, libtiff and imagemagic.
For windows you must stick the ".rb" at the end of the file from the opencpn.org, just rename it.

The interface has changed a bit since earlier versions. The latest instruction:
Quote:
"Useage: $map2kap picture-file [scale] [Sounding Units] [Soundings Datum]
[lat adj to wgs84 in seconds][long adj to wgs84 in seconds]
If an argument is left out and others follows put 'unknown' as a place holder.
It is alright to, for example, just give the scale and Soundinds Unit and nothing else.
There must exist a valid .map file with the same name as the picture"
In your case this means the following command:
Quote:
map2kap_0.1.6w.rb VAN3.jpg 30000 METERS MSL
As a result you get VAN3.kap in in the same directory.
I have changed a few things that probably wouldn't work on win.
New version here:
map2kap_0.1.6w.rb.doc

It would be great if we get this script working on windows.
Thomas
cagney is offline   Reply With Quote
Old 03-01-2011, 13:02   #9
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
Thomas..

After all this I get the message Ruby can not be downloaded in my area and to write
'noredirect' after the URL which also does not work.. Is Ruby a big file? could I get it somewhere else?

Regds and thanks
Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 03-01-2011, 13:53   #10
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
Thomas..
A lot of burning hoops to jump through...and I'm not a programer...

Finally manged to download and extract ruby-1.9.2-p136 into subdirectory D:\PROGRAM FILES\RUBY.

I have map2kap_0.1.6.rb in C:MAP2KAP directory.

I have IMAGEMAGIC and LIBBSB also in D:\PROGRAM FILES\......

How do these programs interact together?

Where do I direct the CMD line?

Do I have to set up PATHS to all these progs and how?
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 03-01-2011, 16:58   #11
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
Thomas..

Further to my #10 I have moved all the afore mentioned programs to D:\PROGRAM FILES\
I have also set up all the PATHS in the control panel and in particular RUBY as follows:
D:\PROGRAM FILES\RUBY\ruby-1.9.2-p136 - Is that correct?

Executing the command line map2kap_0.1.6.rb VAN3.jpg 30000 METERS MSL (says it is NOT a valid Win32 program and no files are created-(In Norwegian)
I also tried running the command line from within the Ruby directory.

I noticed you added a 'w' as follows: map2kap_0.1.6w.rb but I downloaded your version named map2kap_0.1.6.rb as you mentioned in your #8 that the New version here:
map2kap_0.1.6w.rb.doc probably would NOT work in Windows?

I am getting a little confused...

Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_01 Jan. 03 23.13.jpg
Views:	453
Size:	19.4 KB
ID:	22514   Click image for larger version

Name:	Screenshot_02 Jan. 03 23.14.jpg
Views:	374
Size:	25.2 KB
ID:	22515  

__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 03-01-2011, 19:44   #12
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Click image for larger version

Name:	Map2kap starting.jpg
Views:	454
Size:	62.3 KB
ID:	22521

I used rubyinstaller-1.8.6-p398.exe.on XP,then from the start menu,Ruby provides a "Start Command Prompt With Ruby"
I have map2kap in Documents and Settings \Administrator with all my other dossy stuff because it saves me a lot of pecking!
Then as you see,it starts.
I have not got much further for lack of time but "to you with failing hands-the Torch...!"

ps from cmd prompt I typed:
ruby map2kap.rb
HappySeagull is offline   Reply With Quote
Old 04-01-2011, 01:34   #13
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
The map2kap script does indeed work on windows, at least on XP.
Click image for larger version

Name:	map2kap.png
Views:	462
Size:	96.6 KB
ID:	22522
This is the proof. ImageMagic spits out a lot, but the kap is created and works on OpenCPN 2.3.1

All the dependencies must be in your path. Some packages takes care of his themselves some don't. To see your present path just type "path" in a dos window. To change the path, Google is your friend, and can answer your questions much better than I can .
One way to do it though. Control Panel->system->Advanced->Environment Variables, then find Path in the System Variables panel and add/edit.

Seagull, your installation looks good. The package you downloaded seems to handle the nity gritty things.
Tore, if you have downloaded ruby you probably have to associate the ".rb" ending with ruby manually. Again Google is your friend.

Use the map2kap version ...0.1.6w.rb or the new 0.1.7.rb version, now on the opencpn.org.

Thomas
cagney is offline   Reply With Quote
Old 04-01-2011, 05:05   #14
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
Thomas and Seagull..

I have set up all the paths through the control panel,yet ruby does not accept the CMD input lines saying it is not compatible with Win 32. See attached attempt to produce the map2kap user instructions,even from within the ruby directory. Are you sure this works with Vista? I have used your latest ver. 0.1.6w.rb but no dice...

Here is the PATH contents from the Control panel:
Quote:
D:\PROGRAM FILES\IMAGEMAGIC\ImageMagick-6.6.3-Q16;%SystemRoot%\system32;%SystemRoot%;%SystemRoot %\System32\Wbem;C:\Programfiler\Common Files\Ulead Systems\MPEG;C:\kap;C:\%SYSTEMROOT%\System32\Windo wsPowerShell\v1.0\;C:\Windows\QTSystem\;D:\PROGRAM FILES\RUBY\ruby-1.9.2-p136\;D:\PROGRAM FILES\LIBBSB;D:\PROGRAM FILES\MAP2KAP
Regds
Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_01 Jan. 04 10.58.jpg
Views:	445
Size:	41.2 KB
ID:	22524   Click image for larger version

Name:	Screenshot_02 Jan. 03 23.14.jpg
Views:	446
Size:	25.2 KB
ID:	22525  

__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 04-01-2011, 08:16   #15
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
Thomas..

Now even my Chartconvert prog. does not work any more and all efforts to re-set windows to a previous date also fails.. What happened I wonder?

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 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
Portable OpenCPN zemaria OpenCPN 12 05-07-2010 04:34
I Have a Few Questions Regarding OpenCPN Skua OpenCPN 1 03-06-2010 22:24
OpenCPN bdbcat OpenCPN 1343 19-09-2009 15:59
OziExplorer phiggins Navigation 2 27-06-2009 13:43

Advertise Here


All times are GMT -7. The time now is 15:39.


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.