[general]
name=roadnetwork
qgisMinimumVersion=3.40
commitNumber=
about=This plugins allows to manage a topological road network : guided editing, linear referencing, references from geometries and geometry generation from references.
icon=resources/icons/icon.png
category=
deprecated=False
hasProcessingProvider=True
description=roadnetwork
author=3Liz
email=info@3liz.com
tags=road network,linear referencing,editing
homepage=https://docs.3liz.org/qgis-road-network-plugin/
repository=https://github.com/3liz/qgis-road-network-plugin
tracker=https://github.com/3liz/qgis-road-network-plugin
experimental=False
version=0.7.0
commitSha1=553ce9346f874ed52f4c576fe18fa76fb4ec1223
dateTime=2026-11-15T14:12:45Z
changelog=
	Version 0.7.0:
	### Summary
	
	**Highlights**
	
	* **Road graph checks**: ten checks find the issues of the road graph, for example after an import:
	  crossing edges without node, T junctions not connected, close nodes, useless nodes, reversed edges,
	  roads with branches, parallel edges, short edges and markers issues. Most of them can be fixed automatically
	  in an editing session, in batch or with a right click on the issue in QGIS
	  (see the page [Check and fix the road graph](https://docs.3liz.org/qgis-road-network-plugin/user-guide/graph-checks/))
	* **Edges and nodes**: several fixes of the triggers keeping the road graph consistent when an edge is reversed,
	  when an edge or a node is moved near another node, or when the end of an edge is moved
	
	**Upgrade notes**
	
	* Run the algorithm `Upgrade database structure` to upgrade the database (migration 44).
	  It repairs the edges whose geometry has been reversed without swapping their start and end nodes
	* After the upgrade, run the algorithm `Check the road graph` on the production schema to get an overview
	  of the issues of the road graph, then fix them in an editing session
	
	### Added
	
	* **Road graph checks**: new algorithms `Check the road graph` and `Fix the road graph issues`,
	  SQL functions `check_graph` and `fix_graph_issue`, and table `glossary_graph_check` listing the checks
	  and their default options, to find the issues of the road graph,
	  for example after an import, and fix them in an editing session (migration `upgrade_to_44.sql`)
	* **Road graph checks**: the layers created by the algorithm `Check the road graph` have actions to fix an issue
	  with a right click (`Fix this issue`, `Choose the fix of this issue…`), or to select its edges,
	  a style showing the fixed issues in grey, and the fields `fix_status` and `fix_message` storing the result of the fixes
	* **Road graph checks** - G01: edges crossing or touching each other without being split by a node.
	  The edges touching each other are fixed by a node splitting them, and the edges crossing each other
	  by a node or by the field `no_intersection_cutting` (bridge, tunnel), chosen for each issue
	* **Road graph checks** - G02: edges ending near another edge without being connected to it (T junction),
	  fixed by extending the edge to the other edge, which is split there
	* **Road graph checks** - G03: nodes close to each other, fixed by merging them
	* **Road graph checks** - G04: useless nodes, without edge or between two edges of the same road,
	  fixed by deleting the node, which merges the two edges
	* **Road graph checks** - G05: edges in the opposite direction of their road, found with the order of the markers
	  or the direction of the neighbour edges, fixed by reversing them
	* **Road graph checks** - G06: roads with branches, i.e. more than two edges of the road at a node,
	  for example ramps using the code of the road, to fix manually
	* **Road graph checks** - G07: parallel edges of the same road, for example two carriageways
	  using the same road code, to fix manually
	* **Road graph checks** - G08: short edges, except near the roundabouts, fixed by removing the edge
	  and merging its nodes
	* **Road graph checks** - G09: first marker of a road not at the start of the road,
	  fixed by moving the marker to the start of the road when it is less than 1 m from it
	* **Road graph checks** - G10: markers not in the order of the road, far from the road,
	  or on an edge without reference, to fix manually
	* **Documentation**: new page `Check and fix the road graph`, with a diagram of each check and of its fix
	
	### Fixed
	
	* **Edges**: when an edge is created or modified, its start and end points use the **closest node**
	  less than 50 cm from them, instead of the node with the lowest id. Before, modifying any vertex of an edge
	  could connect it to another node close to its start or end node
	* **Edges**: reversing the geometry of an edge, for example with the QGIS tool `Reverse Line`,
	  now swaps its start and end nodes, and calculates again its previous and next edges and the references of its road.
	  Before, the change was ignored, because the geometry was considered unchanged.
	  The migration repairs the edges already reversed
	* **Edges**: when the end point of an edge is moved to another node, its old end node is deleted
	  if no edge uses it anymore, like its old start node. Before, it was left without edge
	* **Nodes**: when a node is created or moved less than 50 cm from another node, the two nodes are merged,
	  and the edge linking them, if any, is deleted. Before, this edge was left as a loop on the node
	
	Version 0.6.4:
	### Summary
	
	**Highlights**
	
	* **Managed objects**: the split and merge of lines in Lizmap now give the right references, even for lines
	  drawn in the opposite direction of the road, and the lines connected to an edited line stay connected
	* **Security**: the `SECURITY DEFINER` functions set their `search_path`, and the read-only functions
	  work even if the `search_path` of the caller does not contain `public`
	
	**Upgrade notes**
	
	* Run the algorithm `Upgrade database structure` to upgrade the database (migration 43)
	
	### Added
	
	* **SQL**: new trigger function `update_managed_object_linked_geometries`: when the geometry of a managed line
	  is updated, the lines of the same table and road which were connected to its start or end are shortened
	  or extended to stay connected. Their references, and cumulative distances, follow the new references
	  of the line, and their geometry is calculated again from them. The function `add_managed_objects_triggers`
	  creates this trigger `trg_update_managed_object_linked_geometries` on the line tables,
	  and now returns one line per trigger with its name (migration `upgrade_to_43.sql`)
	
	### Changed
	
	* **Lizmap**: in the form `Create the geometry from references` of the editing panel, the fields `Offset` and `Side`
	  are hidden by default: click on `Offset` to display them
	* **Lizmap**: the button `Merge two lines` of the popup no longer requires the right to delete features,
	  but the rights to create features and modify the geometry. The editing rights needed to display the buttons
	  `Split a line at a point` and `Merge two lines` can be changed with the new constants
	  `ROAD_SPLIT_NEEDED_RIGHTS` and `ROAD_MERGE_NEEDED_RIGHTS` of the script `road_network.js`
	* **SQL**: merge of two managed object lines (Lizmap action `merge_selected_lines`): the merged feature
	  is now the feature chosen first, with its field values, instead of the feature with the lowest start references.
	  Its references, and its cumulative distances if the table has these fields, are calculated from the merged line
	  in the direction of the road, even if the table has no trigger calculating them (migration `upgrade_to_43.sql`)
	* **SQL**: the functions called from outside the plugin which only read data (`get_reference_from_point`,
	  `get_road_point_from_reference`, `get_road_substring_from_references`, `get_managed_object_geometry_from_references`,
	  `get_snapped_line_from_track`, `get_road_sections_from_snapped_line`, `get_spatial_road`)
	  and the trigger function `calculate_managed_object_references` now set their `search_path` to `public`:
	  they work even if the `search_path` of the caller does not contain the schema `public`, where PostGIS is installed
	  (migration `upgrade_to_43.sql`)
	* **SQL**: security: the `SECURITY DEFINER` functions `copy_data_to_editing_session`, `drop_editing_session`
	  and `toggle_foreign_key_constraints` now set their `search_path` to `public, pg_temp`,
	  and `merge_editing_session_data` prefixes the objects of the production schema (migration `upgrade_to_43.sql`)
	
	### Fixed
	
	* **SQL**: split of a managed object line by a point (Lizmap action `split_line_by_point`): for a line drawn
	  in the opposite direction of the road, each part could get the references of the other part,
	  or start after its end. The two parts now follow the direction of the road, like the geometries
	  calculated from the references, and their four references, and their cumulative distances
	  if the table has these fields, are calculated in the direction of the road (migration `upgrade_to_43.sql`)
	* **SQL**: the trigger calculating the references of the managed objects (`trg_calculate_managed_object_references`)
	  gave a start reference greater than the end reference for a line drawn in the opposite direction of the road.
	  They are now inverted, like in the algorithm `Update managed objects from the road graph`
	* **Lizmap**: in the form `Create the geometry from references` of the editing panel, the start and end references
	  of a line drawn in the opposite direction of the road were displayed in the drawing order.
	  They are now ordered in the direction of the road, like the geometry created from them
	
	Version 0.6.3:
	### Summary
	
	**Highlights**
	
	* **Performance**: merging an editing session is much faster on long roads: only the managed objects
	  which may be impacted by the modifications are updated, for example 0.4 s instead of 13 s for a new crossroad
	* **Fixes**: more precise cumulative distances (to the centimeter), and the managed lines are no longer
	  shortened by 1 cm at each merge
	
	**Upgrade notes**
	
	* Run the algorithm `Upgrade database structure` to upgrade the database (migration 42).
	  It calculates again the references of all the edges, which can take a few minutes on a large road graph
	* Optionally, run the algorithm `Update managed objects from the road graph` on each managed table
	  to correct their cumulative distances
	
	### Changed
	
	* **SQL**: faster merge of the editing sessions: only the managed objects which may be impacted
	  by the modifications are updated (near the modified edges, downstream of them if the road geometry has changed,
	  or near a modified marker), instead of all the objects of the modified roads.
	  For example on a road of 118 km with 1,250 objects: 0.4 s instead of 13 s for a new crossroad,
	  and 5 s instead of 13 s for a realigned edge (migration `upgrade_to_42.sql`)
	
	### Fixed
	
	* **SQL**: the cumulative distances greater than 10 km were rounded to 10 cm (1 m above 100 km),
	  for the edges and the managed objects. The migration calculates again the references of all the edges
	  (about 17 s for the 7,809 edges of the demo data). The managed objects are corrected when they are updated,
	  or with the algorithm `Update managed objects from the road graph`
	* **SQL**: the managed lines with the update policy `geometry` were shortened by 1 cm at each merge
	* **SQL**: a managed object whose geometry cannot be calculated from its references no longer cancels the merge:
	  it is not updated, and a warning is displayed
	* **SQL**: the list of the last updated managed objects (`last_updated_objects_ids`) is emptied
	  when a merge does not update any object: it still contained the objects of the previous merge
	* **Tools panel**: the references displayed on click or on hover now show the marker `0`, and the abscissa,
	  offset or cumulative distance `0`, instead of an empty field
	


[roadnetwork]
schemaVersion=44
schemaName=road_graph
