Closed GoogleCodeExporter closed 9 years ago
I've implemented a workaround (lock in the private method void
SimplifySection(int i, int j, int depth) of class
NetTopologySuite.Simplify.TaggedLineStringSimplifier).
See the code below (the modified source is attached) :
public static string VERROU = "VERROU_TEST";
. . .
lock (VERROU)
{
if (HasBadIntersection(_line, sectionIndex, candidateSeg))
{
isValidToFlatten = false;
}
}
Original comment by nicolas....@gmail.com
on 29 Nov 2011 at 4:00
Attachments:
I think that the problem is the static readonly "li" object at the start of
TaggedLineStringSimplifier: if you delete this item and use a brand new "li"
inside "HasInteriorIntersection" all works well.
Original comment by diegogu...@gmail.com
on 29 Nov 2011 at 4:15
fixed with r783.
using your tests, all files now are 6k sized.
please take a look and see if now it's all ok also for you.
Original comment by diegogu...@gmail.com
on 29 Nov 2011 at 4:26
Inside NTS code, we are A LOT of "static readonly" objects that should be
removed... maybe we can open a separate issue for this.
P.S: thanks for reporting this isse.
Original comment by diegogu...@gmail.com
on 29 Nov 2011 at 4:28
+1 for replacing static readonly objects.
I suspected it was the line intersector, you beat me to it :)
Original comment by felix.ob...@netcologne.de
on 29 Nov 2011 at 6:21
actually JTS too can have the same problem:
http://jts-topo-suite.svn.sourceforge.net/viewvc/jts-topo-suite/trunk/jts/java/s
rc/com/vividsolutions/jts/simplify/TaggedLineStringSimplifier.java?revision=482&
view=markup
maybe I can suggest the fix also to the JTS team...
Original comment by diegogu...@gmail.com
on 30 Nov 2011 at 8:34
fixed also FastSegmentSetIntersectionFinder and others.
all tests are green, hope no slower performances.
Original comment by diegogu...@gmail.com
on 30 Nov 2011 at 9:29
One question, why didn't you just remove the "static" keyword from the initial
declaration of the li object? I don't know how "expensive" it is to create a
LineIntersector class (doesn't look too heavy) but I think it should have been
sufficient...
Original comment by felix.ob...@netcologne.de
on 30 Nov 2011 at 9:52
>why didn't you just remove the "static" keyword
Actually I don't thinked to this solution.
I suppose that should be enough, I try immediately and fix if works.
Original comment by diegogu...@gmail.com
on 30 Nov 2011 at 9:56
Done with r786
Original comment by diegogu...@gmail.com
on 30 Nov 2011 at 10:07
Original issue reported on code.google.com by
nicolas....@gmail.com
on 29 Nov 2011 at 3:32Attachments: