There are considerable changes in the 3.0 vector chart rendering. A detailed explanation follows below, and as an example of how the default style can be changed you can download files that give the charts a Swedish look (new colors, soundings and underwater rocks). Unzip and move the two files into the s57data folder of your installation and you get this:
If someone likes the look and feel of (French) SHOM charts
just edit the following symbols to the numeric rgb values below in
LANDA 255 224 183
NODTA 225 224 222
DEPDW 255 249 245
LANDF 255 200 125
CHBRN 226 192 156
OpenCPN Version 3.0 includes a new more modern and easier to work with format for chart symbology. Up to now all information regarding how to render chart symbols was stored in a file (S52RAZDS.RLE) whose format was not very user friendly.
The new way of doing things instead has an easily readable XML syntax for the configuration,and the actual bitmaps are loaded from PNG files. They can be edited in whatever modern image editor you fancy (which probably means Gimp or Photoshop). Which means that we can now use transparent bitmaps and anti-aliased graphics.
As an example, here is a blowup of the case of a port side buoy with a light and a sound in the old and new version:
To make life easier for symbol editors there is a multilayered TIF file available at http://journeyman.se/opencpn/rastersymbols.tif which has the following layers:
- Text: The symbol names. Just some support so that you can check the name of the symbol you are editing. Fairly ugly auto-generated layout, but better than nothing.
- Pivot: A single pixel showing where the symbol pivot point is located.
- Symbols: The actual symbol graphic layer. This layer only should be saved as the <graphics-file> for a specific color table.
- Background: Rectangles for the definition area of each symbol. The position should confirm to the <graphics-location> and <bitmap height="" width=""> in the XML file as explained below.
- Frames: 1 pixel solid black outline OUTSIDE of the symbol definition area.
- Canvas: Just a colored background you can toggle to see the symbol against a solid color.
There is also some vector originals used for the new symbols at http://journeyman.se/opencpn/symbol-vector-orig.svg
A short introduction to the new XML format:
There are five types of tags in the chartsymbols.xml file:
First color tables:
<color-table name=""> <graphics-file name="" /> <color name="" r="" g="" b=""/> .... </color-table>
Each color table also has a <graphics-file name="" />, which should be the name of a PNG file in the same folder as the XML file itself. This is the file that all bitmap symbols are loaded from. It should be a PNG24 type file with alpha channel.
The colors temselves are specified as integer RGB values in the 0-255 range.
The next type is Lookups. These specify how extra graphics such as text and secondary symbols are to be placed. Normally there should be no need to edit these tags, but if you feel the need, at least they are now much more readable than in the old format. No changes to the actual data has been made.
The <line-style> tags define how various complex lines are drawn (fairways, anchor areas etc). The actual vector specs are still in HPGL format (a vector plotting format from the 80's ). Unfortunately we don't have a good way of parsing SVG graphics yet, so they remain as they were.
The <pattern> tags specify how areas such as dredged areas, marshes and so on are drawn. Note that overall features such as land and depth countours do not have a pattern so they are NOT specified here. A example pattern tag looks like below. This particular pattern has both a vector and a bitmap definition. Per default the system will use a bitmap if both are present. Bitmaps are faster. If you want to use the vector as default instead, specify <prefer-bitmap>no</prefer-bitmap> as a sub-tag to the <pattern>.
<pattern RCID="3143"> <name>MARSHES1</name> <definition>V</definition> <filltype>S</filltype> <spacing>C</spacing> <bitmap width="40" height="40"> <distance min="1500" max="15000" /> <pivot x="30" y="30" /> <origin x="0" y="0" /> <graphics-location x="207" y="1007" /> </bitmap> <vector width="400" height="393"> <distance min="1500" max="15000" /> <pivot x="750" y="1016" /> <origin x="550" y="499" /> </vector> <description>pattern of symbols for a marsh</description> <color-ref>ACHBRN</color-ref> <HPGL>SPA;SW2;PU751,765;PD751,499;SPA;SW2;PU626,892;PD876,892;SPA;SW2;PU550,810;PD950,810;SPA;SW2;PU664,799;PD592,634;SPA;SW2;PU830,799;PD901,637;</HPGL> </pattern>
For the bitmap version you specify the size of the bitmap, which is then tiled across the pattern area when displayed.
The <graphics-location x="" y="" /> points to the location in the PNG file of the currently loaded <color-table>. Locations are counted from the upper left corner as (0,0) with y positive downwards as usual. So in the above example the pattern will consist of whatever is found in the PNG file area from (207,1007) to (207+40,1007+40) and then tiled.
The last tag is the <symbol>, which looks similar to the <pattern>. Symbols also can have both vector and bitmap definition, and again bitmapis the default. Be careful not to use bitmap for symbols which appear rotated, such as TSS direction arrows etc. These symbols must have <prefer-bitmap>no</prefer-bitmap>.
A typical symbol looks like this:
<symbol RCID="45"> <name>BOYSPH68</name> <description>spherical buoy,by,full-chart</description> <bitmap width="19" height="15"> <distance min="0" max="0" /> <pivot x="9" y="11" /> <origin x="0" y="0" /> <graphics-location x="661" y="742" /> </bitmap> <definition>R</definition> </symbol>