imgkap Version 1.0b

Install 

For linux 64, 32 bit and other system


Having a C or C++ compiler : gcc, g++…

Download and install freeimage-dev
Ubuntu > sudo apt-get install libfreeimage-dev
(Prefer last version, see The FreeImage Project)

Download imgkap.c and compile width gcc or g++:
> gcc imgkap.c -O3 -s -lfreeimage -o imgkap

For Windows :


Use imgkap.exe include all code, requires no download FreeImage.

Optional :

You can link this program into another program and use kap conversion function
> gcc myprogram.c -D LIBIMGKAP imgkap.c -lfreeimage -o myprogram
Contact me for more information.

Possible evolution : Using another header format for input and/or output (kml, map…) and other format Geotiff...

Usage

This software can :

convert map file KAP to image file and extract header KAP file
convert image file to KAP file
convert KML file to KAP file
using WGS84 coordinates of the image
using data and coordinates from KAP file or header

Description of file extension

{ext1} map file format, KAP or N01

{ext2} image formats accepted are the formats accepted by FreeImage :
bmp,gif,jpg ou jpeg,pbm,pgm,png,ppm,tga,tif ou tiff…

{ext3} Header file format, text only KAP file

Convert kap to image :

• imgkap mykap.kap myimg.png : convert mykap into myimg.png
• imgkap mykap.kap mheader.kap myimg.png : convert mykap into header myheader (only text header kap file) and myimg.png

Description : imgkap maykap.{ext1} [myhader.kap] [myimage.{ext2}]

myheader : Is optionnal output file with text only KAP header
myimage : Is optionnal output image file 
Note : myheader or/and myimage must be defined.

Convert image to kap : 

Convert image file to KAP file using header file

• imgkap myimg.png myheaderkap.kap : convert myimg.png into myimg.kap using myheader.kap for kap informations
• imgkap myimg.png myheaderkap.kap myresult.kap : convert myimg.png into myresult.kap using myheader.kap for kap informations

Description :

imgkap myimg.{ext2} myheader.kap [myresult.kap]

myheader can be kap file or text only kap file (headerfile)
if myresult is not defined, directory and name of output kap file is myimg.kap

Options :

-t "Title"
Allows you to change the title in the file kap.
By default the title is of the header file.

 

Convert KML file to KAP file using header file

• imgkap mykml.kml myheaderkap.kap

Options :

-f : fix units to FATHOMS, default : METERS
-s name : fix souding datum, default : UNKNOWN

-t "Title"
Allows you to change the title in the file kap.
By default the title is of the header file.

 

Convert image file to KAP file using WGS84 positioning

• imgkap mykap.png lat0 lon0 lat1 lon2 myresult.kap : convert myimg.png into myresult.kap using WGS84 positioning
• imgkap -s 'LOWEST LOW WATER' myimg.png lat0 lon0 lat1 lon2 -f : convert myimg.png into myimg.kap using WGS84 positioning and options

Description :

WGS84 positioning :
lat0 lon0 is a left,top point 
lat1 lon1 is a right,bottom point
lat to be beetwen -85 and +85 degree
lon to be beetwen -180 and +180 degree
Different format are accepted :   -1.22   1°10'20.123N   -1d22.123

Options :

-f : fix units to FATHOMS, default : METERS
-s name : fix souding datum, default : UNKNOWN
-t "Title"
Allows you to change the title in the file kap.
By default the title is of the image file name.