Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 16-04-2012, 00:13   #166
Registered User
 
HappySeagull's Avatar

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

Hola!, M'dJ !
__________________

__________________
HappySeagull is offline   Reply With Quote
Old 18-04-2012, 05: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, 05:42   #168
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 61
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, 06:59   #169
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,018
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, 08:44   #170
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,395
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, 23:37   #171
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 61
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, 23:56   #172
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,018
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 23-04-2012, 00:12   #173
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 61
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, 21: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:	73
Size:	124.1 KB
ID:	40502Click image for larger version

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

Name:	Screenshot from 2012-04-28 10:11:31.png
Views:	70
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:	74
Size:	220.5 KB
ID:	40505Click image for larger version

Name:	Screenshot from 2012-04-28 11:15:52.png
Views:	72
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:	68
Size:	73.9 KB
ID:	40507Click image for larger version

Name:	Screenshot from 2012-04-28 11:31:54.png
Views:	66
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:	69
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, 02:33   #175
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,249
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, 04:40   #176
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
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, 04: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, 06:53   #178
Registered User

Join Date: Sep 2012
Location: Plymouth, UK
Boat: Dufour 36 Classic
Posts: 12
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, 07:02   #179
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
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, 07:08   #180
Registered User

Join Date: Sep 2012
Location: Plymouth, UK
Boat: Dufour 36 Classic
Posts: 12
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

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 19:07.


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.