Feature symbolization

From Maria GDK Wiki
Revision as of 15:02, 6 September 2019 by Mbu (talk | contribs) ()
Jump to navigation Jump to search

Symbols.xml is divided in seven parts contained inside the root element <symbolizations>.

Overall structure of the symbols.xml file:

<symbolization>
  <config\>
  <constants\>
  <colors\>
  <points\>
  <lines\>
  <areas\>
  <labels\>
</symbolization>

Symbolization

<symbolization> is the root node of the symbols.xml.

Child element Description Properties
config Configuration settings used when building the map style. O C
constants Constant definitions. O C A
colors Color definitions. O C A
points Point symbol definitions. O C
lines Line symbol definitions. O C
areas Area symbol definitions. O C
labels Font characteristics and label rule definitions. O C

Config

Child element Description Properties
yaxisdirection Defines the direction of the yaxis for symbols/patterns. O A

Yaxisdirection

Attribute Description Properties
value up (origo in bottom left corner, y axis pointing up) or down (origon in top left corner, y axis pointing down). Default value is up.

Constants

Child element Description Properties
constant Constant value needed for symbolization. O R A

Constant

Attribute Description Properties
name String that identifies the constant.
value The value of the constant.

Example:

<constants>
  <constant name="contour_interval" value="20"/>
</constants>

Colors

The <colors>node contain the color table information. This color table is referenced from the point, line, area and label sections of the symbol.xml file.

Child element Description Properties
color Color value definition. O R A

Color

Attribute Description Properties
Name String that identifies the color.
Rgba value defining the red, green, blue and alpha values for the color.

Example:

<colors>
  <color name="black" rgba="0,0,0,255"/>
  <color name="black12" rgba="224,224,224,255"/>
  <color name="cyan" rgba="0,159,218,255"/>
  <color name="cyan4" rgba="242,252,252,255"/>
  <color name="white" rgba="255,255,255,255"/>
</colors>

Points

The <points> section of the feature symbolization file contains all point symbol definitions.

Child element Description Properties
Configuration settings for points symbols. O C
Point symbol definition. O R C

Config

Child element Description Properties
Scale factor applied to all pointsymbols and linepatterns used in symbolization. Local scale factors will be applied on top of this basescale value. O A
Default root path to location of symbol/pattern files used in symbolization. O A
Basescale
Attribute Description Properties
value Scale factor. Default value is 1.0.
Defaultroot
Attribute Description Properties
path Relative path to where the pointsymbol-files are located.

Point

The <point> blocks defines point symbols which are used either as a part of a complex line/area symbolization or as a single point map element. Point symbols can be rotated, offset and/or scaled.

Example:

<point>
  <sgname>Blue072_Obstruction</sgname>
  <origo type="centerx_y" y="0.25"/>
  <extent w="2.90" h="3.7"/>
  <scale value="0.7"/>
  <rotation offset="45.0"/>
</point>
Child element Description Properties
sgname The name of the symbol graphic. This name is used when referencing the point definition from the script files or from other parts of the symbols.xml file.
The defined origo of the symbol (in mm). A
The defined width and height of the symbol (in mm). Note: extent is only used when defining origo type "xy", "centerx_y" or "x_centery". X and y are then relative to the extent defined. Extent will not impact the size of the point symbol. A
Scale factor used for modifying the symbol graphic size. O A
Symbol rotation. O A
Origo
Attribute Description Properties
type How origo is defined. Valid values are: xy, center, centerx_y, x_centery.
x Origo x coordinate. Mandatory when value of type attribute is x_centery or xy.
y Origo y coordinate. Mandatory when value of type attribute is centerx_y or xy.
Extent
Attribute Description Properties
w Width of the symbol graphic (in mm).
h Height of the symbol graphic (in mm).
Scale
Attribute Description Properties
value Scale factor.
Rotation
Attribute Description Properties
offset Rotation offset value in degrees.

Lines

The <lines> section of the file contains all line element definitions.

Child element Description Properties
config Configuration settings for lines.
line Line element definition. R C

Config

Child element Description Properties
basescale Scale factor applied to all pointsymbols and linepatterns used in symbolization. Local scale factors will be applied on top of this basescale value. O A
defaultroot Default root path to location of symbol/pattern files used in symbolization. O A
Basescale
Attribute Description Properties
value Scale factor. Default value is 1.0.
Defaultroot
Attribute Description Properties
path Relative path to where the pointsymbol-, linepattern- and areapattern-files, are located.

Line

The <line> nodes defines lines which are used either as a part of a complex line/area symbolization, or as a single line element. Lines can be defined as one or more pens or as linepatterns. Point symbols can be attached to the line endpoints or centered.

Linepatterns and symbols must be available as .png-files.

Example (simple line):

<line>
  <sgname>Dk-Brown1815_0.4mmSolidLine</sgname>
  <pen style="solid" width="0.4" colorname="dkbrown1815"/>
</line>

Example (complex line):

<line>
  <sgname>LN_Dk-Brown1815_Cliff_High</sgname>
  <pen style="solid" width="0.2" colorname="dkbrown1815"/>
  <pen style="user" width="1.0" colorname="dkbrown1815" dashes="0.1,0.5" compoundarray="0.0,1.0"/>
</line>

Example (complex line with attached point symbols):

<line>
  <sgname>LN_Black_Bridge_DrawLift</sgname>
  <multiline spacing="1.3"/>
  <pen style="solid" width="0.3" colorname="black"/>
  <symbol name="Black_0.15mm-0.75mmLenWingTick" placement="start" rotoffset="0" yoffs="-0.65"/>
  <symbol name="Black_0.15mm-0.75mmLenWingTick" placement="start" rotoffset="90" yoffs="0.65"/>
  <symbol name="Black_0.15mm-0.75mmLenWingTick" placement="end" rotoffset="0" yoffs="-0.65"/>
  <symbol name="Black_0.15mm-0.75mmLenWingTick" placement="end" rotoffset="90" yoffs="0.65"/>
  <symbol name="Black_1.3mmCircleOpen" placement="mid"/>
</line>

Example (complex line using linepatterns):

<line>
  <multiline spacing="6.0"/>
  <sgname>LN_Dk-Brown1815_Cut_LargeGap</sgname>
  <linepattern name="Dk-Brown1815_Cut" type="png">
    <scale value="1.0"/>
    <ctrlpts start="0.0,0.5" end="1.0,0.5"/>
  </linepattern>
</line>
Child element Description Properties
sgname The name of the symbol graphic. This name is used when referencing the point definition from the script files or from other parts of the symbols.xml file. \
pen Defines a pen style for drawing. O R A
multiline Defines a multiline (two parallell lines drawn). Only valid in combination with <pen>. O A
symbol Defines a symbol to be drawn on the start- end- or center-point of a line. Only valid in combination with <pen>. O A
linepattern Defines a patternfile to use when symbolizing. O C A
Pen
Attribute Description Properties
style Valid values are “solid” and “user”. The “user” style is useful when defining lines custom dash/dot spacing.
width Pen width. O
colorname Pen color (defined in color table). O
dashes Comma separated list of dash/space values used when creating custom dash/dot lines. Mandatory when style is set to user. O
compoundarray Comma separated list of values to specify a compound pen. Can f.ex. be used in combination with the dashes attribute to draw a line with ticks on just one side. Values are in percent of the pen width. O
Multiline
Attribute Description Properties
spacing Spacing (in mm) between the parallell lines in a multiline. O
Symbol
Attribute Description Properties
name Name of the symbol graphic to be used in combination with the pen style. Should correspond to an existing sgname already defined in a <point> node. O
placement Placement of the symbol on the line. Valid values are start, end and center. O
rotoffset Rotation offset. O
xoffs Offset in the X direction. O
yoffs Offset in the Y direction. O
Linepattern
Attribute Description Properties
name Linepattern filename (only basename, no extension). Should be located at the path pointed to by the <defaultroot> node in the config section of the file.
type File extension
Child element Description Properties
scale Scale factor used for modifying the filepattern size. O A
ctrlpts Control points used to place the corners of the linepattern correctly. O A
Scale
Attribute Description Properties
value Scale factor. O
Ctrlpts
Attribute Description Properties
start X and Y coordinates specifying the start point of the linepattern. O
end X and Y coordinates specifying the end point of the linepattern. O

Areas

[[./core_vector_symbolization_areas.html|Details Area Symbolization]]

Labels

[[./core_vector_symbolization_labels.html|Details Label Symbolization]]