I have two datasets (currently in geopackage files) but also have them in a PostGIS database.
1 polyline with about 1 million records 1 polygon with about 50,000 polygons
I want to intersect the lines with the polygons, so as to attribute the lines with the data for the polygons.
When a polyline passes through the polygon, I need it split into two feature - one for each side of the polygon boundary.
How is best to do this in QGIS / PostGIS? In ArcGIS I would use the intersect or spatial join functions and they run within a few minutes, but in QGIS the equivalent tools take hours, if not days to complete. Any suggestions on what I should do to speed these up?
I have tried building spatial indexs in QGIS but unsure if it worked (took only a second or so to run)
I have access to QGIS, R, and PostGIS (though I am a real novice at PostGIS)
Thanks very much.