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 15-04-2012, 23:13   #166
Registered User
 
HappySeagull's Avatar

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

Hola!, M'dJ !
HappySeagull is offline   Reply With Quote
Old 18-04-2012, 04:07   #167
Registered User

Join Date: Apr 2012
Posts: 1
Re: imgkap - kap File Converter Tool

Quote:
Originally Posted by MdJ View Post
Hi all, Happy, Tore, ...

If you have any questions or requests to imgkap, please, it is my pleasure to answer.

M'dJ
Hi. A couple of times, I've converted Google maps to .KAP. I wouldn't use that for an ocean, but they're pretty OK for canal boating and for roads.

I create a URL using Google Maps, then use some utility to create a PNG file from it. The URL actually contains the lat and lon of the image file. However, it doesn't give you the lat and lon of the top left corner, but of the middle of the map. It also gives the size of the map (in degrees). Calculating is pretty easy, but I've modified your code to add a "-c" switch. This changes the interpretation of the lat0,lon0,lat1,lon1 to what Google's URLs have.

Would you like to have this code and maybe incorporate it into your codebase?
synp is offline   Reply With Quote
Old 22-04-2012, 04:42   #168
MdJ
Registered User

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

Quote:
Originally Posted by synp View Post
Would you like to have this code and maybe incorporate it into your codebase?
Hello,
Yes, I can add this option, you can mail me your update (private message or mail alain.cousinie@laposte.net).
I return you a new code, or if you prefer an executable for Windows to test.

There was also a problem on date format (us, eu...).But I do not know how to determine the correct format, system date or origin of the map?

M'dJ
MdJ is offline   Reply With Quote
Old 22-04-2012, 05:59   #169
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: imgkap - kap File Converter Tool

MdJ...
From what I can tell from the docs available and what we used in the NGA charts project, the date should be following the ISO 8601 standard:
Code:
diff --git a/imgkap.c b/imgkap.c
index 5da93b2..066f847 100644
--- a/imgkap.c
+++ b/imgkap.c
@@ -4,6 +4,7 @@
  *  Thank to freeimage, libsb and opencpn
  *
  *    imgkap.c - Convert kap a file from/to a image file and kml to kap
+ *    modified by nohal 2011-0812 - changed the format of CED/ED to YYYY-MM-DD
  */
 
 #define VERS   "1.11"
@@ -1482,7 +1483,7 @@ int imgheadertokap(int typein,char *filein,int typeheader, int optkap, int color
 
         time(&t) ;
         date = localtime(&t);
-        strftime(datej, sizeof(datej), "%d/%m/%Y",date);
+        strftime(datej, sizeof(datej), "%Y-%m-%d",date);
     }
 
     header = fopen(fileheader, "rb");
Pavel
nohal is offline   Reply With Quote
Old 22-04-2012, 07:44   #170
Registered User
 
HappySeagull's Avatar

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

....meanwhile, there's this link, that Surveyor found...
Exploring Google Maps

which provides corner coordinates on a grabbed image 1600x1200 or a 3200x2400 image... works in firefox for sure...

Might be good for linux users that are a bit put out they can't use GE2kap etc.

added you will also want screengrab plugin for firefox...
http://www.screengrab.org/

check to see if it'll work in your version of firefox
HappySeagull is offline   Reply With Quote
Old 22-04-2012, 22:37   #171
MdJ
Registered User

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

[QUOTE=nohal;936489]MdJ...
From what I can tell from the docs available and what we used in the NGA charts project, the date should be following the ISO 8601 standard:
[CODE]

Hello nohal,

Can you indicate the sources where specified ISO 8601 with versions of KAP map?

Because on official maps (SHOM) in v1.1, the date format is "%m/%d/%Y".

M'dJ
MdJ is offline   Reply With Quote
Old 22-04-2012, 22:56   #172
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: imgkap - kap File Converter Tool

MdJ...
My newest Argentinian charts use the same:
Code:
CED/SE=0,RE=0,ED=05/26/2009
NTM/NE=0,ND=05/26/2009
VER/3.07
So it looks like both your and our format is wrong...

Pavel
nohal is offline   Reply With Quote
Old 22-04-2012, 23:12   #173
MdJ
Registered User

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

[So it looks like both your and our format is wrong...]

Yes, it seems that the format is "mm/dd/yyyy" (US)

M'dJ
MdJ is offline   Reply With Quote
Old 27-04-2012, 20:43   #174
Registered User
 
globalkeith's Avatar

Join Date: Sep 2010
Location: Zhuhai, China
Boat: Prout G55
Posts: 76
Re: imgkap - kap File Converter Tool

Hi All,

So I've written a script which grabs tiles from a well known search engine and stitches them all together and then feeds the result into imgkap.

I seem to get some strange behaviour with the resulting kap file within OpenCPN.

With quilting turned on, the image does not display complete image and is not in correct location. Also another strange thing is clicking repeatedly on the button causes the image to move upwards a few pixels at a time:

Click image for larger version

Name:	Screenshot from 2012-04-28 09:49:37.png
Views:	152
Size:	124.1 KB
ID:	40502Click image for larger version

Name:	Screenshot from 2012-04-28 10:10:32.png
Views:	147
Size:	106.1 KB
ID:	40503Click image for larger version

Name:	Screenshot from 2012-04-28 10:11:31.png
Views:	148
Size:	79.1 KB
ID:	40504

With quilting turned off, (without north up) the image "appears" to be correctly positioned, but incorrectly rotated:

Click image for larger version

Name:	Screenshot from 2012-04-28 11:15:32.png
Views:	158
Size:	220.5 KB
ID:	40505Click image for larger version

Name:	Screenshot from 2012-04-28 11:15:52.png
Views:	153
Size:	235.0 KB
ID:	40506

And finally with "North up" enabled, this positioning is off again:

Click image for larger version

Name:	Screenshot from 2012-04-28 11:31:43.png
Views:	160
Size:	73.9 KB
ID:	40507Click image for larger version

Name:	Screenshot from 2012-04-28 11:31:54.png
Views:	147
Size:	106.9 KB
ID:	40508

Really my question is, is there something wrong with my kap file which causes this behaviour?

I'm using the latest OpenCPN source from github

When I download tiles, they are jpg, and the stitching is done using imagemagick, and then the call to imgkap is this:

imgkap map.jpg 22.355156 114.252319 22.360236 114.263306 map.kap

Here's the image:

Click image for larger version

Name:	map.jpg
Views:	144
Size:	22.7 KB
ID:	40509

And finally here's the kap:

map.kap.doc


Happy to share my code when I get it working, appreciate any help please.

thanks
Keith
globalkeith is offline   Reply With Quote
Old 29-04-2012, 01:33   #175
Registered User

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

globalkeith

I'm sure that your georeferencing is off, a bit. The position of the corners are not quite correct. It seems mostly to be a latitude glitch.

Thomas
cagney is offline   Reply With Quote
Old 29-04-2012, 03:40   #176
MdJ
Registered User

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

Quote:
Originally Posted by cagney View Post
globalkeith

I'm sure that your georeferencing is off, a bit. The position of the corners are not quite correct. It seems mostly to be a latitude glitch.

Thomas
Langue source : anglais
That's right.

See imgkap Version 1

WGS84 positioning:
lat0 lon0 is a left, top point (UNLESS the-c option is specified)
lat1 lon1 is a right, bottom point (UNLESS the-c option is specified)
To Be lat beetwen 85 and -85 degree
To Be beetwen lon -180 and 180 degree
Different formats are accepted: -1.22° 10'20 .123N 1-1d22.123

so try
imgkap 22.360236 114.252319 22.355156 114.263306 map.jpg map.kap
and tell us if it's OK

M'dJ
MdJ is offline   Reply With Quote
Old 30-04-2012, 03:21   #177
Registered User
 
globalkeith's Avatar

Join Date: Sep 2010
Location: Zhuhai, China
Boat: Prout G55
Posts: 76
Re: imgkap - kap File Converter Tool

Sweet, thanks guys, finally got it to work!!! Only runs on linux as it relies on curl at the moment, but if anyone wants a copy of the code for educational purposes drop me a pm.
globalkeith is offline   Reply With Quote
Old 13-09-2012, 05:53   #178
Registered User

Join Date: Sep 2012
Location: Plymouth, UK
Boat: Dufour 36 Classic
Posts: 13
Re: imgkap - kap File Converter Tool

I keep getting the 'Please install GraphicsMagick' box come up when I start the program and I have installed it....

Anyone got any idea?

It means that I am unable to use the software to create .KAP files which is somewhat annoying ;-)
lone_viper is offline   Reply With Quote
Old 13-09-2012, 06:02   #179
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
Re: imgkap - kap File Converter Tool

Probably a path problem. IMG2KAP does not find the neccessary program.

Meantime,try GE2KAP,works very well.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 13-09-2012, 06:08   #180
Registered User

Join Date: Sep 2012
Location: Plymouth, UK
Boat: Dufour 36 Classic
Posts: 13
Re: imgkap - kap File Converter Tool

Windows person here... ;-)

Doesnt the GE2KAP program convert Google images to KAP?

I am looking at converting a BMP, that has been run through MapCal to get the DIR calibration file out...

For the life of me I cant find anywhere that give the instructions for windows, or uses a piece of windows software.... I think it is all falling down around the formatting of the image files that photoshop is adding..... The reason for using PS is to bring the colour depth right down to take up less space and increase performance. OpenCPN doesnt seem to like very large files.

Thanks in advance
lone_viper is offline   Reply With Quote
Reply

Tags
imgkap


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 654 04-10-2020 05:37
OpenCPN Beta Version 3.1.814 Released bdbcat OpenCPN 185 14-09-2012 07:43
Route File Transfer via SDcard to Garmin 441s four winds Navigation 11 25-02-2012 08:34
GRIB Weather Mark Ward OpenCPN 26 12-02-2012 21:33
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 04:31

Advertise Here


All times are GMT -7. The time now is 22:25.


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.