tag:blogger.com,1999:blog-5970315134912558864.post448945637838566717..comments2024-03-16T10:04:56.949+01:00Comments on JGrass Tech Tips: GIS clipping benchmark: jgrasstools & uDig (on JTS & geotools)moovidahttp://www.blogger.com/profile/14796065912904641378noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-5970315134912558864.post-35179516211465509412012-11-14T07:09:35.010+01:002012-11-14T07:09:35.010+01:00@Andrea/Micheal:
EnhancedPrecisionOp should be ba...@Andrea/Micheal:<br /><br />EnhancedPrecisionOp should be basically the same performance as Geometry.intersection. I would recommend just using the standard intersection method, since then you will get the benefit of all heuristics it contains.<br /><br />In my testing it is worth using PreparedGeometry.intersects as a primary filter. I'm not using an index, however - I just stream in the entire file.<br /><br />I also use PreparedGeometry.contains as a quick test for lines which are wholly contained, and thus don't have to be intersected.<br /><br />Dr JTShttps://www.blogger.com/profile/02383381220154739793noreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-80935793299023970652012-11-10T12:13:40.930+01:002012-11-10T12:13:40.930+01:00Just for the interest/fun of doing it, I ran this ...Just for the interest/fun of doing it, I ran this on amazon AWS on an cc2.8xlarge instance with 32 cores. It took about 25 seconds, 2 of which for reading the data, 7 of which for writing the result, and most f the rest of the time for creating the index.<br /><br /><br />PS: thanks for the link Michaël moovidahttps://www.blogger.com/profile/14796065912904641378noreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-3131342900862721242012-11-09T20:25:38.408+01:002012-11-09T20:25:38.408+01:00Even if intersects is (maybe) fastest than interse...Even if intersects is (maybe) fastest than intersection, I don't think it worth the overhead.<br />EnhancedPrecisionOp has no overhead if no problem is encountered using the normal intersection (just take care of normal intersection generating exceptions)<br /><br />Here is a link to the code :<br />http://jump-pilot.svn.sourceforge.net/viewvc/jump-pilot/core/trunk/src/com/vividsolutions/jump/tools/OverlayEngine.java?revision=859&view=markup<br /><br />MichaëlMichaël Michaudnoreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-47396090792570188632012-11-09T08:44:08.650+01:002012-11-09T08:44:08.650+01:00Hi Michaël, good to hear from you. I know you from...Hi Michaël, good to hear from you. I know you from your dxf work, which I ported into jgrasstools. Never got a chance to thank you. So thanks! :)<br /><br />About the workflow:<br /><br />> Index collection B with default STRtree parameters (contours)<br /><br />ok, doing the exact same thing here.<br /><br />> For B features intersecting the fence envelope (obtained using the index) :<br />> Compute intersection with EnhancedPrecisionOp.intersection method<br /><br />Since the index holds only the envelope, I am doing an additional if(intersects) using the preparedgeometry. And then I use the geometry's own intersection method. I was assuming that would be faster, it might not.<br /><br />I also wonder if EnhancedPrecisionOp is better/faster. The name would suggest slower, but, well...<br /><br />> Create new Feature and transfer attributes<br /><br />Also here I should be faster, since I just substitute in the old feature the new geometry.<br /><br />I am really wondering where I loose all the time :)<br />Would you mind a link to the code?<br /><br />> No, I don't use multithreading, but it seems to be an intersesting place for parallelization.<br /><br />Yes, I thought so, but honestly i was hoping for more push :)<br />I want to try it on a 36 core on AWS, just to see if that changes a lot or not.<br /><br />> Did you use a fresh JTS version ?<br /><br />The 1.12<br /><br />Cheers,<br />Andreamoovidahttps://www.blogger.com/profile/14796065912904641378noreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-62971386077778693272012-11-09T08:33:03.931+01:002012-11-09T08:33:03.931+01:00Hi Andrea,
Sorry, I'm Michaël Michaud from Op...Hi Andrea,<br /><br />Sorry, I'm Michaël Michaud from OpenJUMP project.<br />I just had a look to the ClipToFence Plugin which does the following.<br />- Index collection B with default STRtree parameters (contours)<br />- For B features intersecting the fence envelope (obtained using the index) :<br /> - Compute intersection with EnhancedPrecisionOp.intersection method<br /> - Create new Feature and transfer attributes<br /><br />No, I don't use multithreading, but it seems to be an intersesting place for parallelization.<br />Did you use a fresh JTS version ?<br /><br />MichaëlUnknownhttps://www.blogger.com/profile/18440967332483284330noreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-49219018943796652362012-11-09T05:52:14.527+01:002012-11-09T05:52:14.527+01:00Hi Unknown :),
that is very interesting!
For the ...Hi Unknown :),<br />that is very interesting!<br /><br />For the clipping operation the fastest I got is 75 seconds. I would really love to know how you get 10 seconds less, since I assume you are on JTS as well. <br /><br />Is the code multithreaded?<br />The only thing I can think of is that I am loosing time during the reading of the data in memory (for the index), instead of sequentially handle them.<br /><br />Nice!moovidahttps://www.blogger.com/profile/14796065912904641378noreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-31144239091772685602012-11-09T01:24:14.440+01:002012-11-09T01:24:14.440+01:00Without surprise, OpenJUMP, which is also based on...Without surprise, OpenJUMP, which is also based on JTS (1.13 NB for the test) takes almost the same time as uDig.<br />From 6 measurements, I get<br />- A fluctuating time of 20 to 66 s for data loading.<br />- A constant time of 61 to 64 s for clipping or overlay.<br />- And 4 to 5 s more to export clipped data.<br /><br />Windows vista 64b + Intel Core i7 (quad core).<br />java7 with 8 Gb mem.Unknownhttps://www.blogger.com/profile/18440967332483284330noreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-52522374647251186342012-11-08T21:04:04.208+01:002012-11-08T21:04:04.208+01:00Definitely Martin! I am expecting some reaction fr...Definitely Martin! I am expecting some reaction from the C world on this, since JTS is performing great :) and I think it could be tweaked further. Let's see what happens :)moovidahttps://www.blogger.com/profile/14796065912904641378noreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-85369953195387376402012-11-08T19:02:06.364+01:002012-11-08T19:02:06.364+01:00Great to see this benchmark done with JTS! And th...Great to see this benchmark done with JTS! And that it turned in a pretty good time.<br /><br />Dr JTShttps://www.blogger.com/profile/02383381220154739793noreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-75355456531461586312012-11-08T16:13:37.649+01:002012-11-08T16:13:37.649+01:00Hi Andrea, thanks, I was hoping for your comment h...Hi Andrea, thanks, I was hoping for your comment here. I did some easy performance tweaks, I can't think how much the time would go down with some of your black magic :)<br /><br />Thanks for the hint on the GeometryClipper, I will look at it.moovidahttps://www.blogger.com/profile/14796065912904641378noreply@blogger.comtag:blogger.com,1999:blog-5970315134912558864.post-86348617359131926122012-11-08T16:09:35.268+01:002012-11-08T16:09:35.268+01:00I see this is not your case, but if you ever have ...I see this is not your case, but if you ever have to clip over a rectangle you should have a look at Geotools GeometryClipper class, it's a lot faster than JTS for that specific caseAndrea Aimehttps://www.blogger.com/profile/04056107353824320977noreply@blogger.com