Geospatial Functions
SVG functions
Generate SVG representations of geometric shapes and geospatial data.
ClickHouse function reference
Svg
Generates an SVG representation of geometric data.
Syntax:
Aliases:
- SVG
- svg
Arguments:
geometry
(Geo
): The geometric data to be converted to SVG.style
(String
, optional): A style string to be applied to the SVG element.
Returns:
A string containing the SVG representation of the geometry. (String
)
The function generates different SVG elements based on the input geometry type:
- Point: SVG circle
- Ring or Polygon: SVG polygon
- MultiPolygon: SVG path
Examples:
Generate an SVG circle for a point:
Result:
Generate an SVG polygon for a taco-shaped area:
Result:
Generate an SVG path for a taco with a bite taken out:
Result:
This function is useful for visualizing geometric data in SVG format, which can be embedded in web pages or used in data visualization tools.
Was this page helpful?