[postgis-users] AsSVG() and BOX3D related code in lwgeom_svg.c

klaus Förster klaus.foerster at uibk.ac.at
Mon Jan 24 08:43:46 PST 2005


thanks strk,

following your proposal i've written a simple plpgsql function (well, 
actually three to provide overriding of arguments as well) to accomplish 
this task. it tries to follow the syntax of AsSVG() with rel and 
precision as optional arguments, takes a valid geometry as first 
argument and returns SVGRect notation with x="minX" y="minY" width="..." 
height="..." as default and SVGViewBox notation with "minX minY width 
height" if you specify rel=1. precision may be specified as optional 
third argument.

Usage: AsSvgBox(geometry,[rel],[precision])
Download: http://svg.cc/pg/assvg/ (bottom of page)

klaus

strk at refractions.net wrote:
> On Sun, Jan 23, 2005 at 04:46:08PM +0100, klaus Förster wrote:
> 
>>i've just tested AsSVG() with PostGIS 1.0.0 RC1 and PostgreSQL8.0 and 
>>noticed that all the BOX3D related code in lwgeom_svg.c that allowed to 
>>deliver SVG-viewBox notation for BOX3D queries has been removed. Is this 
>>due to the change to lwgeom as default geometry type? are there any 
>>plans to bring it back again? i've tried to provide a patch, but didn't 
>>succeed as the code has undergone a "Big layout change" as stated in the 
>>cvs-log.
> 
> 
> LWGEOM does not have a BOX-only subclass as it was with older representation.
> If BOX handling has any special feature you'll need to add a couple
> of overridden functions: AsSVG(box3d), AsSVG(box2d).
> As an alternative, you could provide an AsSVGbox(geometry) using the
> geometry's bounding box.

> 
> --strk;
> 
> 
>>thanks,
>>klaus
>>
>>-- 
>>         O-.
>>         /_ )
>>          | (U
>>klaus*   /|
>>        / /
>>        ~ ~
>>_______________________________________________
>>postgis-users mailing list
>>postgis-users at postgis.refractions.net
>>http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 

-- 
          O-.
          /_ )
           | (U
klaus*   /|
         / /
         ~ ~



More information about the postgis-users mailing list