Subscribe to this thread
Home - General / All posts - Perfomance in Clip Operatiom

570 post(s)
#15-Jan-21 16:23

Hi all

Can someone check please. The included mxb file has 2 drawings. (1)Rivers and (2)Clip. Whenever I try to clip the rivers using Manifold 9 (latest) it takes about an hour to perform the task. The same operation on M8 takes seconds.



How soon?

Bernd Raab45 post(s)
#15-Jan-21 17:27

try transform overlay intersect - clip is the overlay. Took 28 sec to create the drawing.



570 post(s)
#15-Jan-21 19:18

Oh wow. There is a huge performance difference between the transform-geometry Clip transform and the Overlay-intersect transform. At least on this dataset. Not sure why.


Transform: [Rivers] - [Geom (I)] - Overlay : intersect (38.848 sec)

How soon?


570 post(s)
#16-Jan-21 19:47

So I ran both Transforms

Clip Rivers with Clip Area took

2021-01-16 14:30:19 -- Transform: [Rivers] - [Geom (I)] - Clip (20375.647 sec)

Overlay - Intersect Rivers with Clip Area

2021-01-16 15:31:09 -- Transform: [Rivers] - [Geom (I)] - Overlay : intersect (39.613 sec)

Visually both outputs are similar.

The output table for intersect transform includes the columns for both drawings, the clip transform does not produce the same table as the intersect transform it only includes the fields for the rivers drawing.

The performance gap between both transforms is staggering. I would have expected that Clip would be faster. Why?


How soon?


6,436 post(s)
#17-Jan-21 06:28

That's a big difference! I was curious what's going on and so I looked at the queries generated for the two different transforms. Besides the slight difference in functionality, there are three obvious differences:

1. Overlay : intersect uses the GeomOverlayTopologyIntersectPar function and Clip uses GeomClip.

2. Overlay : intersect uses a parallel function and Clip does not.

3. Clip does a GeomUnionAreas of clipping areas, and Overlay : intersect does not.

In your example map, there is only one clipping area, so it is not likely the union that makes a difference.

If you alter the query for Overlay : intersectto use GeomOverlayTopologyIntersect, it takes less than twice as long, so it's not likely parallelism.

My guess, therefore, is that there is something missed in the optimization within GeomClip that is being done in GeomOverlayTopologyIntersect and GeomOverlayTopologyIntersectPar or that for whatever reason in this particular data set whatever is done to allow a choice of either inner or outer clip misses an opportunity. It's also possible that Clip is doing greater controls, like more sensible managing of overlapping clipping areas, that the Overlay operation (being modeled on ESRI commands) does not.

I've written this up as a suggestion/bug report and have sent it in. The good news is that when there is such a big difference between two similar Manifold functions it usually is pretty easy for Engineering to determine what's going on and to improve performance in the function that is slower.


570 post(s)
#17-Jan-21 18:18

Following this up a bit more. I ran the Clip function using ArcGIS 10.7.1 (on shapefiles not a geodatabase) and the output shapefile took 38 seconds.

How soon?


9,480 post(s)
#18-Jan-21 15:22

The performance difference exists because the overlay transform only processes the clipping area once, but the clip transform processes it for each clipped object. We need to extend clipping functions to allow processing the clipped area just once for the clip transform as well. This is on our wishlist. For now, use the overlay.

Manifold User Community Use Agreement Copyright (C) 2007-2019 Manifold Software Limited. All rights reserved.