Name

ST_AsSVG — Returns a Geometry in SVG path data.

Synopsis

text ST_AsSVG(geometry g1);

text ST_AsSVG(geometry g1, integer rel);

text ST_AsSVG(geometry g1, integer rel, integer maxdecimaldigits);

Description

Return the geometry as Scalar Vector Graphics (SVG) path data. Use 1 as second argument to have the path data implemented in terms of relative moves, the default (or 0) uses absolute moves. Third argument may be used to reduce the maximum number of decimal digits used in output (defaults to 15). Point geometries will be rendered as cx/cy when 'rel' arg is 0, x/y when 'rel' is 1. Multipoint geometries are delimited by commas (","), GeometryCollection geometries are delimited by semicolons (";").

[Note]

Availability: 1.2.2. Availability: 1.4.0 Changed in PostGIS 1.4.0 to include L command in absolute path to conform to http://www.w3.org/TR/SVG/paths.html#PathDataBNF

Examples

SELECT ST_AsSVG(ST_GeomFromText('POLYGON((0 0,0 1,1 1,1 0,0 0))',4326));

		st_assvg
		--------
		M 0 0 L 0 -1 1 -1 1 0 Z