[postgis-devel] Visvalingam’s simplification and twkb with zoom-levels

Nicklas Avén nicklas.aven at jordogskog.no
Fri Jan 9 13:45:35 PST 2015




Sent from my Cat® phone.
Den 9 jan 2015 21:58 skrev Sandro Santilli <strk at keybit.net>:
>
> On Fri, Jan 09, 2015 at 09:02:52PM +0100, Nicklas Avén wrote: 
> > On Fri, 2015-01-09 at 20:17 +0100, Sandro Santilli wrote: 
>
> > > I'd expect it to be faster than D&P in the worst case 
> > > (tolerance so low that nothing gets removed). 
> > 
> > The speed is not affected of how many points that is removed. 
>
> I was talking about the worst case of DP simplification. 
> DP scans all points once to find farthest, finds it above threshold 
> and scans --points again to find next, until all are done... 
>

Ah, ok

> > If the eliminiation stops when the threashold is reached it will be faster. 
> > But then you don't get the information that tells in what order to 
> > eliminate the rest of the pionts. 
>
>
> The best case for DP is finding the farthest point is below tolerance, 
> which stops after the first scan of all points. 
> I'd expect worst case of Visvalingam to be ~= best case of DP. 
>

ok. it is possible that my code can be further optimized. the points is scanned for each elimination but just to find the one with smallest area. Only the adjacent needs recalculation. and for 2d that is very small operation. So it should be possible to mak it faster if DP calculates distances for each point for each elimination.

/Nicklas

> --strk; 
>
>   ()   Free GIS & Flash consultant/developer 
>   /\   http://strk.keybit.net/services.html 
>


More information about the postgis-devel mailing list