Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 21-01-2010, 15:48   #136
Registered User
 
Don B. Cilly's Avatar

Join Date: Dec 2009
Location: Ibiza, Spain
Boat: At the moment, Chrome on Ubuntu I'm afraid, but I take out lots of little ones
Posts: 59
Quote:
Originally Posted by sinbad7 View Post
Here is a utility which converts a .kap chart to .png:
Hey thanks, I hadn't checked it out, it's not for me, but for Windows users it can be useful... what's needed there is an equivalent batch file to do the same thing as that kapview "on the fly", it should be really easy if you know the equivalent cmd instructions.

Just a little note, that file is "redundant" it has a 2.6 Mb "ChartConverter.rar" in it that contains the same stuff that is already in the 7zip.

- D.
Don B. Cilly is offline   Reply With Quote
Old 05-02-2010, 07:04   #137
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
Hi,

I am starting to work on a single gdal [http://www.gdal.org] -> kap converter and georeferencing GUI replacement. The existing toolchain is just way more work than it should be. I think the outcome will be two new modules for GRASS GIS: r.out.bsb and i.out.bsb. The r.* one will export an already georeferenced image without any digitizing, i.* will need you to use the built-in georeferencing tool to set the ground control points. You'll probably want to use the built in vector digitizer in both to define the area covering valid map data.

Thanks to the mc2bsbh examples I've got the KAP file pretty much figured out. One really tiny detail question: does the REF/ count for pixel offsets start with 0,0 or 1,1 in the top-left corner of the image file?


gdalinfo can already read BSB charts and gives some clues about what the official NOAA format expects.


thanks,
Hamish
HamishB is offline   Reply With Quote
Old 05-02-2010, 07:18   #138
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
ps - QuantumGIS (http://www.qgis.org) makes a fine BSB viewer. just point it at the .KAP file.
HamishB is offline   Reply With Quote
Old 05-02-2010, 10:15   #139
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Quote:
Originally Posted by HamishB View Post
Hi,
One really tiny detail question: does the REF/ count for pixel offsets start with 0,0 or 1,1 in the top-left corner of the image file?
It starts with 0,0 as far as I know.

The simplest bsb viewer is probably "kapview"
Code:
#!/bin/sh
bsb2png $1 /tmp/new.png
eog /tmp/new.png
unlink /tmp/new.png
I use this as my default .kap viewer.

Thomas
cagney is offline   Reply With Quote
Old 05-02-2010, 11:02   #140
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Quote:
Originally Posted by cagney View Post
It starts with 0,0 as far as I know.

The simplest bsb viewer is probably "kapview"
Code:
#!/bin/sh
bsb2png $1 /tmp/new.png
eog /tmp/new.png
unlink /tmp/new.png
I use this as my default .kap viewer.

Thomas
Hi thomas. If the only purpose is to view the kap, maybe a conversion to tif should be faster than png. Try this one...

Ciao, Marco.

Code:
#!/bin/sh
name="Image-$RANDOM.tif"
bsb2tif $1 /tmp/$name
eog /tmp/$name
unlink /tmp/$name
GPS-Marco is offline   Reply With Quote
Old 05-02-2010, 11:39   #141
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
You are right Marco, the tif version is faster.
I did not bother to much with safe tmp file creation in this case, but alright then. This is probably the safest way to do it.
kapview v5(!)
Code:
#!/bin/sh
name=`mktemp`
bsb2tif $1 $name
eog $name
unlink $name
Thomas
cagney is offline   Reply With Quote
Old 05-02-2010, 14:08   #142
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
ok thanks.

I still encourage you to try "qgis file_1.kap" though.

e.g. in qgis you get the lat/lon coordinate in the status bar and can digitize routes over the top, etc. and it's a lot faster to load, zoom, and pan really large images.


Hamish


ps- if eog can read them, bsb2ppm might be a tiny bit faster than bsb2tif.
HamishB is offline   Reply With Quote
Old 08-02-2010, 19:33   #143
Sponsoring Vendor
 
brak's Avatar

Community Sponsor
Cruisers Forum Supporter

Join Date: Jan 2009
Location: East of West
Posts: 252
Quote:
Originally Posted by Don B. Cilly View Post
Edit on Polar Navy: yes you can delete all charts at once, by selecting them all with Shift and/or Ctrl, so it's turning out to be very useful indeed.

Edit 2: Ah, hadn't seen Marco's post.
In Linux it sees .KAPs but not .kaps. Very likely because Linux is case-sensitive and Windows is not.

If those guys had half the betatesters we've got...
(they probably wouldn't write "Lattitude" to start with :-) )

- D.

P.S. Marco, grazie, ci sto prendendo la mano, e' davvero veloce e mi viene assai utile.
That's what this forum is for. Thanks for noticing "Lattitude". It's amazing what you can miss when you look at the same thing long enough.

The .kap issue should be fixed in the next Linux release. The number of Linux users is almost an order of magnitude less than Mac and Windows, so issues that would have been reported elsewhere go unnoticed.
brak is offline   Reply With Quote
Old 08-02-2010, 23:16   #144
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
Hello,

I'd just like to report that I've got my r.out.kap_template program working now. It creates a .hdr and .tif file ready for libbsb's tif2bsb without all the hassle of converting image formats and georeferencing by hand. My original idea was to incorporate tif2bsb within a C program to do this, but then I saw that it was patented and I live in a country which observes such things. (US#5727090 expires in 5 years btw). So I will only make it easy to get to the edge of the river, but actually crossing it is up to you. It seems to work pretty well and I am glad to see a cross platform all-open method to make the BSB charts, even if it is strictly for educational purposes.

Right now I have only implemented the first half: converting an already georeferenced raster map (GeoTiff, satellite imagery, aerial photos, etc [pretty much anything covered by GDAL Raster Formats]). The next step is to have it talk to the GRASS GIS/QGIS georeferencing tools instead of SeaClear's one (which is nice enough, but not cross platform & open). I'll post it once I've finished testing it and written up some docs.

In doing this I've been thinking about the nature of the problem and pretty much convinced myself that OpenCPN could really benefit from direct support for reading GeoTiffs.

just to rewind back to the beginning of this thread for a minute,
Quote:
Olle:
In short what i said is I don't think geotiff is a good format for this purpose. It is a complex, requires reading of the entire file, and rather slow reading.
I have to respectfully but completely disagree. IMO it is a really great option with a lot of established code waiting to go, and it would solve many problems.
  • It's a pretty simple container, and libtiff takes care of the many variants.
  • It does not require reading the entire file, you can pre-determine rows from linearly interpolating the geographic bounding box, and/or by setting it to use tile mode (see GTiff -- GeoTIFF File Format). It is widely used by WMS and MapServers, with huge datasets. Splitting into 256x256 files may be useful for web browsing but for this sort of app sub-second response and bandwidth constraints aren't as important as they are in a web app- the boat can only travel so fast. Tiled mode should address any slow-reading, although I don't claim to be an expert in tiled-Tiff compression. The (eg but ECW and MrSid too) JPEG2000 wavelet compression raises interesting ideas about fast in/out zoom level as well.
  • Free form metadata can hold data units, vertical datum, multiple palettes, etc.
I don't claim it will always win a performance race, just that it is good enough and that IMO reinventing the wheel is a big diversion of resources which could be better applied elsewhere. All I ask is that you consult the world-experts on this stuff on the GDAL-dev mailing list before sinking too much time into the problem. --Take their word for it, not mine.



humble 2c,
Hamish
HamishB is offline   Reply With Quote
Old 09-02-2010, 01:04   #145
Registered User

Join Date: Sep 2009
Location: Rome
Posts: 320
Quote:
Originally Posted by brak View Post
That's what this forum is for. Thanks for noticing "Lattitude". It's amazing what you can miss when you look at the same thing long enough.

The .kap issue should be fixed in the next Linux release. The number of Linux users is almost an order of magnitude less than Mac and Windows, so issues that would have been reported elsewhere go unnoticed.
Hello. Polar View does not open charts crossing 180° longitude (at least the charts I did) and when scanning a directory it only finds charts which name is more or less *_?.kap while it misses all charts that has no "_"" in their names.

Anyway, a good piece of SW.

Ciao, Marco.
GPS-Marco is offline   Reply With Quote
Old 09-02-2010, 04:45   #146
Sponsoring Vendor
 
brak's Avatar

Community Sponsor
Cruisers Forum Supporter

Join Date: Jan 2009
Location: East of West
Posts: 252
Marco,

Thanks for the positive feedback!

The issue with BSB charts that cross dateline is on the radar. As a fully quilting product - we have a very specific view of the world, where all charts have to mesh together. Any chart that crosses dateline makes that view unhappy

There are solutions to this, but since there isn't a huge number of charts like that, the feature is on a "medium term" TODO list (i.e. Q3 this year assuming everything else goes as planned).

As far as .KAP import goes - I would guess that you tested .KAP files from NOAA data set, which worked and others which did not. This issue is fixed in current codebase, but I honestly can't remember if it made it to the previous release. It will work in the next one, I hope

Quote:
Originally Posted by GPS-Marco View Post
Hello. Polar View does not open charts crossing 180° longitude (at least the charts I did) and when scanning a directory it only finds charts which name is more or less *_?.kap while it misses all charts that has no "_"" in their names.

Anyway, a good piece of SW.

Ciao, Marco.
brak is offline   Reply With Quote
Old 09-02-2010, 13:28   #147
oem
Registered User

Join Date: Nov 2009
Location: Vejle, Denmark
Boat: Vindø 995 ds
Posts: 133
Quote:
Originally Posted by HamishB View Post
Hello,

(...) The next step is to have it talk to the GRASS GIS/QGIS georeferencing tools instead of SeaClear's one (which is nice enough, but not cross platform & open).

Hamish
I'm running Vista, and I have downloaded the default 'osgeo4w' programs, including gdal, qgis etc. I can run the programs, - but, - I'm sorry for the silly question: Where and how do I find the georeferencing tool?

Btw (which originally caused my question), - Mapcal seems to be fixed on using degrees, decimalminutes as units. Does anybody know if there is an option to change that in Mapcal? To degrees, minutes, seconds..

Quote:
Originally Posted by HamishB View Post
In doing this I've been thinking about the nature of the problem and pretty much convinced myself that OpenCPN could really benefit from direct support for reading GeoTiffs.
Hamish
At the moment I could use a conversion tool from GeoTiff to BSB/3, retaining the georeferences (for OpenCPN). Any help?

However S57 is the future format, and all raster formats will be obsolete some years ahead. The challenge (in Europe) is S63, - and the current price of S57-charts.
oem is offline   Reply With Quote
Old 09-02-2010, 18:12   #148
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
Quote:
Originally Posted by oem View Post
I'm running Vista, and I have downloaded the default 'osgeo4w' programs, including gdal, qgis etc. I can run the programs, - but, - I'm sorry for the silly question: Where and how do I find the georeferencing tool?
For QGIS you have to enable the Plugin.
Plugins -> Manage plugins -> tick Georeferencer. Then it's on the plugin menu.

For GRASS GIS on Windows, I'd recommend the nightly build, as the osgeo4w package is a bit out of date. There it is easier to find, just follow the File->Georeferencer.

QGIS is the easier to use of the two, GRASS is the more powerful.

Quote:
At the moment I could use a conversion tool from GeoTiff to BSB/3, retaining the georeferences (for OpenCPN). Any help?
ok I'll send you my script to do that later today. Note that AFAIK libbsb writes BSB/2.
It requires GRASS GIS 6.4, so be warned there is a learning curve involved (if you are already familiar with GeoTiffs you should be ok). Probably it could be written with just gdalinfo, but I wanted to be able to automatically crop and zoom, specify (or automatically calculate) scale, sounding units, datum, etc. and that is easier for me in GRASS.

Quote:
However S57 is the future format, and all raster formats will be obsolete some years ahead. The challenge (in Europe) is S63, - and the current price of S57-charts.
No, S-57's days are numbered. S-100 is the future and as I understand it the IHO has decreed that S-100/101 will be universally encrypted. So S-63 troubles are just the beginning. So unless everyone complains to their gov't hydrographic office, in 5 years ENC in free software will be out of business. It really doesn't help that the technical committee which decided this is chaired by CMap (a division of Boeing), which has a vested interest in keeping the barrier to entry high. And that working ships will be required to use ENC in the near future (and so forced sales of the closed and expensive software with dongles and activations which can not be repaired at sea and so a system that fails dangerously...). rant, rant, rant, hold on to your paper charts.


regards,
Hamish
HamishB is offline   Reply With Quote
Old 09-02-2010, 20:03   #149
Sponsoring Vendor
 
brak's Avatar

Community Sponsor
Cruisers Forum Supporter

Join Date: Jan 2009
Location: East of West
Posts: 252
I am sure something will supersede S-57 but 5 years sounds like way too short of a timeframe. I would venture a guess and say that unless a significantly better standard is developed, S-57 is with us for a while. Too many people invested too much time in it. It's kinda like IPv4 vs IPv6.

S-100 is pretty much entirely vaporware as of now, and it is also so overly complicated that it makes S-57 look elegant (no mean feat). It is also using the same old iso 8211 as a data storage - so it'll be a triple mess. While I would not underestimate the power of mandate, S-100 will be tough to get going and it will take many many years before it is widely used (if ever). As of now, most of the world isn't even covered by S-57 charts (including a number of European countries where they local hydrographic authority can't seem to get its act together).

That said, I think the OP meant "vector charts" in general, and perhaps "vector charts in an open standard" in particular. I would agree with that - IMHO raster charts should be rasterized on paper (j/k but there is some truth to that)

I don't think any sort of dongles are required currently for S63 encoding (we certainly do not) and, in general, the era of "dongles" in software is long over - so I wouldn't be too worried about it. Depending on the encryption scheme chosen open source software may or may not be able to participate (certainly if they choose something as weird as S63 - it won't), but it isn't the "end of the world".

The above is my personal opinion, so it ain't worth much - I am often wrong

Quote:
Originally Posted by HamishB View Post
No, S-57's days are numbered. S-100 is the future and as I understand it the IHO has decreed that S-100/101 will be universally encrypted. So S-63 troubles are just the beginning. So unless everyone complains to their gov't hydrographic office, in 5 years ENC in free software will be out of business. It really doesn't help that the technical committee which decided this is chaired by CMap (a division of Boeing), which has a vested interest in keeping the barrier to entry high. And that working ships will be required to use ENC in the near future (and so forced sales of the closed and expensive software with dongles and activations which can not be repaired at sea and so a system that fails dangerously...). rant, rant, rant, hold on to your paper charts.


regards,
Hamish
brak is offline   Reply With Quote
Old 10-02-2010, 00:51   #150
Registered User
 
idpnd's Avatar

Join Date: Sep 2007
Location: Almería, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,558
Quote:
Originally Posted by brak View Post
I don't think any sort of dongles are required currently for S63 encoding (we certainly do not) and, in general, the era of "dongles" in software is long over - so I wouldn't be too worried about it.
I'm afraid you are wrong, all post-CM93/2 products are dongled up to the 9s.. The only free vector charts in S63 come from the US govt

Quote:
Originally Posted by HamishB View Post
It really doesn't help that the technical committee which decided this is chaired by CMap (a division of Boeing), which has a vested interest in keeping the barrier to entry high. And that working ships will be required to use ENC in the near future (and so forced sales of the closed and expensive software with dongles and activations which can not be repaired at sea and so a system that fails dangerously...
I call that corruption, just to keep things nice and plain
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Marine GeoTiff - Open Chart Standard dacust OpenCPN 12 04-11-2009 17:43
Standard Horizon Plotter Scratch Our Community 3 05-01-2009 13:45
Standard Horizon JonasB Navigation 6 05-12-2008 11:40
Standard Horizon - CP 500 Parlay III Navigation 3 04-08-2008 07:20

Advertise Here


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


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.