[Gdal-dev] Clip shapefile into a polygon

Frank Warmerdam warmerdam at pobox.com
Tue Aug 7 10:20:06 EDT 2007


SAEZ Laurent - CETE Méditerr./DI/ETER wrote:
> Hi,
> 
> First, I would like to apologise for my English... I hope someone will understand me.
> I have many shapefiles representing contours of French departements.
> I want to clip each of them using a polygon from another shapefile (the departemental borders).
> I've tried to do that with ESRI products. Sometimes it's OK, but sometimes not.
> Is there an utility program that allows to clip a shapefile with another one ?

Laurent,

There is no gdal/ogr utility that will clip polygons based on other ones.
But it is possible to write a script or program to do so using the OGRGeometry
Intersection() method.

http://www.gdal.org/ogr/classOGRGeometry.html#202ad4c29487ca046c4a2b055042cb6a

But, of course, this is a somewhat involved process.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list