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.

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.

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.