“Linear referencing (also called linear reference system or linear referencing system or LRS), is a method of spatial referencing, in which the locations of features are described in terms of measurements along a linear element, from a defined starting point, for example a milestone along a road.” (Linear referencing, Wikipedia, 2013).
The plugin was developped for Il Servizio Gestione Strade della Provincia Autonoma di Trento.
The biggest problem of LRS is consistency and quality of data. This is caused by the fact that line and point data are maintained separately, sometimes even by different entities. Identification and correction of errors in LRS is tedious and inefficient without specialized tools. The true value of this plugin is in its support for errors identification, navigation and correction.
The calibration is a process in which:
The calibration is launched from the first tab Calibrate:
Options:
When all oprions are set correctly, calibration may be launched by OK button. The process may take a while, progress bar with status label is indicating current state. When calibration is finished all tabs are enabled and LRS may be used or edited.
Measures are always interpolated between two poins. This may be made optional in future but currently we don’t see any usecase where non inperpolating could give better results. If you know any, please create a new issue.
The generated LRS is not stored in a new output layer but it is kept in memory and it can be used immediately to generate events or acquire measures. This may change in future but currently QGIS vector core API does not support measure value in vector geometry. We hope that rebuilding the LRS when needed should not be disturbing because all options are stored in project for the case when a task has to be repeated and calibration is relatively fast.
The LRS plugin in QGIS works similarly as ArcGIS CalibrateRoutes_lr() with parameters calibrate_method=DISTANCE, search_radius=<Max distance> and interpolate_between=BETWEEN. If Extrapolate is checked it means plus parameters extrapolate_before=BEFORE and extrapolate_after=AFTER.
When calibration phase is finished it is possible to browse data inconsistencies in Errors tab.
Tha tab contains list of all errors which can be filtered over all columns by entering a string in Filter entry. The plugin is able to identify following data errors:
When an error is selected in the list, it is highlighted in map and it is possible to Zoom to the feature by the button under the list.
It is also possible to add a new memory error (points and lines) layers by Error layers button.
It is also possible to add a new layer quality layer by Quality layer button. The quality layer by default symbolizes features based on relative error, which is calculated as difference between a distance calculated from measures defined as point attributes and a length of the line between those points measured along the line (calculated from line geometry). The quality layer attributes are:
The properties of the errors and quality layers are stored in project like for any other layer and the plugin remember those layers so it is possible to change symbology and store it in project for the next time.
The power of the plugin is in dynamic update of the LRS, errors list, error layers and quality layer when source lines or points layers are edited. User can start editing of points or lines, zoom to an error, fix the error in data and error/quality layers are immediately (and quickly because only single route is recalibrated) updated so that the user see promptly if the fix was successful.
Punctual or linear events can be generated from Events tab.
Events tab options:
The output layer type is point if End measure field is left blank or line if End measure field is selected. The output layer contains all attributes from input layer plus, if specified, error field.
The output is created as memory layer which can be later stored in a persistent data source using standard QGIS options like “Save as” or DB Manager “Import layer”.
Route id and measures may be acquired for existing points from Measures tab.
Measures tab options:
The output layer contains all attributes from input layer plus route id and measure field. To acqure measure, the points are projected to neares point on nearest route within the threshold. If nearest route within threshold was found but there is no LRS for that part of the route, the measure field is left blank. If no route was found within the threshold both route id and measure fields are left blank.
The output is created as memory layer which can be later stored in a persistent data source using standard QGIS options like “Save as” or DB Manager “Import layer”.