[postgis-tickets] [PostGIS] #2232: Accumulated error with relative coordinates in ST_AsSvg

PostGIS trac at osgeo.org
Fri Mar 15 06:38:11 PDT 2013


#2232: Accumulated error with relative coordinates in ST_AsSvg
---------------------+------------------------------------------------------
 Reporter:  nicklas  |       Owner:  nicklas 
     Type:  defect   |      Status:  assigned
 Priority:  medium   |   Milestone:          
Component:  postgis  |     Version:  2.0.x   
 Keywords:           |  
---------------------+------------------------------------------------------
Description changed by nicklas:

Old description:

> When using ST_ASSvg outputting relative rounded coordinates you might get
> accumulated rounding errors.
>
> I saw huge errors like that when testing twkb on polygons with thousands
> of vertex-points.
>
> Example:
>

>
> {{{
> select
> st_assvg('LINESTRING(0 0, 0.4 0, 0.8 0, 1.2 0,1.6 0, 2 0)'::geometry,1,0)
> }}}
>
> returns:
>
> {{{
> M 0 0 l 0 0 0 0 0 0 0 0 0 0
> }}}
>
> I fixed it in twkb-case in the spike with #11165, probably the same
> approach can be used here.
>
> Just not get the relative value as relative to the previous coordinate,
> but relative to the accumulates relative coordinates achieved.

New description:

 When using ST_ASSvg outputting relative rounded coordinates you might get
 accumulated rounding errors.

 I saw huge errors like that when testing twkb on polygons with thousands
 of vertex-points.

 Example:



 {{{
 select
 st_assvg('LINESTRING(0 0, 0.4 0, 0.8 0, 1.2 0,1.6 0, 2 0)'::geometry,1,0)
 }}}

 returns:

 {{{
 M 0 0 l 0 0 0 0 0 0 0 0 0 0
 }}}

 I fixed it in twkb-case in the spike with r11165, probably the same
 approach can be used here.

 Just not get the relative value as relative to the previous coordinate,
 but relative to the accumulates relative coordinates achieved.

--

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2232#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list