I've been getting some slow responses from STIntersection() using NTS,
and have tried performing the same intersection with Postgis and
Microsoft.SqlServer.Types.dll to see how they compare. The differences
are remarkable:
I'm using version 1.7.3 on an XP VM. (I also tried running the NTS
intersection test using mono on a mac with similar results). I've
tried to add the WKT strings for the two shapes to this message, but
the post was rejected, probably because one of the strings was too
large - will see if I can attach.
On Sun, Apr 24, 2011 at 1:15 PM, FredL <fred.leef...@gmail.com> wrote: > WKT strings attached.
> -- > You received this message because you are subscribed to the Google Groups > "NetTopologySuite" group. > To post to this group, send email to nettopologysuite@googlegroups.com. > To unsubscribe from this group, send email to > nettopologysuite+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/nettopologysuite?hl=en.
> I twy to take a look as fast as I can, checkin how fast is also JTS
> suite doing same task
> Diego Guidi
> On Sun, Apr 24, 2011 at 1:15 PM, FredL <fred.leef...@gmail.com> wrote:
> > WKT strings attached.
> > --
> > You received this message because you are subscribed to the Google Groups
> > "NetTopologySuite" group.
> > To post to this group, send email to nettopologysuite@googlegroups.com.
> > To unsubscribe from this group, send email to
> > nettopologysuite+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/nettopologysuite?hl=en.
> -----Ursprüngliche Nachricht----- > Von: nettopologysuite@googlegroups.com > [mailto:nettopologysuite@googlegroups.com] Im Auftrag von FredL > Gesendet: Dienstag, 26. April 2011 15:14 > An: NetTopologySuite > Betreff: Re: R: Re: STIntersection performance
> thanks again. Let me know if I can help at this end...
> On Apr 26, 12:05 pm, Diego Guidi <diegogu...@gmail.com> wrote: > > the same test runs in about ten seconds in JTS 1.8... now it's time to > > find how NTS loses all the time
> -- > You received this message because you are subscribed to the Google Groups > "NetTopologySuite" group. > To post to this group, send email to nettopologysuite@googlegroups.com. > To unsubscribe from this group, send email to > nettopologysuite+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/nettopologysuite?hl=en.
> > thanks again. Let me know if I can help at this end...
> > On Apr 26, 12:05 pm, Diego Guidi <diegogu...@gmail.com> wrote:
> > > the same test runs in about ten seconds in JTS 1.8... now it's time to
> > > find how NTS loses all the time
> > --
> > You received this message because you are subscribed to the Google Groups
> > "NetTopologySuite" group.
> > To post to this group, send email to nettopologysuite@googlegroups.com.
> > To unsubscribe from this group, send email to
> > nettopologysuite+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/nettopologysuite?hl=en.
> The same test takes about 1.111ms using NTS v2.11, so I think it is related to changes in the algorithm.
I didn't checked nothing at all, but I suspect that can be related to collections used by NTS, i.e. Set/HashSet, PowerCollections, and so on... anything related to this one? http://code.google.com/p/nettopologysuite/issues/detail?id=43&can=1 this issue is fixed, at least in 2.11
OverlayOp.CopyPoints for the multipolygon geometry is executed in a fraction of a second by JTS, and in 10 seconds or more by NTS (trunk) I think that here is the main problem, now the hard part: discover why this happens :)
Hi Diego, perhaps try with r538 or earlier to make sure I didn't break anything aliasing ArrayList = List<Object> etc when doing the Silverlight stuff...
From: nettopologysuite@googlegroups.com [mailto:nettopologysuite@googlegroups.com] On Behalf Of Diego Guidi Sent: 26 April 2011 16:27 To: nettopologysuite@googlegroups.com Subject: Re: R: Re: STIntersection performance
OverlayOp.CopyPoints for the multipolygon geometry is executed in a fraction of a second by JTS, and in 10 seconds or more by NTS (trunk) I think that here is the main problem, now the hard part: discover why this happens :)
-- You received this message because you are subscribed to the Google Groups "NetTopologySuite" group. To post to this group, send email to nettopologysuite@googlegroups.com. To unsubscribe from this group, send email to nettopologysuite+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/nettopologysuite?hl=en.
Thinking about it the alias only applies within Silverlight - in .Net it stays as ArrayList...
From: nettopologysuite@googlegroups.com [mailto:nettopologysuite@googlegroups.com] On Behalf Of John Diss Sent: 26 April 2011 16:32 To: nettopologysuite@googlegroups.com Subject: RE: R: Re: STIntersection performance
Hi Diego, perhaps try with r538 or earlier to make sure I didn't break anything aliasing ArrayList = List<Object> etc when doing the Silverlight stuff...
From: nettopologysuite@googlegroups.com [mailto:nettopologysuite@googlegroups.com] On Behalf Of Diego Guidi Sent: 26 April 2011 16:27 To: nettopologysuite@googlegroups.com Subject: Re: R: Re: STIntersection performance
OverlayOp.CopyPoints for the multipolygon geometry is executed in a fraction of a second by JTS, and in 10 seconds or more by NTS (trunk) I think that here is the main problem, now the hard part: discover why this happens :)
-- You received this message because you are subscribed to the Google Groups "NetTopologySuite" group. To post to this group, send email to nettopologysuite@googlegroups.com. To unsubscribe from this group, send email to nettopologysuite+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/nettopologysuite?hl=en. -- You received this message because you are subscribed to the Google Groups "NetTopologySuite" group. To post to this group, send email to nettopologysuite@googlegroups.com. To unsubscribe from this group, send email to nettopologysuite+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/nettopologysuite?hl=en.
If I disable NodingValidator (OverlayOp.NodingValidatorDisabled = true;) the operation is executed immediately. Of course this is not a good thing to do, and JTS validates noding, so I think that is the nodingvalidator that actually is slow.
Il giorno , Diego Guidi <diegogu...@gmail.com> ha scritto:
> sorry, I'm wrong. Maybe a temporary result due to some problem in my > pc... I check better and see > -- > You received this message because you are subscribed to the Google > Groups "NetTopologySuite" group. > To post to this group, send email to nettopologysuite@googlegroups.com. > To unsubscribe from this group, send email to > nettopologysuite+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/nettopologysuite?hl=en.
-----Original Message----- From: nettopologysuite@googlegroups.com [mailto:nettopologysuite@googlegroups.com] On Behalf Of Diego Guidi Sent: 26 April 2011 16:42 To: nettopologysuite@googlegroups.com Subject: Re: R: Re: STIntersection performance
> Thinking about it the alias only applies within Silverlight - in .Net it > stays as ArrayList...
exactly
-- You received this message because you are subscribed to the Google Groups "NetTopologySuite" group. To post to this group, send email to nettopologysuite@googlegroups.com. To unsubscribe from this group, send email to nettopologysuite+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/nettopologysuite?hl=en.
FastNodingValidator is used by 2.x branch, and looks that contains "only" check for interior intersections, actually the same heck that is so slow in trunk. So maybe here's why trunk and 2.x branches are so slow.
I've added a test that validates a single segmentstring (the slower of all the checks, alone it executes in 5 seconds). In NTS the check is executed in 5 seconds (as expected), in JTS the execution is immediate. I hope that analyzing the single test I can find how is the problem
why god simply using a one-dimensional array can improve performances to 2x or more? the test on segmentstring now executes in 2 seconds instead of 5, and all I've changed is that now in LineIntersector protected ICoordinate[] inputLines = new ICoordinate[4]; and not protected ICoordinate[,] inputLines = new ICoordinate[2,2];
> why god simply using a one-dimensional array can improve performances to 2x
> or more?
> the test on segmentstring now executes in 2 seconds instead of 5, and all
> I've changed is that now in LineIntersector
> protected ICoordinate[] inputLines = new ICoordinate[4];
> and not
> protected ICoordinate[,] inputLines = new ICoordinate[2,2];