PlanetGIS User Guide/Using Styles
From PlanetWiki
Contents |
Using Styles
Introduction
Styles are used to define the visual appearance of a features. Feature classes may reference a default style and displays hold references to both a feature class and a style, which initially is the feature class' default style. You may say that a display is what glues together a feature class and an visual style for display in a particular view of a map.
A style is a named collection of drawing tools, or style elements. There are four types of style elements:
- Pen. Used for drawing line features and the outlines of area features.
- Fill. Used for filling area features.
- Symbol. Used for indicating point features.
- Font. Used for labelling point, line or area features.
| Tip: | The most common reason for labels not appearing is the absence of a font in the selected style. |
Selecting and editing styles
A display's style may be selected in the display properties window, shown in the The Display Manager section, but can also be selected directly by right-clicking on the display in the display manager and selecting Select style. You can also create a new style for the display at this point or edit an existing style before selecting it.The currently selected style's properties can be accessed directly through the Style properties menu item.
A style only has one property – its name – and a collection of style elements. You can edit, add or remove a style's elements in the Style properties window.You have to select a style element before you can edit or remove it and you can change the order of the elements by dragging an element and dropping it onto the element which is in the position that you want the first one to be. The elements are displayed in the order of left-to-right then top-to-bottom.
Styles can also be created, grouped, accessed and assigned in design mode, where you even have the ability to drag-and-drop elements between styles. (See Design Mode).
Common components of style elements
Units
When specifying the width, height or thickness of a style element, you can choose between one of the following units:
- mm (paper) – millimetres on output device: screen or print
- in (paper) – inches on output device: screen or print
- px (paper) – pixels on output device: screen (don't use when the map will be printed, a 2 pixel thick line is hardly visible on most printers)
- m (real) – meters in reality, but more generally: “the units of your coordinate system” because the m will be replaced by the abbreviation for the units you are using.
Visibility
Style elements, like displays, can be set to display only for certain ranges of scale. A style element can also be designated as only appropriate for printing and another as only appropriate for on-screen viewing. Please refer to the Visibility section in The Display Manager for a detailed discussion of the scale-conditional visibility.
Priority
(Implemented only for pens in the current version). Individual style elements may be assigned a priority number between -10 and 10. Elements with a priority of -10 will all be drawn first (in display order) and elements with a priority of +10 will all be drawn last. A zero priority (the default) causes element to be drawn in their natural order, as determined by the smart draw ordering setting.
This allows for a particular style element to be drawn together with elements of other styles that has the same priority and is useful for creating the “outlined” effect in street maps. The display list is traversed 11 times, starting with a priority number of -10 and only style elements with the same priority number is drawn at each pass. When the priority number reaches 0 all style elements without an assigned priority (i.e. 0) is drawn and then the “priority passes” continue from 1 through 10.
Shapes
Shapes, not to be confused with symbols, are the geometries used by a symbol as well as certain pens and fills. A central collection of shapes is maintained in each PlanetGIS project which starts with a default set of shapes to which you may add your own.
To create your own shapes, you need to start by creating a feature class with a type of either areas or lines. Lines can be used to create shapes with both solid surfaces and lines. All closed lines (start point is coincident with end point) will be turned into filled surfaces. Shapes may consist of multiple parts (just like normal line or area features) with holes, etc., but can combine lines and surfaces (unlike line or area features). Each shape feature must be labelled by the name you would like the shape to have.
The final step is to import your shape feature class into the shapes collection. This function is available in design mode at the Shapes node under Styles. (See Design Mode).
Hatches
Hatches, similar to shapes are maintained in a central collection for each project and may be manipulated at the Hatches node under Styles in design mode. (See Design Mode).
Hatches are described in a text format containing an unlimited number of directional lines, each with an origin coordinate followed by a series of alternating distances for dashes and spaces. The standard fills available in Planet are shown below.
Colours
PlanetGIS provides many ways to pick colours for style elements. The colour-picker button (The colour wheel, greyscale and colour ramps are useful for quick selection but you can also enter exact RGB (Red-Green-Blue) and HSV (Hue-Saturation-Value) values.
The HSV colour model is quite useful when you need to make small adjustments to a colour. The hue bar is used to select a “rainbow” colour and it represents the colours around the colour wheel at a particular radius. The hue value is between 0 and 360 and are the degrees of arc with red being at 0 degrees and progressing around a full circle of 360 degrees to reach red again. The hue of a colour corresponds to the wavelength of the perceived colour. If you want to change your blue to include a little more green you can reduce the hue value to obtain a more turquoise colour.The saturation bar corresponds to the distance to the centre of the colour wheel which is colourless at the centre and most colourful at the rim. Saturation is a measure of dominance of a hue in a colour. When no hue dominates, all colours are present in equal amounts to provide a “greyscale” which ranges from white to black. When a hue is totally dominant, no other wavelengths are present. If your blue is a bit to bright when printed on paper, you need to decrease the saturation to make it a bit more neutral, i.e. add little of all other wavelengths in equal amount.
The value bar corresponds to the total intensity of the colour. A value of 0 is darkness and a value of 255 is the maximum intensity with which a colour can be displayed by your screen or printed on your printer. If your blue is a bit dark and you want to make it a bit more “intense”, you need to increase the value.
Finally, you can also access the Windows System Color Picker by clicking on the Palette button. The usefulness of this feature is in that you can persistently store up to 16 “custom colors”. A slight annoyance with this is that if you have selected a colour with the colour wheel and sliders, you can only save it to the first position of the “custom colors”. Clicking on any of the other 15 positions replaces your colour with the one in that position, which is likely black. To populate positions 2-16 you have to use the colour square provided by Windows.
Pens
There are 4 types of pens, each with its own settings:
- Hairline: Used for screen display using a Windows line style (solid, dashed, dotted, dash-dot, etc). Hairline pens are usually not visible when printed.
- Solid: The simplest and quickest pen to render (apart from hairline).
- Pattern: A complex pen that uses polygons to create thick, patterned lines.
- Shapes: A pen that places shapes along a line.
Patterned pens
On the right is an example of a patterned pen. The pattern is a string of comma-separated and alternating positive and negative numbers indicating dashes (positive) or spaces (negative). The numbers are multiplication factors of the width of the pen, e.g. a pattern of “2, -3” would, for a 0.5mm thick line, create dashes 1mm in length and spaces 1.5mm in length. Leave empty or simply “1” for a line without gaps. The pattern dropdown list has a few example patterns, but you can enter your own.Shape pens
Below is an example of a shape pen. The following options provide a lot of control over what you can do with shape pens:
Start cap: Place a shape on the first coordinate of the line string.End cap: Place a shape on the last coordinate of the line string.
Vertices: Place a shape on each coordinate of the line string.
Rotated: Align the shape in the same direction as the line. The top of the symbol is pointed along the direction of the line.
Interpolated: Put shapes at intervals of the specified spacing value multiplied by line width. If vertices, start cap and end cap is not selected there will be a uniform distance between each shape, along the line string.
In the example shown, the shapes are only used for “end-caps” and are rotated to align with the direction of the line. (Start-caps are rotated by a further 180 to reverse their direction. A pen like this can be used along with a solid pen for features indicating measurements.
Fills
There are 4 types of fills, each with its own settings:
- Solid: The simplest and quickest fill to render.
- Transparent: Allows a specified percentage of underlying features to remain visible.
- Hatch: Fills an area with multiple directed and (optionally) patterned lines.
- Shape: Fills an area with evenly spaced shapes.
Transparent fills
Transparent fills are implemented in the same way transparency is simulated on printed media. On an electronic canvas (a bitmap) it is possible to create “perfect” pixel-by-pixel transparency because when applying a transparent fill, each fill pixel's value can be blended accurately with the pre-existing colour value. For printing purposes it is not practical to first process an entire map as an in-memory bitmap. (This would require huge amounts of memory and slow down printing considerably).
Transparency is simulated on a printer by picking an appropriate dither pattern that has a similar percentage of fill than the specified opacity for the fill. An opacity of 50%, for example, would produce a dither pattern where every second pixel is opaque while the remainder are transparent. When printed at high resolution, the printed result looks like it should to the human eye.Because Planet uses the same technique on the computer screen, which has a substantially lower resolution than a printer, the result may seem a bit “grainy” and quite different compared to the printed result. For best results, choose low opacity values and pick ones that yield a uniform dither pattern. Some opacity values that look better on screen are: 3, 6, 12, 18, 25 and 50%.
Hatch fills
Each hatch is designed with a default unit size but you can “tweak” your hatch fill to suit your needs better by altering the unit size.
Shape fills
The example shows a circle shape of 2 by 2mm selected for a fill. Horizontal spacing is a multiplication factor on the shape's width and vertical spacing on height.
The horizontal offset is used to (optionally) specify an offset for each subsequent row. In this example each subsequent row is advanced horizontally by half the distance between the centres of the shapes.
Symbols
Fonts
Ranges
| Previous: The Display Manager | Next: Working with Views |
