I'm currently trying to draw charts with the help of SQL Anywhere's spatial data support and its SVG output methods. To combine several geometries into one document, I have to use the ST_AsSVG() method with the 'PathDataOnly=Yes' format specifier.
Now, when using ST_MultiPoint to draw sets of points, the according ST_AsSVG() method seems to deliver data for a SVG path element. While this works generally, when using a larger scale, the points are not visible as they are rendered by drawing a very narrow square (of 0.002 coordinates length).
So typically the method returns data like:
Obviously, the point coordinates are much larger (in my case, between 200 and 10,000) than the square dimensions.
When I manually modify the SVG data to use a larger square to draw, say by replacing "l 0.002,0 0,0.002 -0.002,0 Z" with "l 2,0 0,2 -2,0 Z", the points are drawn correctly.
Question: Is there a way (e.g. a format specifier) to adapt the square width for the ST_MultiPoint::ST_AsSVG() method?
For the moment, I have chosen to use single points instead of multipoints though this enlarged the SVG file significantly.
(For the record: Jason's blog article "SQL Graph Paper" was a great starting point - thanks!)
asked 21 Jun '11, 05:25
When using just path data there is no way to represent a point, thus the small square.
The simplest way to combine several geometries into one SVG document is to use:
select ST_Geometry::ST_ASSVGAggr( geometry_column ) from geometry_table;
If you must use
answered 21 Jun '11, 09:14