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 repository : https://sducournau.github.io/consolidate_networks/
Qgis plugin repository : https://plugins.qgis.org/plugins/consolidate_networks/
Apply multiple snappings steps and make the use of cn provider algorithms.
Calculate dbscan clusters of lines from a layer source.
cn.calculatedbscan
{
"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)
}
Snap lines to each other splitting by their clusters from a layer source resulted from CalculateDbscan().
cn.consolidatewithdbscan
{
"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)
}
Insert missing vertices from a source layer.
cn.makeintersectionsvertexes
{
"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)
}
Cut and extend end lines from a layer source.
cn.endpointstrimmingextending
{
"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)
}
Snap lines endpoints' to each other's from a layer source.
cn.endpointssnapping
{
"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)
}
Align lines vertices' hubs on top of each other within a buffer.
cn.hubsnapping
{
"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)
}
Snap lines endpoints' to each other's from an other layer source.
cn.snapendpointstoLayer
{
"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)
}
Align lines vertices' hubs on top of a point layer within a buffer.
cn.snaphubspointstolayer
{
"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)
}