SpatiaLite is an SQLite database engine with Spatial functions developed and maintained by Alessandro Furieri. As of version 2.3.1 AsSVG() is part of the standard distribution. It allows you to deliver absolute and relative SVG path-notation for lines, multilines, polygons and multipolygons as well as SVG cx,cy or x,y notation for point and multipoint features.
AsSVG() Spatialite function
Usage:SELECT AsSvg(geometry,[relative],[precision]) FROM <table>
geom
= geometry column of type MULTI(POINT|LINESTRING|POLYGON)relative
= optional argument to change output format, 0=absolute or 1=relative notationprecision
= optional argument to specify coordinate-precision
Note: svg has a y-down coordinate system so y-coords are multiplied by -1