Home / Works / Right of Way — Poly-Line Position ID

Right of Way — Poly-Line Position ID

QGIS Python Script
6 Seniors Weekly Python · PyQGIS · Geometry Engine

Overview

Ranks parcels/polygons by their sequential position along a reference corridor line — critical for right-of-way workflows. Uses intersection-aware logic: if a polygon overlaps the line, it uses that point; otherwise it projects perpendicularly. Handles CRS mismatches automatically.

How it works

Each polygon takes one of two routes before the positions are ranked.

Polygon layer Line layer Merge line parts,match polygon CRS Touches the line? Earliest intersectionpoint along the line Nearest pointon the line Measure distancealong the line Sort by distance;rank 1 to n Rank field name Polygon copy withrank field yes no

InputStepDecision / optionData storeOutput

Context

One of the 12 algorithms in the PyQGIS Processing Toolbox (Polygon-Line Position ID, standard and optimised versions).

About the code

Built for my department. The code stays with the company, so this page describes the tool only.