I want to make intersection between polygon and polyline shapefile with pyqgis, but I get an empty output. Here the code that i use :

params = {'INPUT': polygone.shp, 'OVERLAY': line.shp, 'INPUT_FIELDS': [], 'OVERLAY_FIELDS': [], 'OUTPUT': 'memory'}
processing.run('native:intersection', params)

bellow the picture of polygon and polyline shapefile. The both shapefiles have the same crs : epsg:2154

enter image description here

  • 1
    Please Edit the question to specify the coordinate references of the two files. – Vince Jul 22 at 11:20
  • @Vince i edited it – Elite Jul 22 at 11:23
  • @Joseph - Thanks, it work. – Elite Jul 23 at 11:38
  • @Elite - Most welcome, glad it helped! – Joseph Jul 23 at 11:47

Create a buffer of the line layer and use that as the overlay layer instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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