Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 27-08-2011, 11:10   #136
Registered User

Join Date: May 2011
Posts: 847
Re: map2kap - OziExplorer to OpenCPN

Horst,

Thanks for that, it works great.

I had to make a small change to run it on windows 7. I had to add .exe to imgkap in line 514 which becomes

Code:
if system("imgkap.exe #{opts} \"#{picFileName}\" \"#{hdrFileName}\" \"#{kapFileName}\"")
Without the .exe extension there I got the "system call to imgkap failed" message.

Chris
__________________

__________________
Littlechay is offline   Reply With Quote
Old 27-08-2011, 15:59   #137
Registered User

Join Date: Jul 2011
Location: Southern Germany
Boat: Crisline 530
Posts: 33
Re: map2kap - OziExplorer to OpenCPN

Hi Chris, hi everybody,

thanks for pointing out the Windows 7 problem. My testing is on Windows XP, so I didn't see this problem. I have fixed this and some other minor issues.

While I was at it I also added a new feature, multi-file processing. You can now specify more than one file name before the scale parameter. Of course, you can also use wildcards. No need to build your own for loop around the script call any more. Simply type something like:
map2kap *.map 25000
to convert a folder full of 1:25000 maps to KAPs.

Find attached to this post Version 0.2.10 of the script. As usual, remove the .doc extension after downloading.

Keep on testing, and sending feedback.

Horst
Attached Files
File Type: doc map2kap.rb.doc (21.2 KB, 675 views)
__________________

__________________
hyman is offline   Reply With Quote
Old 28-08-2011, 04:32   #138
Registered User

Join Date: Jul 2011
Location: Southern Germany
Boat: Crisline 530
Posts: 33
Re: map2kap - OziExplorer to OpenCPN

Hi all,

goofy me, Version 0.2.10 doesn't work for multiple files, as I have discovered in further testing. Stay tuned for an update later today...

Best wishes

Horst
__________________
hyman is offline   Reply With Quote
Old 28-08-2011, 16:26   #139
Registered User

Join Date: Jul 2011
Location: Southern Germany
Boat: Crisline 530
Posts: 33
Talking map2kap 0.2.20 - multi-file drag & drop

Hi all,

after still more fiddling, here is the latest greatest version (that is, until someone points out the need for more fixes ) of map2kap. Major improvements:
  • multi-file processing (really, this time )
  • files can have different scales now; the script prompts you if you don't otherwise specify a scale
  • a drag&drop batch companion
Assuming you have imgkap and ruby already up and running, installation is as simple as this:
  • remove the .kmz extension from the attached archive file
  • unzip to any convenient location
  • copy map2kap.bat and paste a shortcut to the desktop (and/or wherever else you find it convenient to drop files for conversion)
The shortcut allows you to conveniently drop a bunch of map or image files, to get them converted. No need to explicitly open a DOS prompt any more, unless you need to use advanced parameters beyond the scale.

I wonder whether my fix for Windows 7 (calling imgkap.exe instead of imkap) has sacrificed proper operation in Linux. How is the imgkap executable typically named in Linux? If the script fails on you on Linux, removing the .exe may well help. I may need to use different executable names depending on platform. Also, drag&drop for Linux is still missing...

So, whoever downloaded Version 0.2.10 from yesterday's post, please discard and try this one instead. And whoever uses this, keep the feedback coming...

Best wishes

Horst
Attached Files
File Type: kmz map2kap.zip.kmz (7.5 KB, 347 views)
__________________
hyman is offline   Reply With Quote
Old 29-08-2011, 00:06   #140
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,018
Re: map2kap - OziExplorer to OpenCPN

Horst,
on Linux, executability is a file attribute - imgkap is called simply imgkap there.
Maybe just take the imgkap executable to the front of the script in form of a variable in the next version so that it's more intuitive to adjust - will be also handy for people on Windows not having imgkap.exe in the PATH for some reason...

Thanks for your work

Pavel
__________________
nohal is online now   Reply With Quote
Old 29-08-2011, 00:33   #141
Registered User

Join Date: Jul 2011
Location: Southern Germany
Boat: Crisline 530
Posts: 33
Re: map2kap - OziExplorer to OpenCPN

Hi Pavel,

good ideas, will roll them into the next version.

Hi all,

In the meantime, whoever gets error messages about the imgkap system call, you can edit the ruby script on line 684 to your needs.

I really want to keep the script multi-platform, but that's not for free Can anybody hint me on possible solutions for drag&drop on Linux?

Best wishes

Horst
__________________
hyman is offline   Reply With Quote
Old 30-08-2011, 01:56   #142
Registered User

Join Date: Jul 2011
Location: Southern Germany
Boat: Crisline 530
Posts: 33
Re: map2kap 0.2.21 - should now work multi-platform again

Hi all,

in this version, I have fixed the known multi-platform issues:
  • name for imgkap executable shoucl now always be correct
  • Converted the script from DOS-style to Unix-style line-endings
  • Checking ruby version we are running on (because map2kap is not compatible with some popular older versions of ruby)
Still no drag&drop on Linux or MacOS, because I have no idea how to do that.

Installation procedure described three posts upthread...

Please test this version on whatever operating system you can get hold of, and send feedback what works out-of-the-box and what doesn't.

Best wishes,

Horst
Attached Files
File Type: kmz map2kap.zip.kmz (7.7 KB, 223 views)
__________________
hyman is offline   Reply With Quote
Old 30-08-2011, 06:39   #143
Registered User

Join Date: Jul 2011
Location: Southern Germany
Boat: Crisline 530
Posts: 33
Re: map2kap - OziExplorer to OpenCPN

Hi all,

here is a recipe for the Linux users who wish to use drag&drop. The procedure is slighly different for the KDE and Gnome desktops.
  • On the KDE desktop, right-click to open the context menu
  • Select Create New --> Link to application... from the context menu
  • Fill out the Properties dialog that opens as follows:
    • In the General tab, type the name map2kap
    • In the Application tab, type the command /<path>/map2kap.rb %F (substitute <path> with the absolute path to the directory in which map2kap.rb resides)
    • Still in the Aplication tab, click on the button Advanced Options.
    • In the dialog that opens, activate the options Run in terminal and Do not close when command exits. Click OK
    • Back in the Properties dialog, click OK again.
In the Gnome desktop, the procedure is a bit simpler:
  • Right-click to open the context menu
  • Select Create Launcher... from the context menu
  • Fill out the dialog that opens as follows:
    • Name: map2kap
    • Command: /<path>/map2kap.rb %F (substitute <path> with the absolute path to the directory in which map2kap.rb resides)
You should now have a new icon named map2kap on your desktop. If everything was done correctly, upon double-click you should see a new window that describes the usage of the map2kap script.

For regular use, drag one or more Ozi .map files or image files onto the map2kap desktop icon. A window should open in which the map2kap script runs and reports about the conversion.

Please send feedback if this works for you, or where you get stuck, if it doesn't.

Best wishes,

Horst
__________________
hyman is offline   Reply With Quote
Old 07-11-2011, 01:34   #144
Registered User

Join Date: Jul 2011
Location: Southern Germany
Boat: Crisline 530
Posts: 33
Re: map2kap - OziExplorer to OpenCPN

Hi all,

this is a repost of the above update, to finally get the download links straight; map2kap is still version 0.2.22. The major change from the previous version is that filenames can directly contain the scale parameter, as a numeric portion at the end:
  • as before: numbers in the range [6..20] are assumed to be Google maps zoom levels, and an appropriate scale is automatically chosen
  • new: numbers in the range [500..10000000] are directly used as the scale parameter
Main reason for the change was to better support the chart packages offered by freietonne.de.

For those of you who haven't used map2kap before, here are the installation instructions for Windows XP:
  1. Download the current version of the Ruby programming language
  2. Create a new folder "Chart Tools" in "C:\Program Files\"
  3. Download imgkap.exe and place it into "C:\Program Files\Chart Tools".
  4. Download map2kap.zip and unzip. Place both contained files map2kap.rb (the actual conversion tool) and map2kap.bat (the drag&drop companion) into "C:\Program Files\Chart Tools", too.
  5. "Copy" the batch file map2kap.bat and "Paste shortcut" on the Desktop (or any other place that you like for drag&drop).
  6. Open Start -> Control Panel -> System. Click the "Advanced" tab, and then the button "Environment Variables".
  7. In the area "System Variables", select the variable "Path" and click the button "Edit". Append ";C:\Program Files\Chart Tools" (without the quotes, but with the semikolon at the beginning!) to the "Variable value".
  8. Finalize the change by clicking "OK" three times through the different dialogs. Close the Control Panel.
  9. Double-click map2kap on the desktop. A new window should appear, showing brief usage information for map2kap.
Installation on other versions of Windows is similar. Users of Linux or Mac OS will need to compile imgkap themselves (out of scope for this description). For them, map2kap.bat is not used. Still at least for Linux there is a way to enable drag&drop (see post #143 above).

How to use

In order to create a BSB/KAP file from an Ozi MAP, you always need a pair of source files:
  • A picture file (for example .jpg, .png oder .tif)
  • A Calibration file ending in .map
Both of these need to be stored in the same folder. Conversion can be started either of two ways:
  • Open a command prompt. cd into the folder containing the source files. Start map2kap.rb with the required command line parameters. (Without any parameters map2kap.rb shows brief usage information.)
  • If no other parameters are needed besides the file name(s), you can also drag&drop files onto the map2kap Desktop symbol.
Either way, map2kap informs about progress and potential problems during conversion. Converted BSB/KAP files are placed into the same folder that contains the source files.

FreieTonne charts are available as ZIP files, but contain (among others) Ozi Mapfiles. With this newest version of map2kap it is now easy to convert a whole package at once:
  1. Download the ZIP file of the area you are interested in, and unarchive
  2. Open a command prompt. cd to the folder that contains the unzipped files.
  3. Run map2kap.rb *.map ... wait ... finished
Have fun

Horst
__________________
hyman is offline   Reply With Quote
Old 06-02-2012, 07:31   #145
Registered User

Join Date: Mar 2010
Location: Brittany
Boat: ovni 385 Volver
Posts: 19
Re: map2kap - OziExplorer to OpenCPN

I would like to try the version 0.2.22 of map2kap which seems to be the final answer to my problem of chart conversion, but it seems to be impossible to download it : I signed in the forum, looked for the file, foud the link but got that answer :

vBulletin-Systemmitteilung

siff, Sie haben keine Rechte, um auf diese Seite zuzugreifen. Folgende Gründe könnten z.B. dafür verantwortlich sein:
  1. Sie versuchen, den Beitrag eines anderen Benutzers zu ändern oder auf administrative Funktionen zuzugreifen. Überprüfen Sie bitte in den Forenregeln, ob Sie diese Aktion ausführen dürfen.
  2. Wenn Sie versucht haben, einen Beitrag zu schreiben, kann es sein, dass Ihr Benutzerkonto deaktiviert wurde oder noch aktiviert werden muss.
Do you have a solution ?

Thanks in advance.

Frank
__________________
siff is offline   Reply With Quote
Old 11-02-2012, 05:36   #146
Registered User

Join Date: Jul 2011
Location: Southern Germany
Boat: Crisline 530
Posts: 33
Re: map2kap - OziExplorer to OpenCPN

Hi Frank,

Soory for thaking a while for getting back to you...

Goofy me; the link to map2kap.zip in the post above points into a German forum where I also maintain a thread about map2kap. That's why it won't let you have the file. Where it gets your user name for the personal greeting is a mystery to me, though.

Anyway, here is a link that should work:
http://share.recomedia.de/horst/map2kap.zip
Let me know how you get along; it seems you are the first person to download v0.2.22.

Regards

Horst

PS: Can a moderator correct the link to map2kap.zip two posts up, please?
__________________
hyman is offline   Reply With Quote
Old 08-01-2013, 14:36   #147
Registered User

Join Date: Jan 2010
Location: Cape Canaveral, FL
Boat: Ovni 345
Posts: 30
Re: map2kap - OziExplorer to OpenCPN

Hi,

I have this message :
Picture file name given on command line differs
from the one contained in .map file.
Using picture file from command line.

I used oziexplorer 3.95.3b to create the map file


Thanks a lot
__________________
fblc is offline   Reply With Quote
Old 14-01-2013, 11:52   #148
Registered User

Join Date: Jan 2010
Location: Cape Canaveral, FL
Boat: Ovni 345
Posts: 30
Re: map2kap - OziExplorer to OpenCPN

Hello,

Since a few day I have this message :
Map2Kap Version 0.2.22
Visit OpenCPN - Cruisers & Sailing Forums to get the
latest version, to report bugs, and to discuss enhancements.

Collecting data...
D:/ConvCartes/map2kap.rb:139:in `GetFileInfo': undefined method `+' for nil:NilC
lass (NoMethodError)
from D:/ConvCartes/map2kap.rb:334:in `<main>'


I use maps from TrekBuddyMapMaker

Can you help me

Please
__________________
fblc is offline   Reply With Quote
Old 18-01-2013, 16:28   #149
Registered User

Join Date: Jul 2011
Location: Southern Germany
Boat: Crisline 530
Posts: 33
map2kap - Known bugs and workarounds

Hi all,

I have identified the bug pointed out in the previous post: If you use file names that are entirely numerical, such as 1.png/1.map, you will get the following error message:

Quote:
Originally Posted by fblc View Post
map2kap.rb:139:in `GetFileInfo': undefined method `+' for nil:NilClass (NoMethodError)
from D:/ConvCartes/map2kap.rb:334:in `<main>'
The obvious workaround is to not use such file names. If you already have a file pair like the above, it is sufficient to rename just the .map file to something like c1.map. (Since the .map file contains a reference to the picture by file name, 1.png in our example, do not rename the picture file!) Then you have to use the .map file name on the command line (for example map2kap c1.map).

Another minor bug is that if you give just the base name on the command line (like in map2kap x), map2kap will no be able to find the files, even though it should. So be sure to give the name of the .map file, as proposed above. (If both the .map file and the picture file have the same base name, you can instead give the picture file name, like in map2kap x.png. However, don't specify both the .map and the picture file names of one and the same chart on a command line. If you do, you will get an error message about the duplicate, telling you that one was ignored.)

Hope this helps

Horst
__________________
hyman is offline   Reply With Quote
Old 20-04-2013, 23:02   #150
Registered User

Join Date: Apr 2013
Posts: 4
Re: map2kap - OziExplorer to OpenCPN

Hello everyone,

Great forum, so thanks to everyone that contributes.

I have some LINZ Topo50 charts in OziExplorer .map format and want to convert them to OpenCPN .kap files.

I've managed to get img2kap installed and working... for the most part... and converted a bunch of maps however when I view them in OpenCPN things look pretty funky.

(please attached image)

Has anyone seen this before and has some idea what the problem is? You will notice that the red map outlines are not straight but have a curve in them?

Finally, when I try to convert a few of the .map files I get the following error. It only happens on certain maps but they are all from the same source and processed the same way.

(please attached image)

I've Googled the error and searched on this forum but can't find any reference to it. Hopefully someone can assist.

Thanks in advance
Attached Thumbnails
Click image for larger version

Name:	opencpn_topo.jpg
Views:	335
Size:	367.0 KB
ID:	59588   Click image for larger version

Name:	img2kap_getpalette.jpg
Views:	297
Size:	30.8 KB
ID:	59589  

__________________

__________________
inspectaclueso is offline   Reply With Quote
Reply

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
Portable OpenCPN zemaria OpenCPN 12 05-07-2010 05:34
I Have a Few Questions Regarding OpenCPN Skua OpenCPN 1 03-06-2010 23:24
OpenCPN bdbcat OpenCPN 1343 19-09-2009 16:59
OziExplorer phiggins Navigation 2 27-06-2009 14:43



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 09:10.


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.