[postgis-devel] AsSVG patch

Marco Hugentobler marco.hugentobler at karto.baug.ethz.ch
Thu Feb 7 23:29:59 PST 2008


Dear postgis developers,

Find attached a patch that improves the svg output:

* Support of GeometryCollection geometries
* proper closing of the SVG path geometries using the SVG "z|Z" command (in 
case of POLYGON|MULTIPOLYGON elements)
* introduction of additional white-spaces in some cases for easier parsing
* removal of unnecessary minus signs infront of "0" coordinates

The patch has been tested by the SVG experts Andreas Neumann,  Klaus Förster 
and Bruce Rindahl. It would be great if the patch could be integrated into 
postgis svn. Please review the code carefully, as I'm a newbie in postgis 
server programming.

The documentation of ST_AsSVG could be changed the following way:

ST_AsSVG(geometry, [rel], [precision])

Return the geometry as an 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 (";").


Best regards,
Marco

-- 
Dr. Marco Hugentobler
Institute of Cartography
ETH Zurich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postgis_svg.diff
Type: text/x-diff
Size: 6201 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20080208/b5c2daa6/attachment.diff>


More information about the postgis-devel mailing list