Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 24-05-2014, 14:01   #1
Registered User

Join Date: Nov 2011
Location: Currently in Portugal
Boat: Tashiba 40
Posts: 82
Online creation of BSB/KAP files from Google Maps

Hello all, I have been working on a Java based website that would allow a user to create Google Maps based bsb/kap file as requested (will hopefully find out soon if this is a good idea). Anyway, I have my first one created and have started to try and test it using OpenCPN. Of course it did not work the first try. Anyway this is a snippet from the opencpn.log

07:48:39 NZST: Searching directory: /home/evergreen/TestCharts for *.kap
07:48:39 NZST: Loading chart data for /home/evergreen/TestCharts/Vanuatu -- Malampa Province -- Maskelynes -- Awei39(2).kap
07:48:39 NZST: ...initialization failed for /home/evergreen/TestCharts/Vanuatu -- Malampa Province -- Maskelynes -- Awei39(2).kap
07:48:39 NZST: CreateChartTableEntry() failed for file: /home/evergreen/TestCharts/Vanuatu -- Malampa Province -- Maskelynes -- Awei39(2).kap

In hopes of getting why it is failing I added "DebugBSBImg" to the opencpn.conf, but I am not getting any more messages. Is it possible to get more detailed messages from OpenCPN as to why this file is not loading? Thanks for any help.

Jon
__________________

__________________
jonturgeon is offline   Reply With Quote
Old 24-05-2014, 14:16   #2
Registered User

Join Date: Nov 2011
Location: Currently in Portugal
Boat: Tashiba 40
Posts: 82
Re: Online creation of BSB/KAP files from Google Maps

I guess I should back up, I have stumbled into how to do this by looking at C code. So, this should be a simple question. I think I understand that the kap is actually 2 parts, the first being the header and the second being the image. What image format should it be in (JPG, PNG, TIFF)? Also, how does OpenCPN know which format the embedded image is in? I looked at the libbsb code and used the tiff image example. Would another image format be easier/better? I am currently converting a PNG to TIFF.
__________________

__________________
jonturgeon is offline   Reply With Quote
Old 24-05-2014, 14:44   #3
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,249
Re: Online creation of BSB/KAP files from Google Maps

I seems to me that you are trying to reinvent the wheel, ...a bit.
Have a look at GE2KAP Google Earth to BSB / KAP

Also read the chart conversion manual Chart Conversion Manual | Official OpenCPN Homepage

Most of us nowadays are using imgkap for conversion rather than libbsb.

If you still have problems, come back with a picture and your kap file, so we can check them out.

Also, make life easy, don't use spaces in your file names.

Thomas
__________________
cagney is offline   Reply With Quote
Old 24-05-2014, 16:16   #4
Registered User

Join Date: Nov 2011
Location: Currently in Portugal
Boat: Tashiba 40
Posts: 82
Re: Online creation of BSB/KAP files from Google Maps

Hi Thomas, thanks for the link I will take a look, I have been using the OpenCPN site for a bunch of my bsb/kap info but had not stumbled on that page yet. If I can not get it working I will try and attach a generated kap here.

You are correct, I am trying to recreate the wheel. There is a reason for this though. We are on currently on a circumnavigation and have used OpenCPN and GE2KAP to create Google Earth kap files. I am a java software developer when I am not sailing. What I have found among a lot of other cruisers is that they don't understand how to use GE2KAP and the steps involved. GE2KAP is a great program with a lot of features but we all seem to be using the simplest form, just a Google Earth image, no overlay or transparency. And most cruisers are looking for the kap files from each other, not generating them. So, I have already developed a website for marker/route sharing for cruisers (there are more features but will try not to get off topic), the next thought I had was to offer server side kap generation. Doing it this way would require no installs on the user's computers and would be a single button click for the user to create and download. These kaps would in no way be as feature rich as the ones generated by GE2KAP but might (this is a big might as I have not proven this out yet) provide the detail that most cruisers I know use.
__________________
jonturgeon is offline   Reply With Quote
Old 24-05-2014, 17:24   #5
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,018
Re: Online creation of BSB/KAP files from Google Maps

jonturgeon...
Just generate a bitmap in a way that seem fit to you and call imgkap to convert it to a KAP. And not to reinvent the whole wheel have a look at https://github.com/ngacharts/ngachar.../tools/KAPtool - the Ruby code should be pretty understandable for a Java programmer...

Pavel
__________________
nohal is offline   Reply With Quote
Old 24-05-2014, 20:51   #6
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: chesapeake bay
Boat: bristol 27
Posts: 2,809
Re: Online creation of BSB/KAP files from Google Maps

Quote:
Originally Posted by jonturgeon View Post
Google Earth kap files. I am a java software developer when I am not sailing. What I have found among a lot of other cruisers is that they don't understand how to use GE2KAP and the steps involved. GE2KAP is a great program with a lot of features but we all seem to be using the simplest form, just a Google Earth image, no overlay or transparency.
I got google earth for windows working on linux, but the ge2kap installer doesn't know how to work even with oorex installed. I think I am missing the source code and have no way to use this program on linux, so I am very interested in alternatives.
Quote:
And most cruisers are looking for the kap files from each other, not generating them. So, I have already developed a website for marker/route sharing for cruisers (there are more features but will try not to get off topic),
Please continue the discussion in another thread. There are a number of people working on this, and we need to work together rather than duplicate efforts.
Quote:
the next thought I had was to offer server side kap generation. Doing it this way would require no installs on the user's computers and would be a single button click for the user to create and download. These kaps would in no way be as feature rich as the ones generated by GE2KAP but might (this is a big might as I have not proven this out yet) provide the detail that most cruisers I know use.
I don't know about server side.. Why do that? Maybe for picking out the boundaries of the kap files? We want the chart images to use the latest google imagery, and also we want to download the data directly from google to reduce network load on our own servers. I think the best bet is to share kap coordinates so anyone can re-generate the charts you selected (along with tracks and waypoints etc...)

One thing I would really like to see is the ability to overlay chart regions.. so regions already having a chart could be used would grab the google imagery as a companion chart. Then an option for walking the coastline (using the gshhs data) for any region as well. Of course users can enter coordinates or select regions as well.

Another thing to keep in mind, google images I am not sure that they are always in a mercator projection. We should determine this as I believe they use a flat conical projection, not the mercator projection that opencpn uses unless zoomed out really far. I'm not exactly sure. See the weatherfax plugin as it can convert coordinates, as well as create kap files. Maybe we can do some integration here.
__________________
boat_alexandra is offline   Reply With Quote
Old 24-05-2014, 21:10   #7
Registered User

Join Date: Nov 2011
Location: Currently in Portugal
Boat: Tashiba 40
Posts: 82
Re: Online creation of BSB/KAP files from Google Maps

Hi Sean, good to hear from you. We met in Vanuatu last season, the anchorage on the SE corner of Santo. We were the ones anchored all the way in and you showed us where the WWII plane wreck was. Anyway thanks for the info.

Here are my reasons for server side.
1. removes any dependency on user platform
2. no user installs
3. easier to use for the average cruiser

I am using a web service call to Google Maps to get a static satellite image. So far the processing is quick, but I am the only user. I have deployed my app on Amazon's Web Services platform which should scale.

I have talked with the developer on another marker sharing site. Given that I a without internet most of the time learning a new language was really not a great option for me. So, my site is written with Java deployed on Tomcat. I also had a number of features that I wanted to offer, the generation of an ebook being important to me (hard to describe but this book is the information all the users have entered organized by area name, sort of an "open source cruising guide written by the users").

Anyway, back to calculating the scale.
__________________
jonturgeon is offline   Reply With Quote
Old 25-05-2014, 04:18   #8
Registered User

Join Date: Nov 2011
Location: Currently in Portugal
Boat: Tashiba 40
Posts: 82
Re: Online creation of BSB/KAP files from Google Maps

Just in case there are some responses, I am heading out tomorrow for the trip from New Zealand to Vanuatu. I expect that I will be without internet access for around 3 weeks. I'll check back when I get access. I did make a bit of progress today. I think I got the header pretty much done, OpenCPN shows the red outline. Now I need to figure out how to convert the TIFF into BSB format, looking into the imgkap code now.
__________________
jonturgeon is offline   Reply With Quote
Old 12-07-2014, 00:35   #9
Registered User

Join Date: Nov 2011
Location: Currently in Portugal
Boat: Tashiba 40
Posts: 82
Re: Online creation of BSB/KAP files from Google Maps

Hi all, thought I would double back and give a quick update. After a few weeks of blowing the C cobwebs out I have the first cut of the online kap file creation deployed written in Java. I ended up completely rewriting the process in Java, it was just too different to warrant a line by line conversion of the C code. At this point I have a few limitations, the biggest one being the images are limited to 640x640 due to the free level of Google Static Maps. The java code will handle larger if I upgrade to the business level of Google Maps. If anyone is curious the site is www.venturefarther.com. In order to create a kap you will need to create a login (free and looks for very little info). Once your id is created look under the "Download/Upload" tab for the "Download a BSB/Kap Map". The page will try and locate you, if you let it. Then zoom/pan to where you want and click the "Download KAP" button, then you are done .

As a side note, I understand one of my limitations is web site design. I really am much better at the code behind the scenes and have always left the UI portion to more gifted people. Well, since I am the only developer I am doing this task also, if you have any comments or suggestions please let me know.
__________________
jonturgeon is offline   Reply With Quote
Old 12-07-2014, 02:44   #10
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: chesapeake bay
Boat: bristol 27
Posts: 2,809
Re: Online creation of BSB/KAP files from Google Maps

Quote:
Originally Posted by jonturgeon View Post
Hi all, thought I would double back and give a quick update. After a few weeks of blowing the C cobwebs out I have the first cut of the online kap file creation deployed written in Java. I ended up completely rewriting the process in Java, it was just too different to warrant a line by line conversion of the C code. At this point I have a few limitations, the biggest one being the images are limited to 640x640 due to the free level of Google Static Maps.
Is there anything preventing you from tiling these to make any size you want?
Quote:
The java code will handle larger if I upgrade to the business level of Google Maps. If anyone is curious the site is www.venturefarther.com. In order to create a kap you will need to create a login (free and looks for very little info). Once your id is created look under the "Download/Upload" tab for the "Download a BSB/Kap Map". The page will try and locate you, if you let it. Then zoom/pan to where you want and click the "Download KAP" button, then you are done .

As a side note, I understand one of my limitations is web site design. I really am much better at the code behind the scenes and have always left the UI portion to more gifted people. Well, since I am the only developer I am doing this task also, if you have any comments or suggestions please let me know.
Where is your source code?
__________________
boat_alexandra is offline   Reply With Quote
Old 13-07-2014, 01:52   #11
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,761
Re: Online creation of BSB/KAP files from Google Maps

Just an idea in this context:
What about to get a more general solution not only for Goggle maps?

OpenStreetMap (OSM) as an alternative for Google Maps offers a WebMapService (WMS) interface. World OSM WMS

Implementing WMS would allow to access to geo-referenced resources from all around the world.
WMS is an open standard Web Map Service | OGC(R)

Quote:
The OpenGISŪ Web Map Service Interface Standard (WMS) provides a simple HTTP interface for requesting geo-registered map images from one or more distributed geospatial databases. A WMS request defines the geographic layer(s) and area of interest to be processed. The response to the request is one or more geo-registered map images (returned as JPEG, PNG, etc) that can be displayed in a browser application. The interface also supports the ability to specify whether the returned images should be transparent so that layers from multiple servers can be combined or not. NOTE: WMS 1.3 and ISO 19128 are the same documents.
Additional stuff from the GDAL site here:
WMS -- Web Map Services
__________________
bcn is offline   Reply With Quote
Old 08-08-2014, 04:39   #12
Registered User

Join Date: Nov 2011
Location: Currently in Portugal
Boat: Tashiba 40
Posts: 82
Re: Online creation of BSB/KAP files from Google Maps

Hi all, sorry for the delay. We just recently got to New Caledonia (Vanuautu internet was pretty tough to use and once we leave Noumea we will be without internet again). I did just release a new version with twice the resolution (and fixed a few ui bugs). I am though occasionally running into a compression issue (most of the time it works fine, have not yet figured out the bug) on kap generation but I will work it out.

As far as the source code question, I have not as of yet uploaded any of the source to the web. And on my todo list is work out a place for a repository online. With the limited internet though for now it will stay local.

bcn, yup that is the direction I would like to go. The idea is that on VentureFarther the kap generation page would have multiple tabs with each tab being a different satellite image provider. The user would be able to locate the image they want on any tab and switch tabs to see which provider they like the best. Then create the kap from that provider. If they moved the map on a tab, then switched tabs the switched to tab map would automatically locate.
__________________
jonturgeon is offline   Reply With Quote
Old 08-08-2014, 17:46   #13
Registered User

Join Date: Nov 2011
Location: Currently in Portugal
Boat: Tashiba 40
Posts: 82
Re: Online creation of BSB/KAP files from Google Maps

One last note before we leave the internet behind. My goal with VF is a tool for the cruising sailor with more features than just the KAP creation. As we all know an undertaking like that is pretty tough for a single developer. So, if anyone is interested in helping out please let me know and we can see if it would work.
__________________
jonturgeon is offline   Reply With Quote
Old 09-08-2014, 03:21   #14
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: chesapeake bay
Boat: bristol 27
Posts: 2,809
Re: Online creation of BSB/KAP files from Google Maps

Quote:
Originally Posted by jonturgeon View Post
One last note before we leave the internet behind. My goal with VF is a tool for the cruising sailor with more features than just the KAP creation. As we all know an undertaking like that is pretty tough for a single developer. So, if anyone is interested in helping out please let me know and we can see if it would work.
I would like to see kap generation based on cm93 data. For example, over a region, pull imagery where the cm93 data shows coastlines and reefs, but omit inland and ocean areas.
__________________
boat_alexandra is offline   Reply With Quote
Old 25-08-2014, 16:38   #15
Registered User

Join Date: Nov 2011
Location: Currently in Portugal
Boat: Tashiba 40
Posts: 82
Re: Online creation of BSB/KAP files from Google Maps

Hi all, first all I think that the cm93 idea is good except for that I am unsure of the legality of using them. If I can ever catch up with my other ideas for VF I would somehow like to integrate cruisers supplied depths to a satellite image. I have been lurking on the OpenSeaMap site to try and cook up some ideas.

I have been continuing work on the kap generation and noticing sporadic issues with the creation (really hard to do this with limited internet access). What I have ended up doing is replacing the quantizer with another one that seems to be much better. After release .98b I have been creating the charts reliably. Also added the tiling (click buttons to page North, South, East, West to stop chart overlap while creating them. Another option is either "Low or High" resolution. And last but not least the option to download the kap within a zip archive (seems to cut down on the file size a bit). The reason for the zip was 2 fold, to reduce download time/bandwidth and also to try and integrate with IPad apps (talked with the SEAiq developer about why his app did not recognize the .kap in the dowload, he mentioned if it came as a zip his app could use it).

Now if I can wrestle through Javascript issues I can move forward with getting kaps created from Bing.
__________________

__________________
jonturgeon is offline   Reply With Quote
Reply

Tags
bsb, google

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
Google Earth to BSB / KAP phiggins Navigation 1282 19-10-2017 17:35



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 19:31.


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.