[geos-devel] GEOSDiffernce vs GEOSIntersection complexity?

Sandro Santilli strk at keybit.net
Fri Jul 4 09:17:19 PDT 2014

On Fri, Jul 04, 2014 at 05:08:04PM +0200, G. Allegri wrote:
> I'm trying to understand why the two tools in QGIS using the respective
> functions have so much differnce in execution times.
> I've made the two tools as similar as possible, to have the GEOS calls as
> the only difference. The execution time differs of a copule of magnitude of
> orders. I wonder if the two overlay operations, on the GEOS side, are so
> differnt to justify such a difference on the execution time. At first sight
> they appeared to be similar from the point of view of the geometrical
> operations involved in the computation, aren't they?

They should indeed be of the same complexity, but you might be incurring
in topology exception and thus heuristics to try multiple times after
changing some parameters. Defining GEOS_DEBUG_BINARYOP to 1 in geom/BinaryOp.h
should make such case evident.

Another possible reason would be you're intersecting against a rectangle,
which supposedly has special handling. Are you ?


More information about the geos-devel mailing list