[postgis-users] AsSvg bug fixes

strk at refractions.net strk at refractions.net
Mon Oct 25 07:15:07 PDT 2004


On Mon, Oct 25, 2004 at 03:46:45PM +0200, Olivier Courtin wrote:
> Hi,
> 
> Some little fixes for AsSvg function (from postgis cvs) :
> 
> 1) Y axe in SVG is reverse (i.e 0,0 point in upper left)
> 2) Relative path correction in print_svg_path_rel

Committed. Thanks.
--strk;

>  
> 
> 
> 
> --- lwgeom_svg.c	2004-10-15 13:48:48.000000000 +0200
> +++ patched_lwgeom_svg.c	2004-10-25 15:37:47.000000000 +0200
> @@ -192,7 +192,7 @@
>  
>  	sprintf(x, "%.*f", precision, pt->x);
>  	trim_trailing_zeros(x);
> -	sprintf(y, "%.*f", precision, pt->y);
> +	sprintf(y, "%.*f", precision, pt->y * -1);
>  	trim_trailing_zeros(y);
>  
>  	sprintf(temp, "x=\"%s\" y=\"%s\"", x, y);
> @@ -211,7 +211,7 @@
>  
>  	sprintf(x, "%.*f", precision, pt->x);
>  	trim_trailing_zeros(x);
> -	sprintf(y, "%.*f", precision, pt->y);
> +	sprintf(y, "%.*f", precision, pt->y * -1);
>  	trim_trailing_zeros(y);
>  
>  	sprintf(temp, "cx=\"%s\" cy=\"%s\"", x, y);
> @@ -238,7 +238,7 @@
>  		}
>  		sprintf(x, "%.*f", precision, pt->x);
>  		trim_trailing_zeros(x);
> -		sprintf(y, "%.*f", precision, pt->y);
> +		sprintf(y, "%.*f", precision, pt->y * -1);
>  		trim_trailing_zeros(y);
>  		result+= sprintf(result,"%s %s", x, y);
>  	}
> @@ -259,7 +259,7 @@
>  
>  	sprintf(x, "%.*f", precision, pt->x);
>  	trim_trailing_zeros(x);
> -	sprintf(y, "%.*f", precision, pt->y);
> +	sprintf(y, "%.*f", precision, pt->y * -1);
>  	trim_trailing_zeros(y);
>  
>  	result += sprintf(result,"%s %s l", x, y); 
> @@ -268,9 +268,9 @@
>  	for (u=1; u<pa->npoints; u++)
>  	{
>  		pt = (POINT2D *)getPoint(pa, u);
> -		sprintf(x, "%.*f", precision, pt->x);
> +		sprintf(x, "%.*f", precision, pt->x - lpt->x);
>  		trim_trailing_zeros(x);
> -		sprintf(y, "%.*f", precision, pt->y);
> +		sprintf(y, "%.*f", precision, (pt->y - lpt->y) * -1);
>  		trim_trailing_zeros(y);
>  		result+= sprintf(result," %s %s", x, y);
>  		lpt = pt;
> 
> 
> 
> HTH :)
> 
> --
> Ol
> _______________________________________________
> 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