[Qgis-user] Clipping 60 shape layers

Koos Hagg hagg.koos at gmail.com
Tue May 8 19:58:27 PDT 2012


Thank you all!

The tip that you can specify a folder (not only individual files) in the
ogr2ogr command was the breakthrough. That helps a lot, and will make other
tasks like this a breeze, now that I know this. :)

-happy mapping,
Koos



On Tue, May 8, 2012 at 12:16 AM, David J. Bakeman <dbakeman at comcast.net>wrote:

> **
> 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.
>
> So: ogr2ogr -clipsrc mask.shp output source
>
> Shapefiles are the default so you don't even need the -f "ESRI Shapefile".
>
> Koos Hagg wrote:
>
> Hi All,
> have been searching around for the answer to this question, and found an
> old thread on this list.
>
> 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.
> I understand about ogr2ogr, and I could do it one by one,
>
> 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.
>
> any help is appreciated!
>
>
> Koos
>
>
>
> Date: Thu, 15 Mar 2012 19:59:44 +0200
> From: Zirneklitis <eko at lanet.lv>
> Subject: Re: [Qgis-user] Clipping 60 shape layers
> To: qgis-user at lists.osgeo.org
>
> Use ogr2ogr:
>
> ogr2ogr -f "ESRI Shapefile" -clipsrc mask.shp output.shp input.shp
>
> Karlis
>
> Bis Nulama wrote:
> > ..
> > I have 60 shape layers and I would like to cut them on a poligon shape
> > (region boundary).
> > Is there a way to do this selecting all the 60 layers at once (and not
> > repeating the clip command 60 times)?
> > ..
>
>
> _______________________________________________
> Qgis-user mailing listQgis-user at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20120509/e1a35938/attachment.html>


More information about the Qgis-user mailing list