Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to automate a process of a shape file. We are using google maps engine and we have limitation on number vertices in a shape file. so I am using a grid to split the shape files.

In GUI , I add a grid from research tool then vector->geoprocessing->intersect and get the result but when I try it using API ( with below code ) result is not same. it gives me error as it cannot insert LINESTRING in POLYGON shapefile. this is my code:

QgsApplication.setPrefixPath('C:\\OSGeo4W\\apps\\qgis', True)
covLayer = QgsVectorLayer('C:\\Shapes\\small coverage.shp','coverage','ogr')
gridLayer = QgsVectorLayer('C:\\Shapes\\small grid.shp','grid','ogr')

any insight? stuck badly here!! Thanks.

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.