Is there any tool (plugin) for QGIS to assign order (sequence) number of line intersecting through polygons?
At this moment I use a bit cumbersome solution which works but...
- I use Qchainage plugin to generate dense points along the line with order
- With spatial join (Vector / Data Management Tools / Join attributes by location) I assign values from points into polygons
- I make sure all polygons have assigned some value (in all of them was point), if not I fill in manually missing values
- I recalculate values so they are in sequence from 1 to n (n is number of polygons the line intersect) with interval 1
There is also possible solution using PostGIS Find all intersections of a LineString and a Polygon and the order in which it intersects it . Maybe it is possible to do something similar in QGIS without PostGIS?

the query :
WITH r AS (
SELECT c.pgid AS pgid, geo_rio AS geometry /:polygon:4674/ ,
ST_LineLocatePoint(geo_rio,(ST_startpoint(geo_rio))) AS location FROM (
SELECT rio_teste.id AS lineid, poligono_teste.id as pgid, ST_Intersection(geo_rio, geo_teste) AS geometry FROM public.rio_teste, p
– Andre Luiz teixeira leite
Nov 22 '19 at 14:36
