Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

in QGIS vectorlayers can be intersected. That is apparently done by ftools and seems to be integrated into the QGIS-program itself.

That is different from many other functions that call GDAL-tools.

I would like to intersect esri-shapefiles in a script and without having to load anything into QGIS. Is there a GDAL-tool or some other commandline-suite that will do this?

It would be nice to have a tool that handles the shapefile natively (GDAL-tools do that) without having to import it or convert it to some internal format.

An alternate solution would be a commandline-interface to ftools.

THX stn

share|improve this question
add comment

1 Answer

This post on the gdal-dev mailing list by Warmerdam himself says it's not possible with gdal tools directly, but it can be programmed using one of the available language wrappers (i.e. Python):

The key method is OGRGeometry::Intersection() which when invoked on one geometry with another geometry will return a new geometry which is their intersection.

Note that this method depends on GDAL/OGR having been built against the GEOS geometry library which really does the work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.