https://github.com/sducournau/consolidate_networks
A Qgis plugin toolset for consolidate your network data
https://github.com/sducournau/consolidate_networks
geometry network network-analysis qgis qgis-plugin qgis-processing qgis3 qgis3-plugin
Last synced: 4 months ago
JSON representation
A Qgis plugin toolset for consolidate your network data
- Host: GitHub
- URL: https://github.com/sducournau/consolidate_networks
- Owner: sducournau
- License: mit
- Created: 2023-10-12T14:28:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-25T22:18:13.000Z (over 2 years ago)
- Last Synced: 2025-10-07T17:02:51.549Z (8 months ago)
- Topics: geometry, network, network-analysis, qgis, qgis-plugin, qgis-processing, qgis3, qgis3-plugin
- Language: Python
- Homepage: https://sducournau.github.io/consolidate_networks/
- Size: 20.6 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
#  Consolidate Networks
**Consolidate Networks is a Qgis plugin toolset that helps you optimize the geometry of your line network.**
*This plugin provides processing algorithms that allow you to manipulate the vertices of a line layer.
You can repair topological problems and clean your data.*
Github page : https://sducournau.github.io/consolidate_networks/
Qgis plugin repository : https://plugins.qgis.org/plugins/consolidate_networks/
******
# 1. Preview

# 2. Models
#### **CN | Self-repair Pipeline model**
`Apply multiple snappings steps and make the use of cn provider algorithms.`

******
# 3. List of CN provider algorithms

## DBscan and consolidate
#### **CalculateDbscan()**
`Calculate dbscan clusters of lines from a layer source.`
##### Processing algorithm
~~~~
cn.calculatedbscan
~~~~
##### Paramètres
~~~~
{
"INPUT": QgsVectorLayer, # vector layer source (TypeVectorLine)
"FIX_GEOMETRIES_BEFORE_PROCESSING": true, # repairs the input layer geometries at the start of processing
"POINTS_DBSCAN_THRESHOLD_DISTANCE": 0.1, # a decimal distance in meter between each point, eq to vertices density to do a dbscan
"DBSCAN*": false, # consider border points as noise
"PRINT_DEBUG": false, # activates debug mode (print readable in the console)
"OUTPUT": "TEMPORARY_OUTPUT" # vector layer computed (TypeVectorLine)
}
~~~~

******
#### **ConsolidateWithDbscan()**
`Snap lines to each other splitting by their clusters from a layer source resulted from CalculateDbscan().`
##### Processing algorithm :
~~~~
cn.consolidatewithdbscan
~~~~
##### Paramètres
~~~~
{
"INPUT": QgsVectorLayer, # vector layer source (TypeVectorLine)
"FIX_GEOMETRIES_BEFORE_PROCESSING": true, # repairs the input layer geometries at the start of processing
"BUFFER_DBSCAN": 5.0, # a decimal buffer radius to snap groups between them
"PRINT_DEBUG": false, # activates debug mode (print readable in the console)
"OUTPUT": "TEMPORARY_OUTPUT" # vector layer computed (TypeVectorLine)
}
~~~~

******
#### **MakeIntersectionsVertexes()**
`Insert missing vertices from a source layer.`
##### Processing algorithm :
~~~~
cn.makeintersectionsvertexes
~~~~
##### Paramètres
~~~~
{
"INPUT": QgsVectorLayer, # vector layer source (TypeVectorLine)
"FIX_GEOMETRIES_BEFORE_PROCESSING": true, # repairs the input layer geometries at the start of processing
"ENTITY_IDENTIFICATION_FIELDS": [], # vector layer source fields to brings decomposed entities together, by default all fields are selected
"PRINT_DEBUG": false, # activates debug mode (print readable in the console)
"OUTPUT": "TEMPORARY_OUTPUT" # vector layer computed (TypeVectorLine)
}
~~~~
## Snapping layer (from himself)
#### **EndpointsStrimmingExtending()**
`Cut and extend end lines from a layer source.`
##### Processing algorithm :
~~~~
cn.endpointstrimmingextending
~~~~
##### Paramètres
~~~~
{
"INPUT": QgsVectorLayer, # vector layer source (TypeVectorLine)
"FIX_GEOMETRIES_BEFORE_PROCESSING": true, # repairs the input layer geometries at the start of processing
"BUFFER_TRIM": 3.0, # maximum segment reduction distance
"BUFFER_EXTEND": 5.0, # maximum segment extension distance
"PREFERRED_BEHAVIOR_FOR_STARTING_EXTREMITIES": 1, # prefered behaviour for startings enpoints : 'Trim','Extend','None'
"PREFERRED_BEHAVIOR_FOR_ENDING_EXTREMITIES": 0, # prefered behaviour for endings enpoints : 'Trim','Extend','None'
"HAUSDORFF_DISTANCE_LIMIT": 5.0, # hausdorff distance limit to avoid calculations between geometries too similar
"ANGULAR_LIMIT_OF_PARALLEL_GEOMETRIES": 15.0, # angular limit difference between two geometries
"EXPLODE_AND_GATHER": false, # decomposes each entity into segments composed of two points at the start of processing, then brings them together at the end of processing
"ENTITY_IDENTIFICATION_FIELDS": [], # vector layer source fields to brings decomposed entities together, by default all fields are selected
"PRINT_DEBUG": false, # activates debug mode (print readable in the console)
"OUTPUT": "TEMPORARY_OUTPUT" # vector layer computed (TypeVectorLine)
}
~~~~

******
#### **EndpointsSnapping()**
`Snap lines endpoints' to each other's from a layer source.`
##### Processing algorithm :
~~~~LIST OF CN PROVIDER ALGORITHMSModels
cn.endpointssnapping
~~~~
##### Paramètres
~~~~
{
"INPUT": QgsVectorLayer, # vector layer source (TypeVectorLine)
"FIX_GEOMETRIES_BEFORE_PROCESSING": true, # repairs the input layer geometries at the start of processing
"BUFFER_ENDPOINTS_SNAPPING": 5.0, # maximum snapping distance
"PREFERRED_BEHAVIOR_FOR_STARTING_EXTREMITIES": 1, # prefered behaviour for startings enpoints :
# 'Nearest, Minimum angular variation','Farest, Minimum angular variation',
# 'Nearest, Maximum angular variation','Farest, Maximum angular variation'
"PREFERRED_BEHAVIOR_FOR_ENDING_EXTREMITIES": 0, # prefered behaviour for endings enpoints :
# 'Nearest, Minimum angular variation','Farest, Minimum angular variation',
# 'Nearest, Maximum angular variation','Farest, Maximum angular variation'
"HAUSDORFF_DISTANCE_LIMIT": 5.0, # hausdorff distance limit to avoid calculations between geometries too similar
"MIN_ANGULAR_LIMIT_OF_PARALLEL_GEOMETRIES": 0.0, # minimum angular limit difference between two geometries
"MAX_ANGULAR_LIMIT_OF_PARALLEL_GEOMETRIES": 180.0, # mximum angular limit difference between two geometries
"PREFERS_SAME_GEOMETRY_DIRECTION": true, # favors entities whose geometry has the same direction
"EXPLODE_AND_GATHER": false, # decomposes each entity into segments composed of two points at the start of processing, then brings them together at the end of processing
"ENTITY_IDENTIFICATION_FIELDS": [], # vector layer source fields to brings decomposed entities together, by default all fields are selected
"PRINT_DEBUG": false, # activates debug mode (print readable in the console)
"OUTPUT": "TEMPORARY_OUTPUT" # vector layer computed (TypeVectorLine)
}
~~~~

******
#### **HubSnapping()**
`Align lines vertices' hubs on top of each other within a buffer.`
##### Processing algorithm :
~~~~
cn.hubsnapping
~~~~
##### Paramètres
~~~~
{
"INPUT": QgsVectorLayer, # vector layer source (TypeVectorLine)
"FIX_GEOMETRIES_BEFORE_PROCESSING": true, # repairs the input layer geometries at the start of processing
"BUFFER_HUB_SNAPPING": 1.5, # maximum hub distance between entities
"HUBPOINT_MUST_BE_AN_EXISTING_VERTEX": true, # the hub snap point is the closest vertex to the barycenter of the resulting polygon, otherwise it is the barycenter
"EXPLODE_AND_GATHER": false, # decomposes each entity into segments composed of two points at the start of processing, then brings them together at the end of processing
"ENTITY_IDENTIFICATION_FIELDS": [], # vector layer source fields to brings decomposed entities together, by default all fields are selected
"PRINT_DEBUG": false, # activates debug mode (print readable in the console)
"OUTPUT": "TEMPORARY_OUTPUT" # vector layer computed (TypeVectorLine)
}
~~~~

## Snapping layer (from another layer)
#### **SnapEndpointsToLayer()**
`Snap lines endpoints' to each other's from an other layer source.`
##### Processing algorithm :
~~~~
cn.snapendpointstoLayer
~~~~
##### Paramètres
~~~~
{
"INPUT": QgsVectorLayer, # vector layer source (TypeVectorLine)
"REF_INPUT": QgsVectorLayer, # reference vector layer source (TypeVectorLine, TypeVectorPoint)
"FIX_GEOMETRIES_BEFORE_PROCESSING": true, # repairs the input layer geometries at the start of processing
"BUFFER_ENDPOINTS_SNAPPING": 5.0, # maximum snapping distance
"PREFERRED_BEHAVIOR_FOR_STARTING_EXTREMITIES": 1, # prefered behaviour for startings enpoints :
# 'Nearest, Minimum angular variation','Farest, Minimum angular variation',
# 'Nearest, Maximum angular variation','Farest, Maximum angular variation'
"PREFERRED_BEHAVIOR_FOR_ENDING_EXTREMITIES": 0, # prefered behaviour for endings enpoints :
# 'Nearest, Minimum angular variation','Farest, Minimum angular variation',
# 'Nearest, Maximum angular variation','Farest, Maximum angular variation'
"HAUSDORFF_DISTANCE_LIMIT": 5.0, # hausdorff distance limit to avoid calculations between geometries too similar
"MIN_ANGULAR_LIMIT_OF_PARALLEL_GEOMETRIES": 0.0, # minimum angular limit difference between two geometries
"MAX_ANGULAR_LIMIT_OF_PARALLEL_GEOMETRIES": 180.0, # mximum angular limit difference between two geometries
"PREFERS_SAME_GEOMETRY_DIRECTION": true, # favors entities whose geometry has the same direction
"EXPLODE_AND_GATHER": false, # decomposes each entity into segments composed of two points at the start of processing, then brings them together at the end of processing
"ENTITY_IDENTIFICATION_FIELDS": [], # vector layer source fields to brings decomposed entities together, by default all fields are selected
"PRINT_DEBUG": false, # activates debug mode (print readable in the console)
"OUTPUT": "TEMPORARY_OUTPUT" # vector layer computed (TypeVectorLine)
}
~~~~
******
#### **SnapHubsPointsToLayer()**
`Align lines vertices' hubs on top of a point layer within a buffer.`
##### Processing algorithm :
~~~~
cn.snaphubspointstolayer
~~~~
##### Paramètres
~~~~
{
"INPUT": QgsVectorLayer, # vector layer source (TypeVectorLine)
"REF_INPUT": QgsVectorLayer, # reference vector layer source (TypeVectorLine, TypeVectorPoint)
"FIX_GEOMETRIES_BEFORE_PROCESSING": true, # repairs the input layer geometries at the start of processing
"BUFFER_HUB_SNAPPING": 1.5, # maximum hub distance between entities
"HUBPOINT_MUST_BE_AN_EXISTING_VERTEX": true, # the hub snap point is the closest vertex to the barycenter of the resulting polygon, otherwise it is the barycenter
"EXPLODE_AND_GATHER": false, # decomposes each entity into segments composed of two points at the start of processing, then brings them together at the end of processing
"ENTITY_IDENTIFICATION_FIELDS": [], # vector layer source fields to brings decomposed entities together, by default all fields are selected
"PRINT_DEBUG": false, # activates debug mode (print readable in the console)
"OUTPUT": "TEMPORARY_OUTPUT" # vector layer computed (TypeVectorLine)
}
~~~~