<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I do this a lot.  If both the input and the output arguments to ogr2ogr
are directories then it will clip all of the shapes in the source
directory and write them to the output directory.  In my case I let it
create the output directory but it mi9ght work to write to an existing
directory.  I use linux by the way so I don't know if it works this way
on Windows or Mac.<br>
<br>
So: ogr2ogr -clipsrc mask.shp output source <br>
<br>
Shapefiles are the default so you don't even need the -f "ESRI
Shapefile".<br>
<br>
Koos Hagg wrote:
<blockquote
 cite="mid:CALXN-LnoFy3ZSzSiUJ6z42M=o3HdVZb8D6cgeZVriHT9zDccVw@mail.gmail.com"
 type="cite">Hi All,<br>
have been searching around for the answer to this question, and found
an old thread on this list.<br>
  <br>
I have a folder which contains about 30 shapefiles, old (but still
useful) vmap0 data, but it is 500mb in size. I'd like to clip each
shapefile to just the region I need.<br>
I understand about ogr2ogr, and I could do it one by one, <br>
  <br>
but I would like to figure out how to write a batch file to do it all
at once. However- I have been trying this and that for a while, not
making any progress.<br>
  <br>
any help is appreciated!<br>
  <br>
  <br>
Koos<br>
  <br>
  <br>
  <br>
Date: Thu, 15 Mar 2012 19:59:44 +0200<br>
From: Zirneklitis <<a moz-do-not-send="true"
 href="mailto:eko@lanet.lv">eko@lanet.lv</a>><br>
Subject: <span class="il">Re</span>: [Qgis-user] <span class="il">Clipping</span>
  <span class="il">60</span> <span class="il">shape</span> <span
 class="il">layers</span><br>
To: <a moz-do-not-send="true" href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a><br>
  <br>
Use ogr2ogr:<br>
  <br>
ogr2ogr -f "ESRI Shapefile" -clipsrc mask.shp output.shp input.shp<br>
  <br>
Karlis<br>
  <br>
Bis Nulama wrote:<br>
> ..<br>
> I have <span class="il">60</span> <span class="il">shape</span> <span
 class="il">layers</span> and I would like to cut them on a poligon <span
 class="il">shape</span><br>
> (region boundary).<br>
> Is there a way to do this selecting all the <span class="il">60</span>
  <span class="il">layers</span> at once (and not<br>
> repeating the clip command <span class="il">60</span> times)?<br>
> ..
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>
  </pre>
</blockquote>
<br>
</body>
</html>