All Products
Search
Document Center

PolarDB:ST_AsSVG

Last Updated:Mar 28, 2026

Returns the Scalable Vector Graphics (SVG) path data for a geometry or geography object.

Syntax

text ST_AsSVG(geometry geom, integer rel, integer maxdecimaldigits);
text ST_AsSVG(geography geog, integer rel, integer maxdecimaldigits);

Parameters

ParameterDescription
geomThe geometry object to convert to SVG path data.
geogThe geography object to convert to SVG path data.
relSpecifies whether to use relative moves. Set to 1 to use relative moves, or 0 to use absolute moves. Default value: 0.
maxdecimaldigitsThe maximum number of decimal digits to retain in the output. Default value: 15.

Example

SELECT ST_AsSVG(ST_GeomFromText('POINT(116 40)',4326));
     st_assvg
-------------------
 cx="116" cy="-40"
(1 row)