<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I've committed the enhancement to the trunk.<br>
<br>
The new options are USE_PREPARED_GEOMETRIES, which defaults to YES,
and PRETEST_CONTAINMENT (note the change in this key), which
defaults to NO.<br>
<br>
Prepared geometries are used in Intersection, Union, and Identity.<br>
<br>
Ari<br>
<br>
<div class="moz-cite-prefix">22.01.2016, 15:06, Kai Muehlbauer
kirjoitti:<br>
</div>
<blockquote cite="mid:56A22968.7060204@uni-bonn.de" type="cite">Here
is the code.
<br>
<br>
Am 22.01.2016 um 14:05 schrieb Kai Muehlbauer:
<br>
<blockquote type="cite">Am 22.01.2016 um 13:26 schrieb Even
Rouault:
<br>
<blockquote type="cite">Le vendredi 22 janvier 2016 13:19:40,
Kai Muehlbauer a écrit :
<br>
<blockquote type="cite">Am 22.01.2016 um 12:58 schrieb Ari
Jolma:
<br>
<blockquote type="cite">22.01.2016, 13:49, Kai Muehlbauer
kirjoitti:
<br>
<blockquote type="cite">This is very good news! If I
understand correctly, I could use your
<br>
patch and self-compile gdal to have access to the
improved
<br>
layer-intersection function via the python bindings.
I'll give this a
<br>
try.
<br>
</blockquote>
<br>
Attached is probably a bit better diff.
<br>
<br>
As I wrote, similar thing should be done for other layer
methods.
<br>
<br>
Yes, you can use this with the trunk version.
<br>
</blockquote>
<br>
Thanks Ari, I keep you posted. If I get this running, I'm
also available
<br>
for testing the other changes.
<br>
</blockquote>
<br>
Kai, just thinking: do you have spatial indices defined,
especially on
<br>
the
<br>
method layer ? If not, that would be the first thing to do
since for each
<br>
geometry in input layer, a spatial filter is set on method
layer using
<br>
the
<br>
extent of the input geometry.
<br>
</blockquote>
<br>
Thanks for the comment Even, yes, I have a spatial filter in
place. But
<br>
with prepared geometries it takes only 50% of the time. Attached
you
<br>
find my (stripped) python code:
<br>
<br>
Method 1 is more or less what I do. In my example this takes 35
seconds.
<br>
<br>
Method 2 I implemented with shapely prepared geometry. This runs
only
<br>
~17 seconds on the same machine.
<br>
<br>
If I call layer.Intersection(method, dst, options) directly it
takes ~55
<br>
seconds.
<br>
<br>
So with the prepared geometries we get 70% improvement. And 50%
<br>
improvement compared to the iteration over layer method.
<br>
<br>
And, without SpatialFilter this will run almost forever.
<br>
<br>
Thanks again for your comments, it's very much appreciated.
<br>
<br>
Cheers,
<br>
Kai
<br>
_______________________________________________
<br>
gdal-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
<br>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
</body>
</html>