<div dir="ltr"><div>Yes, convert format is based on ogr2ogr but I dont think it can be modified to do "clip". Why don't you try running ogr2ogr from the command line? <br><br></div><div>You need to navigate to the directory where both your shapefiles are stored and run the code just like in the blog post. I tried on Linux but it should be the same on Windows (command line on Windows is "command prompt").<br></div><div><br><code>ogr2ogr -clipsrc clipping_polygon.shp output.shp input.shp</code><br><br></div><div>Hope it helps<br><br></div><div>PS: It would be nice to add a "clip" algorithm based on ogr2og with <code> -clipsrc </code>since it seems to be much faster</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 16, 2014 at 1:16 AM, Jonas Sjögren <span dir="ltr"><<a href="mailto:jonas.sjo@gmail.com" target="_blank">jonas.sjo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi again,<div>unfortunately the processing is quite slow again with the difference algorithm, about 2,5 hours. With a script running with 60 iterations the total processing time will be about a week. No other processes are running except for internet. The script sequence is </div><div>processing.runalg( 'qgis:difference', InputRoadNetwork, ClippingPolygon, OutputRoadNetwork )</div><div>I have tried the <span style="font-family:arial,sans-serif;font-size:13px">'gdalogr:ogr2ogr' clipping </span><span style="font-family:arial,sans-serif;font-size:13px">algorithm expressed in</span></div><div><font face="arial, sans-serif"><a href="http://darrencope.com/2011/03/31/clipping-large-shapefiles-using-ogr/" target="_blank">http://darrencope.com/2011/03/31/clipping-large-shapefiles-using-ogr/</a> and <a href="http://www.gdal.org/ogr2ogr.html" target="_blank">http://www.gdal.org/ogr2ogr.html</a></font><span style="font-family:arial,sans-serif"> </span></div><div><font face="arial, sans-serif">which I believe corresponds to the algorithm GDAL/OGR [32 geoalgorithms] => [OGR] Conversion => Convert format in the Processing Toolbox. </font><span style="font-family:arial,sans-serif">Still I do not know how to get the code right in 'Creation Options'. It should be something like </span></div><div><font face="arial, sans-serif">[-clipsrc ClippingPolygon.shp]. Anyone who has an idea?</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Best regards,</font></div><div><font face="arial, sans-serif">Jonas</font></div><div><font face="arial, sans-serif"><br></font></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2014-10-14 20:36 GMT+02:00 Jonas Sjögren <span dir="ltr"><<a href="mailto:jonas.sjo@gmail.com" target="_blank">jonas.sjo@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div>to check that my data was ok I tried a clip tool in ArcMap where the same calcuation took exactly 10 seconds. After some modifications in my script and using the 'qgis:difference' algorithm, processing time was reduced to about 5 minutes, quite acceptable. Thank you for helping me sort this out.</div><span><font color="#888888"><div>/Jonas</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-14 7:47 GMT+02:00 Bernhard Ströbl <span dir="ltr"><<a href="mailto:bernhard.stroebl@jena.de" target="_blank">bernhard.stroebl@jena.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hm,<br>
<br>
goes pretty fast here, both with PostGIS and shp layers (some 5 lines, 1 polygon, both layers in the same CRS as the project, shp on local drive)<br>
QGIS 2.4 64 bit on Win7<br>
<br>
Bernhard<br>
<br>
Am 14.10.2014 02:49, schrieb Mike Flannigan:<div><div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I am also using QGIS 2.4 64b Chugiak on Windows 7.<br>
The same thing happens to me.  Even when I create<br>
a line layer with only 11 lines and try to clip 3<br>
of them with a polygon layer, the progress bar just<br>
goes back and forth for ever.<br>
<br>
I didn't run it for hours to see what would eventually<br>
happen.<br>
<br>
Mike<br>
<br>
<br>
I might be doing something wrong.<br>
<br>
On 10/13/2014 8:02 AM, <a href="mailto:qgis-user-request@lists.osgeo.org" target="_blank">qgis-user-request@lists.osgeo.<u></u>org</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
I am trying to clip a road network by a polygon in a script using the<br>
algorithm 'qgis:clip'. The result seems to be quite ok but it takes an<br>
incredible long time to produce, about 14 hours (!). The road network<br>
shapefile consists of about 5000 features (not very many, I believe) and<br>
the clipping shapefile consists of one single polygon. When using<br>
Vector =><br>
Geoprocessing Tools => Clip from the QGIS menu, the time required is<br>
about<br>
the same. Does anyone have a clue why it takes so long time? Are there<br>
other clip tools that I may try? I?ve been looking at the<br>
'gdalogr:ogr2ogr'<br>
algorithm and its clipsrc function but not got it to work properly<br>
yet. I?m<br>
using QGIS 2.4 Chugiak on Windows 7 with 2.5 GHz processor. Thankful for<br>
all hints that may help,<br>
/Jonas<br>
</blockquote>
<br>
</blockquote>
<br>
<br></div></div>
__________ Information from ESET Mail Security, version of virus signature database 10558 (20141014) __________<br>
<br>
The message was checked by ESET Mail Security.<br>
<a href="http://www.eset.com" target="_blank">http://www.eset.com</a><div><div><br>
<br>
<br>
______________________________<u></u>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br></blockquote></div><br></div>