Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-04-2011, 08:26   #31
Registered User

Join Date: Jul 2009
Location: The Netherlands
Boat: Koopmans, 33 ft cutter
Posts: 170
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by sailias View Post
Greets SGull....where did you find that? A URL would be great.

Regards

/ch
Forgotten Google?
http://www.screengrab.org
__________________

__________________
Zoef is offline   Reply With Quote
Old 01-04-2011, 14:36   #32
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: imgkap - kap File Converter Tool

[QUOTE=sailias;657441]
Quote:
Originally Posted by MdJ View Post
The header format is described KAP (incompletely) in libbsb - BSB File format

Is there any information is the header to crop the white boarders known as collars from a standard chart. I would assume so as the NOAA charts are nicely stitched together in OCPN..just wondering how to do it as it would be very helpfull when creating custom charts.

Best regards and thanks

/ch
Hi,sailias.You can look in the kap file as text with Hxd (http://mh-nexus.de/en/hxd/)
the positions are in there
...as to Firefox screengrab-it is pretty good.I don't know the link but Zoef is right-Google (or Startpage Search Engine for the edgy ones amongst us) is your friend.
another more mousy-seesy-graphical way is to have a look with ozi explorer or (Seaclear's Mapcal_2 may do this too-can't remember as I use Ozi more)...to check calibration points.99% of the time the corners are calibrated and the Borders (where different) are too.

Cropping is quite a crucial operation with IMGKAP.It knows if the proportions aren't exact per the lat/long at that place on the Mercator Earth.But Imgkap will tell you what the size should be...
__________________

__________________
HappySeagull is offline   Reply With Quote
Old 01-04-2011, 20:50   #33
Obsfucator, Second Class
 
dacust's Avatar

Cruisers Forum Supporter

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,743
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by sailias View Post
Is there any information is the header to crop the white boarders known as collars from a standard chart. I would assume so as the NOAA charts are nicely stitched together in OCPN..just wondering how to do it as it would be very helpfull when creating custom charts.

Best regards and thanks

/ch
Code:
! Created by mc2bsbh-0.00.01 - Use at your own risk!
VER/2.0
BSB/NA=Manukau Harbour
    NU=NZ4314,RA=12992,8504,DU=298.824
KNP/SC=48000,GD=WGS84,PR=TRANSVERSE MERCATOR
    PP=0,PI=UNKNOWN,SP=UNKNOWN,SK=0.0
    UN=UNKNOWN,SD=LAT,DX=4.08,DY=4.08
REF/1,2169,1229,-36.916666666667,174.416666666667
REF/2,9476,1229,-36.916666666667,174.750000000000
REF/3,9469,5779,-37.083333333333,174.750000000000
REF/4,2178,5781,-37.083333333333,174.416666666667
REF/5,5822,3501,-37.000000000000,174.583333333333
REF/6,7647,5777,-37.083333333333,174.666666666667
REF/7,4001,5779,-37.083333333333,174.500000000000
REF/8,2173,3505,-37.000000000000,174.416666666667
REF/9,4003,8005,-37.165000000000,174.500000000000
REF/10,9466,8007,-37.165000000000,174.750000000000
REF/11,547,8012,-37.165000000000,174.341666666667
PLY/1,-36.8899689273687,174.341631581421
PLY/2,-37.1650562040491,174.341510292845
PLY/3,-37.1650709130473,174.763325319593
PLY/4,-37.095008094068,174.763339168124
PLY/5,-37.0950445671289,174.866720436627
PLY/6,-36.8900075017051,174.866735233114
PLY/7,-36.8899905583336,174.726670744505
PLY/8,-36.924998422596,174.726663272868
PLY/9,-36.9249898722861,174.646677364748
PLY/10,-36.9299908361069,174.646677594158
PLY/11,-36.9299880832591,174.600009410926
PLY/12,-36.9566592871254,174.600007831208
PLY/13,-36.9566572091881,174.529999425331
PLY/14,-36.9166523546181,174.530005807175
PLY/15,-36.9166550927912,174.500005869187
PLY/16,-36.8899829746526,174.500007220602
DTM/0,0
The REF/ lines are the georeferencing points.
The PLY/ lines describe a polygon around the usable area of the chart.

The one above is from a chart with cutouts, etc, and has a complex shape for the polygon. Most rectangular charts would only have 4 PLY lines.

-dan
dacust is offline   Reply With Quote
Old 02-04-2011, 09:37   #34
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: imgkap - kap File Converter Tool

Thanks,Dacust!A better explanation!
I haven't tried this myself as I haven't cared about borders(I don't use "quilting"much and borders haven't been a pest...yet!)

try this batch with IMG kap also to get the header and the tif from the chart you want to crop the borders from.:http://www.cruisersforum.com/forums/...4&d=1300118736
from Post Imgkap - kap File Converter Tool
you can read the HeaderEX with note pad.Then CROP
the extracted"EX" tif per the pixel references and use just two diagonal corners in the header to rebuild(by editing) or just type em in using this batch. http://www.cruisersforum.com/forums/...9&d=1300046014
this is what it puts out among other things.
You would have to judge if these reference calibration points include the corners you want...looks to me that REF/4 at X=112 Y=111 is a good bet
also,REF /7 X=2499 Y=1173

REF/1,112,2937,50.0666667,-125.3100000
REF/2,2500,2937,50.0666667,-125.2750000
REF/3,2500,112,50.0933333,-125.2750000
REF/4,112,111,50.0933333,-125.3100000
REF/5,1928,111,50.0933333,-125.2833333
REF/6,792,111,50.0933333,-125.3000000
REF/7,2499,1173,50.0833333,-125.2750000
REF/8,1929,1172,50.0833333,-125.2833333
REF/9,791,1172,50.0833333,-125.3000000
REF/10,111,1172,50.0833333,-125.3100000
REF/11,1929,2938,50.0666667,-125.2833333
REF/12,792,2937,50.0666667,-125.3000000
PLY/1,50.0666667,-125.3100000
PLY/2,50.0666667,-125.2750000
PLY/3,50.0933333,-125.2750000
PLY/4,50.0933333,-125.3100000
DTM/ 0.00, 0.00

ADVICE:try be sure you save the tif with minimal interference from your software-keep the colourdepth at <128 (16 is fine for charts)and tiff compression as packbits but safer,none.IMGKAP will convert if you lassez faire through this advice but I know M'dj is off working on a colour correction problem that pops up....and anyways it's faster.
irfanview is my friend in big tifs but try your fave editor first,of course-just be aware of what I am saying....
AGAIN!
I haven't tried this myself ...yet! it may be wrong as to trying to get your solution this way..in fact I'm trying it out just now!Also,it may not help with YOUR charts and just confuse as we backnforth on it...this is an ongoing thing!
Report back if it works for you or not(anyone?)and how to do it(or not !)
__________________
HappySeagull is offline   Reply With Quote
Old 02-04-2011, 10:08   #35
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: imgkap - kap File Converter Tool

Nope,that didn't work too well.So you'll have to use the PLYS and let's figure a way to crop the image....
BY THE WAY!I didn't know this until now,but you CAN use Decimal degrees in an openCPN Waypoint or track.So taking em from the plys SHOULD give you the corners as a "BOX ROUTE" or just marks.The thing now,is to crop the image to these....and yer good to go.Just how,EXACTLY,in a large image,is going to be the trickthe trick...if the "Refs" don't match the "Plys".
__________________
HappySeagull is offline   Reply With Quote
Old 02-04-2011, 10:58   #36
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by HappySeagull View Post
Nope,that didn't work too well.So you'll have to use the PLYS and let's figure a way to crop the image....
BY THE WAY!I didn't know this until now,but you CAN use Decimal degrees in an openCPN Waypoint or track.So taking em from the plys SHOULD give you the corners as a "BOX ROUTE" or just marks.The thing now,is to crop the image to these....and yer good to go.Just how,EXACTLY,in a large image,is going to be the trickthe trick...if the "Refs" don't match the "Plys".

I take that back!
It does work!I was able to crop exactly(in irfan) and using plys rebuild without borders...and the chart works well too.(waypoints agree)
I didn't use the Rebuild script-just the "make a kap script" to make the kap from the cropped tif( http://www.cruisersforum.com/forums/...9&d=1300046014 )
....unfortunately I had to think a bit harder than I like,but it pretty much all comes down to copy and paste if the info for the corners-if REFS somewhere agree with PLYS...are there.It comes down to the graphics editor you like too.

Sailias:it's still going to be a lot of work to convert a lot of charts!If you're still out there,and ask,I'll try to show a demo.
__________________
HappySeagull is offline   Reply With Quote
Old 02-04-2011, 20:22   #37
Registered User
 
sailias's Avatar

Join Date: Mar 2010
Location: Canada
Boat: On the Hard
Posts: 333
Re: imgkap - kap File Converter Tool

I just got in from painting my nephews place so digesting all this information. I did track down an interesting thread very late last night.

See: https://trac.osgeo.org/gdal/ticket/3175

With respect to google and screen scrape, apologies, I misread the post to read there you or someone else was using a specific pluggin for firefox, that worked on google maps. You know download a screen scrape with the geo data in place for easy conversion to a kap file. Seems I misread that post...and yes I know all about google...thanks. ...

/ch
__________________
sailias is offline   Reply With Quote
Old 02-04-2011, 21:22   #38
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: imgkap - kap File Converter Tool

sailias...No,nothing specifically so simple for Firefox with embedded data.....you'd have to take note of the corners is all.The screen grab plugin for firefox is specifically perfect for surveyor's suggestion.Imgkap - kap File Converter Tool which does work great! ...
__________________
HappySeagull is offline   Reply With Quote
Old 03-04-2011, 02:15   #39
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by sailias View Post
...
I did track down an interesting thread very late last night.

See: https://trac.osgeo.org/gdal/ticket/3175

.....

/ch
My quick take on this thread is that Hamish and Manimaul are trying to get gdal to read a kap file the way OpenCPN does.
A lot of this is only documented in the code, but has also been discussed in the huge "chart" thread on this forum.
The PLY polygon in the kap files header is displayed by OpenCPN as the chart outline, if activated in the toolbox. To understand a bit more how this works, get a chart up in single mode (non quilting) and click outside the red line. You can see this area, but it is not a part of the chart as far as OpenCPN is concerned. The area outside the outline is simply ignored when quilting.

Imgkap has one mode where it assumes that (0,0) pixels is the upper left corner of the proper chart picture, hence cropping of the original picture is necessary in this case. But Imgkap, like tif2bsb, can also use a template, or header-file, for more precise control of the chart creation. One very good reason for cropping a chart picture is to cut down on the file size. I do this with a script nowadays, but generally keep a rim with essential info around the chart proper.

Everything in a kap files header can be edited, with a hex editor for example. Don't change the format, line breaks and spacing, and use "bsbfix" from libbsb afterwards.

Thomas
__________________
cagney is offline   Reply With Quote
Old 03-04-2011, 06:04   #40
Registered User
 
sailias's Avatar

Join Date: Mar 2010
Location: Canada
Boat: On the Hard
Posts: 333
Re: imgkap - kap File Converter Tool

Thanks for the explanation Thomas. Lots to learn here. Will take some time to digest it all. What I want to do is crops the collars, build tiles using maptiler to build something like http://www.klokan.cz/projects/gdal2t...penlayers.html and run it separately from opencpn. Its a nice planning tool for the eastern seaboard as its quick and zoomable.Use google cache as described in other posts, and you are good for offline work. Later when I leave I can run a remote copy and folks can follow where Ive been and integrate the data into one part of my website. Im not a programmer so lots to learn here....and thanks to everyone for the input.

Best regards

/ch
__________________
sailias is offline   Reply With Quote
Old 03-04-2011, 09:38   #41
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: imgkap - kap File Converter Tool

Well,I am happy to have incidentally learned that I can use decimal degrees in OpenCPN waypoints!(I knew I could use em in the relevant GPX and XML.)
Decimal Degrees are not so good to sail with but are easier arithmetic...

Indeed,a chart made by IMGKAP never has unseen "Borders".WYSIWYG. If you were cropping a scanned or screengrabbed map and wanted to save a border,you will have to sail across it too.It'll show.
__________________
HappySeagull is offline   Reply With Quote
Old 05-04-2011, 12:51   #42
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 61
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by cagney View Post
Everything in a kap files header can be edited, with a hex editor for example. Don't change the format, line breaks and spacing, and use "bsbfix" from libbsb afterwards.

Thomas
Hello Thomas,

Just a note, I do not recommend using bsbfix because editing can ruin image in file.

That's why I made the header option, the easiest way is to :

> imgkap myfile.kap header.kap myfile (. png,. tif,. ... bmp, jpg not)

Edit and modify header.kap without considering the end of line

> imgkap myfile.xxx myheader.kap mynewfile.kap

PS: I finished the issue of quantize colors, I try and add some functionality before publishing

M'dJ
__________________
MdJ is offline   Reply With Quote
Old 05-04-2011, 20:13   #43
Registered User
 
sailias's Avatar

Join Date: Mar 2010
Location: Canada
Boat: On the Hard
Posts: 333
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by HappySeagull View Post

I take that back!
It does work!
<snip>
Sailias:it's still going to be a lot of work to convert a lot of charts!If you're still out there,and ask,I'll try to show a demo.
Ok read all the material and test imkap on ubuntu. Seems to work well for what its supposed to do. If you have the time a demo on how you crop the collars would be most interesting. I think I understand what you are doing but a walkthrough with an example would be a good howto.

Many thanks in advance should you choose to do this.

/ch
__________________
sailias is offline   Reply With Quote
Old 06-04-2011, 02:10   #44
Registered User
 
simonrdc's Avatar

Join Date: Apr 2011
Location: Cornwall, UK
Posts: 7
Re: imgkap - kap File Converter Tool

Hi guys, where can I download imgkap.exe? I can't find it anywhere. What other apps will I need to convert image data to kap files?
Regards
Simon
__________________
simonrdc is offline   Reply With Quote
Old 06-04-2011, 09:35   #45
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by simonrdc View Post
Hi guys, where can I download imgkap.exe? I can't find it anywhere. What other apps will I need to convert image data to kap files?
Regards
Simon
Hi Simon....yes,it sorta gets lost in here but go to M'dj's first post. That's The #1 post of this thread.
IN WINDOWS:
Go to the bottom of the post and right-click each of these (that I'll list) and right click the links ,"save as" into your computer.You are downloading em,in other words.I can't know how your BloatWare will bark (anti-virus etc) but my bloatware is whipped and cowed....

anyways,you want imgkap1.doc+imgkap2.doc+imgkap3.doc+imgkap4.doc in windows.M'dj did it this way because there's no way he can just place "exes" as downloads on a forum...

Next,you have to use a CMD window to put these together...M'dj did it this way because there's no way he can just place "exes" as downloads on a forum...
FIND your CMD prompt (in xp you can go to Start,Run,and type "cmd" )and wnote where it's default open-stuff location is...what folder?
In XP,its "C:\Documents and Settings\Administrator"

Browse to that folder,copy those four docs into it and then type(or just copy,paste) THIS after the ">":
copy /b imgkap1.doc+imgkap2.doc+imgkap3.doc+imgkap4.doc imgkap.zip

Now,you have a ZIP file.Unzip it,and there's "imgkap.exe"

You don't need anything else but there's stuff mentioned here that's useful.....
__________________

__________________
HappySeagull is offline   Reply With Quote
Reply

Tags
imgkap

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
Development Debugging Environment - Setup Help rgleason OpenCPN 577 11-11-2017 06:02
OpenCPN Beta Version 3.1.814 Released bdbcat OpenCPN 185 14-09-2012 08:43
Route File Transfer via SDcard to Garmin 441s four winds Navigation 11 25-02-2012 09:34
GRIB Weather Mark Ward OpenCPN 26 12-02-2012 22:33
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 05:31



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

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


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.