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) QgsApplication.initQgis() covLayer = QgsVectorLayer('C:\\Shapes\\small coverage.shp','coverage','ogr') gridLayer = QgsVectorLayer('C:\\Shapes\\small grid.shp','grid','ogr') qgis.analysis.QgsOverlayAnalyzer().intersection(gridLayer,covLayer,'C:\\Shapes\\intersected.shp',False) QgsApplication.exitQgis()
any insight? stuck badly here!! Thanks.