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 Rating: Thread Rating: 4 votes, 2.00 average. Display Modes
Old 22-04-2011, 23:07   #1096
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
Re: Charts

take care with NZ14912_1 and NZ232_2; in v27 of the NZ charts they only have palette entries 1-6, but anp.c blindly writes out 8 rules anyway, probably in the wrong place. If these charts are not fixed in the latest release let me know and I'll improve the program to deal with that.

Code:
find charts without color rule RGB/7:
$ grep -aLc '^RGB/7,[0-9]\+,[0-9]\+,[0-9]\+' *.kap
Hamish
HamishB is offline   Reply With Quote
Old 23-04-2011, 00:52   #1097
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Charts

HamishB
Quote:
(eg if '\nRGB/' randomly appears in the binary part of the map; should probably set a 'already_did_it' variable to avoid the rules being written beyond the header)
Some months ago I patched tif2bsb to include more palettes, discussed in an earlier thread. A ruby script takes care of batch conversion. I use this snippet, to avoid writing in the binary part of a kap file.
Code:
    if line =~/\0/
      break
    end
This works, and should be possible to use in C.

Thomas
cagney is offline   Reply With Quote
Old 23-04-2011, 01:10   #1098
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
Re: Charts

Quote:
Originally Posted by cagney View Post
Some months ago I patched tif2bsb to include more palettes, discussed in an earlier thread.
yeah, I just noticed that a few minutes ago. didn't see the script, just the description that it existed.

Quote:
A ruby script takes care of batch conversion. I use this snippet, to avoid writing in the binary part of a kap file.
Code:
    if line =~/\0/
      break
    end
This works, and should be possible to use in C.
i.e. if line does not contain a NULL or EOF?

anyway in the C code I'm reading/writing raw binary byte by byte, and it's not really a problem to add some `if(already_did_it) continue;` code.

do you think it's worth adding a night-red-mode palette even though OpenCPN doesn't use it? (see suggestion for NZ night-red palette from a few days ago)

I wonder... if other chart source colors are similar, perhaps imgkap could search for white-like and light-blue-like, etc color rules in the RGB palette and automatically define a dusk/night palette based on that? That way the palette matching wouldn't have to be source-specific.


Hamish
HamishB is offline   Reply With Quote
Old 23-04-2011, 01:33   #1099
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Charts

HamishB

That is a regular expression checking if the line contains a NULL.

I think that the conclusion last time this was discussed, was that it is not enough with a dsk and ngt palette in the chart etc. So many other things on the screen can destroy your night vision, for example, I'm just looking at the tidal dialog and most of it is not dimmed with the "Change Color Scheme" button. Not to talk about other useful programs that you need to refer to on a night watch. A general dimming of the whole screen is called for. Dave introduced this in the present beta series by hitting F6 (for Windows). For Linux I think that using "xcalib" is quite good as it takes care of all programs. More about this in the wiki..

Thomas
cagney is offline   Reply With Quote
Old 23-04-2011, 04:58   #1100
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
Re: Charts

Quote:
Originally Posted by cagney View Post
That is a regular expression checking if the line contains a NULL.
gotcha. I spend much of my time in matlab where != is ~=. Must think more SQLike.

Quote:
I think that the conclusion last time this was discussed, was that it is not enough with a dsk and ngt palette in the chart etc. So many other things on the screen can destroy your night vision, for example, I'm just looking at the tidal dialog and most of it is not dimmed with the "Change Color Scheme" button. Not to talk about other useful programs that you need to refer to on a night watch.
we bop these things on the head one by one, and before you know it it's all good.
tide-level: I'm looking at it now in a latest git build -- it's got a good full xray darkeness thing going on... works for me, especially in the new full screen mode. (linux/debian sq/xfce)

it may not be enough just to have DSK and NGT, but it's a very good start!

Quote:
A general dimming of the whole screen is called for. Dave introduced this in the present beta series by hitting F6 (for Windows). For Linux I think that using "xcalib" is quite good as it takes care of all programs. More about this in the wiki..
xcalib is excellent, glad to have found the tip on the wiki. My biggest complaint when running in WinXP was the brightness of the window decorations, and full screen mode will take care of that. Setting the brightness and contrast on the monitor to 0% wasn't nearly enough.

On the Mac powerbook I think it's really easy, just apple-F1/F2 or something (don't quite remember, ask a mac-head). [invert bright day mode with Ctrl-Opt-Cmd-8?]

survey says:
Really dim down an external display - Mac OS X Hints

hmmm, this one says to check out `dim` or `pmset` from the command line on OSX:
10.3: Understanding PowerBook screen dimming timing - Mac OS X Hints


best,
Hamish
HamishB is offline   Reply With Quote
Old 23-04-2011, 06:56   #1101
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 65
Re: Charts

I make un new version to convert kap with NGT...

See http://www.cruisersforum.com/forums/...tml#post672541

Regards
MdJ is offline   Reply With Quote
Old 23-04-2011, 07:53   #1102
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
Re: GeoTiff -> BSB via GDAL

Quote:
Originally Posted by cagney View Post
I don't know more about gdal than you. I think that Hamish might be the man to ask.
But.....a geotiff is just a tiff with a text file. If it's just a question of a few charts just write the kap text header by hand (also called template) and use tif2bsb.
A simple script should also do, if geotiff text files are written to a standard? Compare with my script to convert ozi .map files + picture to a .kap chart. The only geotiffs I have access to are the Aussie test tiffs where one text file covers 3 charts.
Hi, sorry, just noticed this.
the `gdalinfo` program will show you the georef info.
gdal only reads bsb, it doesn't write due to patent issues in some countries.

It takes an intermediary step via GRASS to prepare a nice header, but see
https://trac.osgeo.org/grass/browser...t.kap_template

that gets you back to the geotiff, but with a properly georeferenced header template. making a bsb file from there is up to you.

n.b. gdal authors are also the same folks who look after libtiff and libgeotiff, so standards support for those is pretty good :-)


Hamish
HamishB is offline   Reply With Quote
Old 23-04-2011, 08:15   #1103
Obsfucator, Second Class
 
dacust's Avatar

Join Date: Feb 2008
Location: Southeast USA.
Boat: 1982 Sea Ray SRV360
Posts: 1,745
Re: Charts

Quote:
Originally Posted by cagney View Post
....a geotiff is just a tiff with a text file...
Not that it matters for this discussion, but just for information:

A tif is an image with embedded text tags "Tagged Image Format". The text part looks a lot like XML. As part of the standard, tif allows you to define your own tags.

A geo-tif just uses user-defined tags inside the tif image to store geo information. So, a geo-tif is a complete proper tif. It just has tags in it that would be ignored by a normal tif program. It MAY come with a text file, but this is usually just a world-type file with redundant information.

tif2bsb expects just a plain tif, so it ignores these user defined tags. The only way to convert it would be to pull out the user defined tags and reformat them into the header text format. OR modify tif2bsb to read it directly.

FYI: a .kap is similar to a tif in that it has embedded text as well. Just that the text is in a different format, and the image is in a tiled format for better performance when needing to only display a portion of the image.

-dan
dacust is offline   Reply With Quote
Old 23-04-2011, 14:23   #1104
Registered User
 
HamishB's Avatar

Join Date: Jan 2010
Location: New Zealand
Posts: 286
Re: Charts

Quote:
Originally Posted by GPS-Marco View Post
Your script looks very nice but it would be great if you could write a C post-processing tool making the same (a C tool that I can compile for my poor windows O.S...).

The tool should accept as input one chart name and should convert the palette from RGB only to RGB, DAY,... I'd use it for the NZ main distribution once the best palette is agreed.

attached is an updated version which checks for presence of palette entries >6 and avoids random matches within the binary data for your consideration.

Hamish
Attached Files
File Type: doc apply_night_palette.c.doc (9.9 KB, 66 views)
HamishB is offline   Reply With Quote
Old 26-04-2011, 03:32   #1105
Registered User

Join Date: Jul 2010
Location: Marlborough, NZ
Boat: Farr 1104
Posts: 13
Re: Charts

Still trying to understand kap charts. For example could anyone get the new Zealand charts to load in the Raymarine program and if not why?. They will load in Kiwitech, its precursor, once the polynomial bits were added. They load in Capcode. Imgkap ones don't load in Raymarine either.
Thanks.
Rapport is offline   Reply With Quote
Old 26-04-2011, 04:33   #1106
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: Charts

Every .kap conversion I've made through MapCalII is working for me in Fugawi Marine ENC,SeaClear and OpenCPN. That is also the case with conversions made through GE2KAP and Chartconvert.

Some of the commercial companies have added protective barriers in the charts which will only run on their own platforms.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 26-04-2011, 09:17   #1107
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Charts

Quote:
Originally Posted by Rapport View Post
Still trying to understand kap charts. For example could anyone get the new Zealand charts to load in the Raymarine program and if not why?. They will load in Kiwitech, its precursor, once the polynomial bits were added. They load in Capcode. Imgkap ones don't load in Raymarine either.
Thanks.
sinbad has it right,I think.For instance,my old VisNav app loads some homemade kaps but not others...What is it looking for?

I don't have a chartplotter so I'm just jabbering-shotgun help-but...

it's obvious you've compared the charts that work in your Raymarine with charts that don't?(Or,Do BSB or something else as files accompany the ones that do?-but that'd be too easy...)
Otherwise...easiest is in the header as a text.Imgkap(see the thread ) can extract these and it's really easy to try various changes to the header in notepad and rebuild.There are other apps here that can do this...That said,some of these apps add their own line of credits,so the chart is seldom an exact edit.

It might be something like the COLOUR PALETTE.Looking into the extracted image might be your best lead.Perhaps the ones you are "making" just cannot be displayed on the Raymarine.
So,there's also just looking at the compared kap charts in a hex editor and seeing if there's a clue there?If you want to get heavy,do any editing on copies( it goes without saying!)I am using a freeware editor called "HxD" that saves a backup of edits as well.You will need to change readonly property to edit copies of them...If you figure it out please post back!
HappySeagull is offline   Reply With Quote
Old 26-04-2011, 09:42   #1108
MdJ
Registered User

Join Date: Jul 2010
Location: France
Boat: Etap 22i
Posts: 65
Re: Charts

Quote:
Originally Posted by HappySeagull View Post
sinbad has it right,I think.For instance,my old VisNav app loads some homemade kaps but not others...What is it looking for?
If raymarine or visnav work with standard kap provided by NOAA or else, then there is no reason that this does not work with libbsb or imgkap.

The problems may come from various places, image encoding or the header.

If it's in the header, this may be version or missing parameter ...

(I'm interested to know the reasons to correct imgkap.)

M'dJ
MdJ is offline   Reply With Quote
Old 26-04-2011, 10:00   #1109
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Charts

Quote:
Originally Posted by Rapport View Post
Still trying to understand kap charts. For example could anyone get the new Zealand charts to load in the Raymarine program and if not why?. They will load in Kiwitech, its precursor, once the polynomial bits were added. They load in Capcode. Imgkap ones don't load in Raymarine either.
Thanks.
Which Raymarine model are you talking about? Does the documentation say that BSB2 and BSB3 are supported, or is it only BSB4?

Thomas
cagney is offline   Reply With Quote
Old 26-04-2011, 11:58   #1110
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Charts

Quote:
Originally Posted by MdJ View Post
If raymarine or visnav work with standard kap provided by NOAA or else, then there is no reason that this does not work with libbsb or imgkap.

The problems may come from various places, image encoding or the header.

If it's in the header, this may be version or missing parameter ...

(I'm interested to know the reasons to correct imgkap.)

M'dJ
Md'J, imgkap charts work well for me in my old Visnav.... I only test these in VisNav as a curiousity. Some charts I made differently do not work in VisNav,and it's a mystery why imgkaps do,some others don't.
HappySeagull is offline   Reply With Quote
Reply

Tags
charts, kml, raster2bsb, tiff2bsb, bsb


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
Charts on CD stxboy Navigation 43 28-01-2014 10:40
Charts for BC Charlie Navigation 11 19-04-2007 03:39
Used Charts daven Navigation 2 28-11-2006 16:47
Looking at charts - where to go to next Rippy Other 19 10-03-2006 04:27

Advertise Here


All times are GMT -7. The time now is 04:26.


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.