SVG (Scalable Vector Graphics) Writer Parameters
Template File
This optional parameter directs the writer to the location of the SVG document to use as the outline of the output dataset.
A template file has several possible uses, including the insertion of predefined geometric elements, the inclusion of Cascading Style Sheets, and the embedding of scripting information.
Enter the path name for the SVG file whose contents will be embedded in the output dataset. The default file is defaultTemplate.svg under the svg folder in the FME home folder.
There are a few issues that must be considered to ensure proper template processing.
- The template must conform to the non-extended SVG language defined by the SVG 1.1 specification.
- The encoding of the template must be one of the following: ASCII, UTF-8, UTF-16, UCS4, ISO-8859-1 or Windows-1252. Note that the encoding of the output SVG document is always UTF-8.
- Any document type declaration provided in the template will be overridden in the output document.
Two placeholder macros have been defined for use in the SVG template in order to retrieve information specified in other directives:
- $(FME_SVG_ATTR_NS_PREFIX) will be replaced with the value of the Attributes Namespace Prefix parameter, and
- $(FME_SVG_ATTR_NS_URI) will be replaced with the value of the Attributes Namespace URI parameter.
These macros will only work inside CDATA sections (<![CDATA[...]]>) of the SVG template. If they are found outside a CDATA section, they will remain unchanged.
Coordinate Options
Specifies the number of decimal digits to use when writing an SVG element coordinate’s value.
The default is 6. Specifying a larger value increases coordinate precision and may increase rendering precision.
Normalizes the lower coordinate bounds of the writer’s feature set to (0,0). Normalization can reduce rendering inaccuracies by SVG viewers with small coordinate precision capability.
A normalized document’s file size is typically smaller than a non-normalized version.
If checked (default), the writer writes a transform attribute on the <svg> element to translate, and flips the y coordinate so that y positive becomes down, reflecting the SVG coordinate system where the top left corner is 0,0. If unchecked, the transform attribute on the <svg> element is not written.
Writer Parameters
Allows absolute instead of relative coordinates to be used for lines and polygons that are written out as <path> elements.
The default for this parameter is No.
Determines whether the SVG writer should automatically switch white fme_color specifications into black. This parameter does not affect the svg_color (that is, the svg_color attribute takes precedence over the fme_color).
The default for this parameter is Yes.
Determines whether the SVG files output are assigned the value of fill=“none” in the outer <g> container element.
-
Yes (default) – The output will include fill=“none”.
-
No – The output will not include fill=“none”.
Determines if the SVG file depends on an external SVG Document Type Definition (DTD).
When set to Yes the document type declaration’s public and system identifier for SVG 1.1 are used by default, but these default identifiers can also be overwritten with the DOCTYPE Public Identifier and DOCTYPE System Identifier parameters.
The default for this parameter is Yes.
This parameter applies only when the Reference External SVG DTD parameter is set to Yes. It specifies the public identifier for the document type declaration. This parameter must be used in conjunction with the DOCTYPE System Identifier parameter: a system identifier must also be simultaneously specified or this parameter has no effect.
This parameter only applies when the Reference External SVG DTD parameter is set to Yes.
It specifies the system identifier for the document type declaration. This keyword can be used alone or in conjunction with the DOCTYPE Public Identifier parameter.
Viewbox is an attribute used to create SVG shapes. This parameter allows you to set the viewbox size. Setting viewbox parameters eliminates extra white space.
By default, the viewbox is only available once you have defined all four parameters:
- minx: the beginning x coordinate
- miny: the beginning y coordinate
- width: width of the viewbox
- height: height of the viewbox
All values must be specified in decimal, integer or scientific notation.
This parameter specifies the prefix that will be used to identify the namespace of all user attributes in the SVG document.
Each user attribute written to the SVG file will be written as an XML attribute with the format namespace_prefix:user_attr = “value”.
The default namespace prefix is “fme”.
This parameter specifies the URI with that the namespace prefix (specified by ATTR_NAMESPACE_PREFIX) will be associated. This will be the namespace URI for all user attributes in the SVG document.
The namespace will be defined as follows, where namespace_prefix is the value defined by ATTR_NAMESPACE_PREFIX and namespace_uri is defined by xmlns:namespace_prefix=“namespace_uri”