[GRASS-dev] patch for v.voronoi/v.delaunay

Maris Nartiss maris.gis at gmail.com
Sun Feb 3 08:50:24 EST 2008


Hi Benjamin,
I'm sorry to disappoint You - Your patch does not fix bogous output
from v.delaunay - there's still a garbage output from 46647 input
points. Look at this old bug how to reproduce problem on 32bit system
[1]. Your changes in calling myalloc have no effect, as previously
allocated memory was increased by 4000*sizeof(*sites) chunks and now
is assigned in one shot at beginning. It gives only slight memory saving.

I understand Your (and others) unwillingness to fix this code, still
shipping broken code is also not a good thing. It MUST be
fixed (patch/rewrite) or there must be some additional checks like
if(npoints>MAX_INT) G_error("Blah! Decrease input vector size") to avoid producing bogous results without any warnings.

Maris.

1. http://wald.intevation.org/tracker/index.php?func=detail&aid=335&group_id=21&atid=204

2008/2/1, Benjamin Ducke <benjamin.ducke at ufg.uni-kiel.de>:
> Hi all,
>
> As per request, I have patched v.delaunay (source in v.voronoi/)
> very carefully.
>
> The memory handling now seems to work better. At least I was able
> to triangulate a map with ca 30000 points. Anything more and my
> system starts thrashing badly (1 GB, with a lot of other apps running).
> Feel free to test with bigger inputs.
>
> The output vector map will now also preserve the 3D coordinates of
> the original input points. However, the centroids for the triangles
> are all wrong (placed at z=0.0). I don't see a quick way of fixing
> this right now.
>
> In fact, I'd prefer not to touch the current code for v.delaunay
> anymore. It is in urgent need of a complete overhaul as it is
> inefficient, hard to read and still full of site lib artefacts.
> Better to re-write from scratch with more time on my (or someone
> else's) hands.
>
> Best,
>
> Benjamin
>
> --
> Benjamin Ducke, M.A.
> Archäoinformatik
> (Archaeoinformation Science)
> Institut für Ur- und Frühgeschichte
> (Inst. of Prehistoric and Historic Archaeology)
> Christian-Albrechts-Universität zu Kiel
> Johanna-Mestorf-Straße 2-6
> D 24098 Kiel
> Germany
>
> Tel.: ++49 (0)431 880-3378 / -3379
> Fax : ++49 (0)431 880-7300
> www.uni-kiel.de/ufg
>
>



More information about the grass-dev mailing list