[postgis-users] AsSVG() and precision control

strk at refractions.net strk at refractions.net
Fri Oct 15 01:49:18 PDT 2004


On Thu, Oct 14, 2004 at 12:26:44PM +0200, Klaus Foerster wrote:
> >Your patch does not do what reported:
> >Precision defaults to 15, so you need to give it an explicit negative
> >number for the %g to take effect. Default would be 0 padded numbers.
> sorry, forgot about that - http://svg.cc/pg/assvg/assvg-0.5.1.patch solves
> that issue by setting default precision to -1 and using %.15g or %.*f
> accordingly.

I don't like this either.
Maybe we should always use %f and *manually* remove trailing zeros.
What do you think ?
--strk;

> 
> >What I see is that the problem only arises for relative moves, where
> >number of significant digits wants to be different between absolute
> >and relative values.
> well, absolute notation might be affected as well. what about a coordinate
> pair like 241034.194490223,5610355.30134846 ? if you reduce output to seven
> digits you start mixing coordinate precision as x-coordinates originally 
> have 6,
> and y-coords 7 digits to the left - 241034.2 -5610355 would be the result.
> 
> >A proposal I can make is that:
> >
> >	- On "absolute" are requested all values will have 'precision'
> >	  number of significant digits
> >
> >	- On "relative" way initial (absolute) values will have 15
> >	  significant digits, and relative values will have 'precision'
> >	  number of significant digits.
> >
> >Do you think this would solve the problem ?
> i think absolute and relative notation should be treated the same way. 
> please give
> my latest patch a try - i do think it now does what i intended to 
> accomplish ;-)
> i've also updated http://svg.cc/pg/assvg/1_output.txt to reflect the change.
> 
> klaus
> 
> -- 
>          O-.
>          /_ )
>           | (U
> klaus*   /|
>         / /
>         ~ ~
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list