Originally Posted by bewitched
I'm really struggling to convert jpg files to a format I can use in Open CPN
. Hope someone can help - not much is going right at the moment.
The files I want to convert are found here:
Office of Coast Survey's Historical Map & Chart Project Image Catalog
(search region Philippine Islands)
I'm trying to follow the instructions here:
Conversion Using Linux | Official OpenCPN Homepage
They don't seem to be working for me (to be honest I don't understand much of what they say - there seems to be an assumption that the reader has software development or programming knowledge - which I don't).
1st issue: Can't figure out how to use imagemagick. Doesn't seem to have an .exe file or any obvious (to me) way to install. Tried running from from the command prompt (something I only found out about the other day - and don't really understand). All I get there is "Invalid Parameter - -colors"
I did download another converter software and manage to get .tif and .png files from the .jpg (although they are between 200,000KB and 400,000KB each)
2nd issue is with Mapcal. I can't open the .png files I have created. Mapcal goes straight to "not responding' as soon as I try to open them. Is this a file size thing? I've been successful if I crop down to just a little corner of the jpg & convert it.
I did manage to generate a CHARTCAL.DIR file successfully with a small corner of the chart, but failed to get a .hdr file or a .kap.
I guess what I'm asking for are very simple step by step instructions that someone who is not familiar with software development or programming can follow.
Do such instructions exist?
Well,I'll try if you don't mind the blind leading..
Be aware that trying to open a chart image in some Pictureview programs is like watching paint
dry.A large image can easily overcome your ram and choke your page file too, I guess.Therefore.Start with a happy,fast computer,freshly rebooted,and with as much of the stuff down at the clockTURNED OFF as you can live with.That said,I can open 350mb chartbmps on a PIII so what ARE you doing wrong,eh?
Charting programs are excellent at opening huge images
Anyways,get your image.Get a MERCATOR one or a rectangular piece of ANY map say where the planet seems flat eh?2000x2000 pixels is fine but less is better for now?say 1024x720?Oh,I dunno... .Fuss later.Rectangular IS probably best.To start,why not use the "PrintScreen"button on your computer if you know about it? You CAN use much bigger images but now,just get something that's seeable.
If it's not already a ".bmp",you need Convert it. (I like Irfanview...there's a portable version It won't take over ALL your pictures unless you tell it to in options I love Faststone too but NOT for this work)
Whatever program you use,Find out the image's colour depth
.It's there somewhere in almost every program..."Info"Properties"somewhere.Irfanview shows it on the bottom border.Look for a way to downgrade The colour depth
.This is also called bit depth.In irfan it's "Image,Reduce Colour Depth"
256 colours is 8 bitsperpixel. 16 colours is 4 bitsperpixel.
Really,in a chart,16 colours is fine and it simplifies here and now.
But 256 is fine and more common.Google Earth grabs look better.
Now "save as" dialogue.and choose "bmp".AND choose a shortnospace name.THEN,save it again with the same name but this time "save as"tif" (or"tiff")It's best to save a tif without compression
until you or I know better!
Reopen the picture to make sure I haven't forgot to mention something!Ok?
by the way,I should have said,While you are looking at the picture,note it's projection,DepthUnits,and scale IF AVAILABLE but if not, carry on.
MapCal ..."File,Open Image"
Browse to your bmp.The first thing ,Now,the pop-upwindow is called "Chart Information" shows up to fill in the name of your Project
.You have to name it.Choose a SHORT one.There are places for other info you might have handy but blanks are ok EXCEPT the Datum and Projection.
Datum is your choice. I go for WGS84,as it's the general usage.Don't fill any corrections in to start.Projection,well,I know seaclear works for several but just now,MERCATOR Any Charting program should be happy with it.
click ok.You can return to that dialogue anytime with "Edit,Chart Info"
Now clickndrag the image to a place you know the position.On a chart picture this is really easy given the crossings of lat/long lines.Place the cross over this spot.Without moving it,rightclick and choose "Addnew..."You cannot evermove it again.But you can delete it by placing the cursor over it and rightclick"delete.Now,fill in it's lat and long under "Point One" Format can be Degree,Minutes remainder as decimal minutes. and don't forget N or S Likewise Longitude.E or W .LOOKS LIKE:
In my example this is tremendously easy because I have these lines crossing:50 08 and 124 52
MY numbers do not agree,you'll note....but that's the datum thing.I know they drew the map on 1927Datum.No satellites then.Just Windup clocks.It's not suprising longitude is out a bit.It's astounding how good charts
CAN be.(Hail Parizeau and Assistants!)These corrections I deduce from the chart's printed info to .63"/60 North and 5.1"/60 East-well,actually I'm guessing here to illustrate but you can do better.Just remember that they DREW these charts so don't get too worked-up yet.
To choose and find the positions of your calibration points without it being so easy,you can easily have another chart program going or even be online with with a mapserver in another window.MapCal doesn't need much resources.Find mountain tops and rocks and so on that agree with your picture.(By the way,I think Google Earth
maps are "Lat/Long".This means the long scale=latitude scale!So they will not fit exactly over a mercator)
Place the next point Diagonally to the first.
When you have 2 points,Put a grid on .Choose "Normal" then "Activate Changes"
If the grid suits,you are nearly done.Put a third calibration point in,a fourth,a fifth if you want.Keep an eye on the grid.It's your best insurance
against screwing up.
Really,two will work
More can help or hinder depending.Fuss later.
NOW go to File,SaveCalibration.A message pops up.You now have a CHARTCAL.DIR(somewhere!oh yes-in the same directory as your image.)
Go and look at it.Open it with notepad.Savour it.Rename it is what I would do....say,"1CHARTCAL.DIR".Otherwise,If you do another calibration,it'll end up in there too.For now,that complicates.Rename it Please.
Now you're nearly done.CONCENTRATE.This is the worst part,maybe.
In WindowsXP -sorry,I'm old-
Goto "Start",choose "Run".Type"cmd" no quotes of course then "Ok"
In XP,the default for cmd prompt starts in "Documents and Settings\Administrator"For now,make copies of mc2bsbh and tiff2bsb and put em in that folder.It's easier.But you could use CD as your first command and tell the command prompt where to go.....just avoid having to repeat longstringsoftextthatallowerrorswhereyoudon'thavet o.
At the blinking cursor in that black window,type:
"mc2bsbh" no quotes.I won't say"no quotes" again.
...and hit "Enter"on your keyboard.I will hereafter say "<Enter>" for this.
You should now see this in XP:
"Microsoft Windows XP [Version 5.1.2600]
1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>mc2bsbh
mc2bsbh (beta09): converts georeference format from MapCal to BSB
Usage: mc2bsbh [-d] [-s chartname] [-o outfile | -e extension] [-l] <infile>
<infile> : the output from MapCal - normally CHARTCAL.DIR
-d : this is debug mode. It prints out a bunch of garbage
-s chartname : convert a single
chart header from <infile>
-o outfile : to specify your own header file name
-e extention : to specify your own header extension
-l : to print out just the list of charts in <infile>
C:\Documents and Settings\Administrator>"
...a few notes:I did tell you to use shortnames and avoid spaces because it's simpler and less tedious.
"<space> means a space.
Now do this:
mc2bsbh<space>1chartcal.dir .... hit "<Enter>"key.
TADA!Hope it worked.You should see "YourMapcalChartname.hdr"appear in the same folder.
Now type this: "tif2bsb<space>YourMapcalChartname.hdr<space>yourm ap16colourstiff.tif<space>thenameofyourNewChart.ka p "<Enter>
I did tell you to make a tif.
Now-you got an error?Did you make a 256 colour tiff?It's Ok.
Redo the command as this:
tif2bsb<space>-c<space>127<space>yourMapcalchartname.hdr<space>yo ur256colourtiffile.tif<space>yourbrandnewkapsname. kap"<Enter>
you don't need to use capitals even if they exist in the name.That said,you can put Capitals in the output and they'll show.In any case,you can change the name of the kap to whatever you want now it's made.Run off and test it in your chart program.