diff --git a/doc/_static/page_history.js b/doc/_static/page_history.js index 052b17ff414..923b8187a68 100644 --- a/doc/_static/page_history.js +++ b/doc/_static/page_history.js @@ -224,7 +224,7 @@ var filesArr = [ ]), new createInfo('pgr_analyzeOneWay', '2.0', [ { v: '2.1', n: 'src/common/doc/functions/analyze_oneway'}, - { v: '2.3', n: 'src/topology/doc/pgr_analyzeOneWay'}, + { v: '2.3', n: 'src/topology/doc/pgr_analyzeOneWay'}, 3.8 ]), new createInfo('pgr_analyzeGraph', '2.0', [ { v: '2.1', n: 'src/common/doc/functions/analyze_graph'}, diff --git a/doc/topology/CMakeLists.txt b/doc/topology/CMakeLists.txt index 332f7a90bbd..d5c5cfada91 100644 --- a/doc/topology/CMakeLists.txt +++ b/doc/topology/CMakeLists.txt @@ -14,8 +14,4 @@ foreach (f ${LOCAL_FILES}) list(APPEND LOCAL_DOC_FILES ${PGR_DOCUMENTATION_SOURCE_DIR}/${f}) endforeach() - -add_subdirectory("images") set(PROJECT_DOC_FILES ${PROJECT_DOC_FILES} ${LOCAL_DOC_FILES} PARENT_SCOPE) -set(PROJECT_IMG_FILES ${PROJECT_IMG_FILES} PARENT_SCOPE) - diff --git a/doc/topology/images/CMakeLists.txt b/doc/topology/images/CMakeLists.txt deleted file mode 100644 index c8567750abf..00000000000 --- a/doc/topology/images/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ - -SET(LOCAL_FILES - after_node_net.png - before_node_net.png - ) - -foreach (f ${LOCAL_FILES}) - configure_file(${f} "${PGR_DOCUMENTATION_SOURCE_DIR}/images/${f}" COPYONLY) - list(APPEND LOCAL_IMG_FILES "${PGR_DOCUMENTATION_SOURCE_DIR}/images/${f}") -endforeach() - -set(PROJECT_IMG_FILES ${PROJECT_IMG_FILES} ${LOCAL_IMG_FILES} PARENT_SCOPE) - diff --git a/doc/topology/images/after_node_net.png b/doc/topology/images/after_node_net.png deleted file mode 100644 index ee3c8cfd19e..00000000000 Binary files a/doc/topology/images/after_node_net.png and /dev/null differ diff --git a/doc/topology/images/before_node_net.png b/doc/topology/images/before_node_net.png deleted file mode 100644 index 115eb767945..00000000000 Binary files a/doc/topology/images/before_node_net.png and /dev/null differ diff --git a/doc/topology/pgr_analyzeOneWay.rst b/doc/topology/pgr_analyzeOneWay.rst index c2d864b43f2..6ee099fe840 100644 --- a/doc/topology/pgr_analyzeOneWay.rst +++ b/doc/topology/pgr_analyzeOneWay.rst @@ -121,9 +121,8 @@ The structure of the vertices table is: :id: ``bigint`` Identifier of the vertex. :cnt: ``integer`` Number of vertices in the edge_table that reference this - vertex. See :doc:`pgr_analyzeGgraph `. -:chk: ``integer`` Indicator that the vertex might have a problem. See - :doc:`pgr_analyzeGraph `. + vertex. +:chk: ``integer`` Indicator that the vertex might have a problem. :ein: ``integer`` Number of vertices in the edge_table that reference this vertex as incoming. :eout: ``integer`` Number of vertices in the edge_table that reference this @@ -142,7 +141,6 @@ See Also ------------------------------------------------------------------------------- * :doc:`topology-functions` -* :doc:`pgr_analyzeGraph` * :doc:`pgr_createVerticesTable` * :doc:`sampledata` diff --git a/doc/topology/pgr_createTopology.rst b/doc/topology/pgr_createTopology.rst index b5c1499d99c..ba0dbbe33c3 100644 --- a/doc/topology/pgr_createTopology.rst +++ b/doc/topology/pgr_createTopology.rst @@ -104,16 +104,15 @@ The function returns: .. rubric:: The Vertices Table -The vertices table is a requirement of the :doc:`pgr_analyzeGraph` and the +The vertices table is a requirement of the :doc:`pgr_analyzeOneWay` functions. The structure of the vertices table is: :id: ``bigint`` Identifier of the vertex. :cnt: ``integer`` Number of vertices in the edge_table that reference this - vertex. See :doc:`pgr_analyzeGraph`. -:chk: ``integer`` Indicator that the vertex might have a problem. See - :doc:`pgr_analyzeGraph`. + vertex. +:chk: ``integer`` Indicator that the vertex might have a problem. :ein: ``integer`` Number of vertices in the edge_table that reference this vertex AS incoming. See :doc:`pgr_analyzeOneWay`. :eout: ``integer`` Number of vertices in the edge_table that reference this @@ -279,7 +278,6 @@ See Also * :doc:`sampledata` * :doc:`topology-functions` * :doc:`pgr_createVerticesTable` -* :doc:`pgr_analyzeGraph` .. rubric:: Indices and tables diff --git a/doc/topology/pgr_createVerticesTable.rst b/doc/topology/pgr_createVerticesTable.rst index 0ad78639cb8..08e6ade83be 100644 --- a/doc/topology/pgr_createVerticesTable.rst +++ b/doc/topology/pgr_createVerticesTable.rst @@ -91,16 +91,15 @@ The function returns: .. rubric:: The Vertices Table -The vertices table is a requirement of the :doc:`pgr_analyzeGraph` and the +The vertices table is a requirement of the :doc:`pgr_analyzeOneWay` functions. The structure of the vertices table is: :id: ``bigint`` Identifier of the vertex. :cnt: ``integer`` Number of vertices in the edge_table that reference this - vertex. See :doc:`pgr_analyzeGraph`. -:chk: ``integer`` Indicator that the vertex might have a problem. See - :doc:`pgr_analyzeGraph`. + vertex. +:chk: ``integer`` Indicator that the vertex might have a problem. :ein: ``integer`` Number of vertices in the edge_table that reference this vertex as incoming. See :doc:`pgr_analyzeOneWay`. :eout: ``integer`` Number of vertices in the edge_table that reference this @@ -284,7 +283,6 @@ See Also algorithms. * :doc:`pgr_createTopology` ` to create a topology based on the geometry. -* :doc:`pgr_analyzeGraph` to analyze the edges and vertices of the edge table. * :doc:`pgr_analyzeOneWay` to analyze directionality of the edges. .. rubric:: Indices and tables diff --git a/doc/topology/pgr_nodeNetwork.rst b/doc/topology/pgr_nodeNetwork.rst index 2ded2fa5d68..5ef72bc09bb 100644 --- a/doc/topology/pgr_nodeNetwork.rst +++ b/doc/topology/pgr_nodeNetwork.rst @@ -87,135 +87,148 @@ The output table will have for ``edge_table_noded`` Examples ------------------------------------------------------------------------------- -Let's create the topology for the data in :doc:`sampledata` +Create the topology for the data in :doc:`sampledata` + +.. literalinclude:: sampledata.queries + :start-after: -- q1 + :end-before: -- q1-1 + +.. literalinclude:: sampledata.queries + :start-after: -- q3 + :end-before: -- q4 + +Analyze the network for intersections. .. literalinclude:: nodeNetwork.queries :start-after: --q1 - :end-before: --q1.1 + :end-before: --q2 -Now we can analyze the network. +Analyze the network for gaps. .. literalinclude:: nodeNetwork.queries :start-after: --q2 - :end-before: --q2.1 + :end-before: --q3 + +The analysis tell us that the network has a gap and an intersection. + +Fixing an intersection +............................................................................... -The analysis tell us that the network has a gap and an intersection. We try to -fix the problem using: +Storing the intersections. .. literalinclude:: nodeNetwork.queries :start-after: --q3 - :end-before: --q3.1 + :end-before: --q4 -Inspecting the generated table, we can see that edges 13,14 and 18 has been -segmented +Calling ``pgr_nodeNetwork``. .. literalinclude:: nodeNetwork.queries :start-after: --q4 - :end-before: --q4.1 + :end-before: --q5 -We can create the topology of the new network +Inspecting the generated table, we can see that edges 13 and 18 have been +segmented. .. literalinclude:: nodeNetwork.queries :start-after: --q5 - :end-before: --q5.1 + :end-before: --q6 -Now let's analyze the new topology +.. rubric:: Update the topology + +Add new segments to the edges table. .. literalinclude:: nodeNetwork.queries :start-after: --q6 - :end-before: --q6.1 + :end-before: --q7 -Images -------------------------------------------------------------------------------- +Insert the intersection as new vertices. -.. Rubric:: Before Image +.. literalinclude:: nodeNetwork.queries + :start-after: --q7 + :end-before: --q8 -.. image:: images/before_node_net.png - :scale: 60% - :alt: Before image - :align: left +Update source and target information on the edges table. +.. literalinclude:: nodeNetwork.queries + :start-after: --q8 + :end-before: --q9 -.. Rubric:: After Image +Delete original edge. -.. image:: images/after_node_net.png - :scale: 60% - :alt: After image - :align: left +.. literalinclude:: nodeNetwork.queries + :start-after: --q9 + :end-before: --q10 +Update the vertex topology -Comparing the results -------------------------------------------------------------------------------- +.. literalinclude:: nodeNetwork.queries + :start-after: --q10 + :end-before: --q11 -Comparing with the Analysis in the original edge_table, we see that. - -+------------------+-----------------------------------------+--------------------------------------------------------------+ -| | Before | After | -+==================+=========================================+==============================================================+ -|Table name | edge_table | edge_table_noded | -+------------------+-----------------------------------------+--------------------------------------------------------------+ -|Fields | All original fields | Has only basic fields to do a topology analysis | -+------------------+-----------------------------------------+--------------------------------------------------------------+ -|Dead ends | - Edges with 1 dead end: 1,6,24 | Edges with 1 dead end: 1-1 ,6-1,14-2, 18-1 17-1 18-2 | -| | - Edges with 2 dead ends: 17,18 | | -| | | | -| | Edge 17's right node is a dead end | | -| | because there is no other edge sharing | | -| | that same node. (cnt=1) | | -+------------------+-----------------------------------------+--------------------------------------------------------------+ -|Isolated segments | two isolated segments: 17 and 18 both | No Isolated segments | -| | they have 2 dead ends | - Edge 17 now shares a node with edges 14-1 and 14-2 | -| | | - Edges 18-1 and 18-2 share a node with edges 13-1 and 13-2 | -+------------------+-----------------------------------------+--------------------------------------------------------------+ -|Gaps | There is a gap between edge 17 and 14 | Edge 14 was segmented | -| | because edge 14 is near to the right | Now edges: 14-1 14-2 17 share the same node | -| | node of edge 17 | The tolerance value was taken in account | -+------------------+-----------------------------------------+--------------------------------------------------------------+ -|Intersections | Edges 13 and 18 were intersecting | Edges were segmented, So, now in the interection's | -| | | point there is a node and the following edges share it: | -| | | 13-1 13-2 18-1 18-2 | -+------------------+-----------------------------------------+--------------------------------------------------------------+ - - -Now, we are going to include the segments 13-1, 13-2 14-1, 14-2 ,18-1 and 18-2 -into our edge-table, copying the data for dir,cost,and reverse cost with tho -following steps: - -- Add a column old_id into edge_table, this column is going to keep track the id - of the original edge -- Insert only the segmented edges, that is, the ones whose max(sub_id) >1 +Analyze the network for intersections. .. literalinclude:: nodeNetwork.queries - :start-after: --q7 - :end-before: --q7.1 + :start-after: --q11 + :end-before: --q12 -We recreate the topology: +Fixing a gap +............................................................................... + +Store the deadends .. literalinclude:: nodeNetwork.queries - :start-after: --q8 - :end-before: --q8.1 + :start-after: --q12 + :end-before: --q13 -To get the same analysis results as the topology of edge_table_noded, we do the -following query: +Calling ``pgr_nodeNetwork``. .. literalinclude:: nodeNetwork.queries - :start-after: --q9 - :end-before: --q9.1 + :start-after: --q13 + :end-before: --q14 -To get the same analysis results as the original edge_table, we do the following -query: +Inspecting the generated table, we can see that edge 14 has been segmented. .. literalinclude:: nodeNetwork.queries - :start-after: --q10 - :end-before: --q10.1 + :start-after: --q14 + :end-before: --q15 + +.. rubric:: Update the topology -Or we can analyze everything because, maybe edge 18 is an overpass, edge 14 is -an under pass and there is also a street level juction, and the same happens -with edges 17 and 13. +Add new segments to the edges table. .. literalinclude:: nodeNetwork.queries - :start-after: --q11 - :end-before: --q11.1 + :start-after: --q15 + :end-before: --q16 + +Insert the intersection as new vertices. + +.. literalinclude:: nodeNetwork.queries + :start-after: --q16 + :end-before: --q17 + +Update source and target information on the edges table. + +.. literalinclude:: nodeNetwork.queries + :start-after: --q17 + :end-before: --q18 + +Delete original edge. + +.. literalinclude:: nodeNetwork.queries + :start-after: --q18 + :end-before: --q19 + +Update the vertex topology + +.. literalinclude:: nodeNetwork.queries + :start-after: --q19 + :end-before: --q20 + +Analyze the network for gaps. + +.. literalinclude:: nodeNetwork.queries + :start-after: --q20 + :end-before: --q21 See Also ------------------------------------------------------------------------------- @@ -223,7 +236,6 @@ See Also :doc:`topology-functions` for an overview of a topology for routing algorithms. :doc:`pgr_analyzeOneWay` to analyze directionality of the edges. :doc:`pgr_createTopology` to create a topology based on the geometry. -:doc:`pgr_analyzeGraph` to analyze the edges and vertices of the edge table. .. rubric:: Indices and tables diff --git a/docqueries/topology/nodeNetwork.pg b/docqueries/topology/nodeNetwork.pg index 41910e743f3..7b0cc7d8425 100644 --- a/docqueries/topology/nodeNetwork.pg +++ b/docqueries/topology/nodeNetwork.pg @@ -2,54 +2,143 @@ -- Creative Commons Attribution-Share Alike 3.0 License : https://creativecommons.org/licenses/by-sa/3.0/ -- pgr_nodeNetwork -------------------------------------------------------------------------------- - +--SET client_min_messages TO DEBUG; /* --q1 */ -SELECT pgr_createTopology('edges', 0.001, 'geom', clean := TRUE); -/* --q1.1 */ - +SELECT e1.id id1, e2.id id2, ST_ASTEXT(ST_Intersection(e1.geom, e2.geom)) AS point +FROM edges e1, edges e2 +WHERE e1.id < e2.id AND ST_Crosses(e1.geom, e2.geom); /* --q2 */ -SELECT pgr_analyzegraph('edges', 0.001, 'geom'); -/* --q2.1 */ - +WITH +data AS ( + SELECT id, geom, (in_edges || out_edges)[1] as inhere + FROM vertices where array_length(in_edges || out_edges, 1) = 1 +), +results AS ( + SELECT d.id, d.inhere, + (pgr_findCloseEdges('SELECT id, geom FROM edges WHERE id != ' || inhere , geom, 0.001)).* + FROM data d +) +SELECT + id, inhere, edge_id, fraction, + ST_AsText(geom) AS geom, ST_AsText(edge) AS edge +FROM results; /* --q3 */ -SELECT pgr_nodeNetwork('edges', 0.001, the_geom => 'geom'); -/* --q3.1 */ - +SELECT e1.id id1, e2.id id2, st_intersection(e1.geom, e2.geom) AS point +INTO intersections +FROM edges e1, edges e2 +WHERE e1.id < e2.id AND st_crosses(e1.geom, e2.geom); /* --q4 */ -SELECT old_id, sub_id FROM edges_noded ORDER BY old_id, sub_id; -/* --q4.1 */ - +SELECT pgr_nodeNetwork('edges', 0.001, the_geom => 'geom', rows_where=>'id in ('||id1||','||id2||')') +FROM intersections; /* --q5 */ -SELECT pgr_createTopology('edges_noded', 0.001, 'geom'); -/* --q5.1 */ - +SELECT old_id, ST_AsText(geom) FROM edges_noded ORDER BY old_id, sub_id; /* --q6 */ -SELECT pgr_analyzegraph('edges_noded', 0.001, 'geom'); -/* --q6.1 */ - +INSERT INTO edges (cost, reverse_cost, geom) +WITH +the_fractions AS ( + SELECT e1.id id, st_lineLocatePoint(e1.geom, point) AS fraction + FROM intersections, edges e1, edges e2 WHERE e1.id = id1 AND e2.id = id2 + UNION + SELECT e2.id, st_lineLocatePoint(e2.geom, point) + FROM intersections, edges e1, edges e2 WHERE e1.id = id1 AND e2.id = id2 +) +SELECT + CASE WHEN sub_id = 1 + THEN cost*fraction ELSE cost*(1-fraction) END as cost, + CASE WHEN sub_id = 1 + THEN reverse_cost*(1-fraction) ELSE reverse_cost*(fraction) END AS reverse_cost, + segments.geom +FROM edges as edges +JOIN edges_noded as segments ON (edges.id = segments.old_id) +JOIN the_fractions f ON (segments.old_id = f.id); /* --q7 */ -alter table edges drop column if exists old_id; -alter table edges add column old_id integer; -insert into edges (old_id, cost, reverse_cost, geom) - (with - segmented as (select old_id,count(*) as i from edges_noded group by old_id) - select segments.old_id, cost, reverse_cost, segments.geom - from edges as edges join edges_noded as segments on (edges.id = segments.old_id) - where edges.id in (select old_id from segmented where i>1) ); -/* --q7.1 */ - +INSERT INTO vertices (id, geom) +SELECT row_number() over() + 100, point +FROM intersections; /* --q8 */ -SELECT pgr_createTopology('edges', 0.001, 'geom'); -/* --q8.1 */ +UPDATE edges e SET source = v.id FROM +vertices v where source IS NULL AND (st_startPoint(e.geom) = v.geom); +UPDATE edges e SET target = v.id FROM +vertices v where target IS NULL AND (st_endPoint(e.geom) = v.geom); /* --q9 */ -SELECT pgr_analyzegraph('edges', 0.001, 'geom', rows_where:='id not in (select old_id from edges where old_id is not null)'); -/* --q9.1 */ - +DELETE FROM edges +WHERE id IN ( + SELECT id1 FROM intersections + UNION + SELECT id2 FROM intersections); /* --q10 */ -SELECT pgr_analyzegraph('edges', 0.001, 'geom', rows_where:='old_id is null'); -/* --q10.1 */ +WITH data AS ( + select p.id, p.in_edges, p.out_edges + FROM pgr_extractVertices('select id, source, target from edges') p) +UPDATE vertices v +SET (in_edges,out_edges) = (d.in_edges,d.out_edges) +FROM data d where d.id = v.id; /* --q11 */ -SELECT pgr_analyzegraph('edges', 0.001, 'geom'); -/* --q11.1 */ +SELECT e1.id, e2.id +FROM edges_noded e1, edges e2 +WHERE e1.id < e2.id AND st_crosses(e1.geom, e2.geom); + +/* --q12 */ +WITH +data AS ( + SELECT id, geom, (in_edges || out_edges)[1] as inhere + FROM vertices where array_length(in_edges || out_edges, 1) = 1) +SELECT + d.id, d.inhere, + (pgr_findCloseEdges('SELECT id, geom FROM edges WHERE id != ' || inhere , geom, 0.001)).* +INTO deadends +FROM data d; +/* --q13 */ +SELECT pgr_nodeNetwork('edges', 0.001, the_geom => 'geom', rows_where=>'id in ('||inhere||','||edge_id||')') +FROM deadends; + +/* --q14 */ +SELECT old_id, ST_AsText(geom) FROM edges_noded ORDER BY old_id, sub_id; + +/* --q15 */ +INSERT INTO edges (cost, reverse_cost, geom) +SELECT + CASE WHEN sub_id = 1 THEN cost*fraction ELSE cost*(1-fraction) END as cost, + CASE WHEN sub_id = 1 THEN reverse_cost*(1-fraction) ELSE reverse_cost*(fraction) END as reverse_cost, en.geom +FROM deadends r JOIN edges_noded en ON (old_id = edge_id) JOIN edges e ON (old_id = e.id) +UNION +SELECT 0,0,edge FROM deadends; + + +/* --q16 */ +/* Update the vertices table */ +INSERT INTO vertices (id, geom) +select row_number() over() + 200, st_endpoint(edge) FROM deadends; + +/* --q17 */ +UPDATE edges e SET source = v.id FROM +vertices v where source IS NULL AND (st_startPoint(e.geom) = v.geom); + +UPDATE edges e SET target = v.id FROM +vertices v where target IS NULL AND (st_endPoint(e.geom) = v.geom); + +/* --q18 */ +DELETE FROM edges WHERE id IN (SELECT edge_id FROM deadends); + +/* --q19 */ +WITH data AS ( + select p.id, p.in_edges, p.out_edges + FROM pgr_extractVertices('select id, source, target from edges') p) +UPDATE vertices v +SET (in_edges,out_edges) = (d.in_edges,d.out_edges) +FROM data d where d.id = v.id; +/* --q20 */ +WITH +data AS ( + SELECT id, geom, (in_edges || out_edges)[1] as inhere + FROM vertices where array_length(in_edges || out_edges, 1) = 1), +results AS ( + SELECT (pgr_findCloseEdges( + 'SELECT id, geom FROM edges WHERE id != ' || inhere , geom, 0.001)).*, + d.id, d.inhere + FROM data d +) +SELECT * FROM results; +/* --q21 */ diff --git a/docqueries/topology/nodeNetwork.result b/docqueries/topology/nodeNetwork.result index 3e972e0fbde..111b514347e 100644 --- a/docqueries/topology/nodeNetwork.result +++ b/docqueries/topology/nodeNetwork.result @@ -3,61 +3,58 @@ BEGIN SET client_min_messages TO NOTICE; SET /* --q1 */ -SELECT pgr_createTopology('edges', 0.001, 'geom', clean := TRUE); -NOTICE: PROCESSING: -NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := t) -NOTICE: Performing checks, please wait ..... -NOTICE: Creating Topology, Please wait... -NOTICE: -------------> TOPOLOGY CREATED FOR 18 edges -NOTICE: Rows with NULL geometry or NULL id: 0 -NOTICE: Vertices table for table public.edges is: public.edges_vertices_pgr -NOTICE: ---------------------------------------------- - pgr_createtopology --------------------- - OK +SELECT e1.id id1, e2.id id2, ST_ASTEXT(ST_Intersection(e1.geom, e2.geom)) AS point +FROM edges e1, edges e2 +WHERE e1.id < e2.id AND ST_Crosses(e1.geom, e2.geom); + id1 | id2 | point +-----+-----+-------------- + 13 | 18 | POINT(3.5 3) (1 row) -/* --q1.1 */ /* --q2 */ -SELECT pgr_analyzegraph('edges', 0.001, 'geom'); -WARNING: pgr_analyzegraph(text,double precision,text,text,text,text,text) deprecated function on v3.8.0 -NOTICE: PROCESSING: -NOTICE: pgr_analyzeGraph('edges',0.001,'geom','id','source','target','true') -NOTICE: Performing checks, please wait ... -NOTICE: Analyzing for dead ends. Please wait... -NOTICE: Analyzing for gaps. Please wait... -NOTICE: Analyzing for isolated edges. Please wait... -NOTICE: Analyzing for ring geometries. Please wait... -NOTICE: Analyzing for intersections. Please wait... -NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES: -NOTICE: Isolated segments: 2 -NOTICE: Dead ends: 7 -NOTICE: Potential gaps found near dead ends: 1 -NOTICE: Intersections detected: 1 -NOTICE: Ring geometries: 0 - pgr_analyzegraph ------------------- - OK +WITH +data AS ( + SELECT id, geom, (in_edges || out_edges)[1] as inhere + FROM vertices where array_length(in_edges || out_edges, 1) = 1 +), +results AS ( + SELECT d.id, d.inhere, + (pgr_findCloseEdges('SELECT id, geom FROM edges WHERE id != ' || inhere , geom, 0.001)).* + FROM data d +) +SELECT + id, inhere, edge_id, fraction, + ST_AsText(geom) AS geom, ST_AsText(edge) AS edge +FROM results; + id | inhere | edge_id | fraction | geom | edge +----+--------+---------+----------+---------------------------+-------------------------------------- + 4 | 17 | 14 | 0.5 | POINT(1.999999999999 3.5) | LINESTRING(1.999999999999 3.5,2 3.5) (1 row) -/* --q2.1 */ /* --q3 */ -SELECT pgr_nodeNetwork('edges', 0.001, the_geom => 'geom'); +SELECT e1.id id1, e2.id id2, st_intersection(e1.geom, e2.geom) AS point +INTO intersections +FROM edges e1, edges e2 +WHERE e1.id < e2.id AND st_crosses(e1.geom, e2.geom); +SELECT 1 +/* --q4 */ +SELECT pgr_nodeNetwork('edges', 0.001, the_geom => 'geom', rows_where=>'id in ('||id1||','||id2||')') +FROM intersections; NOTICE: PROCESSING: NOTICE: id: id NOTICE: the_geom: geom NOTICE: table_ending: noded -NOTICE: rows_where: +NOTICE: rows_where: id in (13,18) NOTICE: outall: f -NOTICE: pgr_nodeNetwork('edges', 0.001, 'id', 'geom', 'noded', '', f) +NOTICE: pgr_nodeNetwork('edges', 0.001, 'id', 'geom', 'noded', 'id in (13,18)', f) NOTICE: Performing checks, please wait ..... NOTICE: Processing, please wait ..... -NOTICE: Split Edges: 3 -NOTICE: Untouched Edges: 15 -NOTICE: Total original Edges: 18 -NOTICE: Edges generated: 6 -NOTICE: Untouched Edges: 15 -NOTICE: Total New segments: 21 +NOTICE: Split Edges: 2 +NOTICE: Untouched Edges: 0 +NOTICE: Total original Edges: 2 +NOTICE: Edges generated: 4 +NOTICE: Untouched Edges: 0 +NOTICE: Total New segments: 4 NOTICE: New Table: public.edges_noded NOTICE: ---------------------------------- pgr_nodenetwork @@ -65,172 +62,164 @@ NOTICE: ---------------------------------- OK (1 row) -/* --q3.1 */ -/* --q4 */ -SELECT old_id, sub_id FROM edges_noded ORDER BY old_id, sub_id; - old_id | sub_id ---------+-------- - 1 | 1 - 2 | 1 - 3 | 1 - 4 | 1 - 5 | 1 - 6 | 1 - 7 | 1 - 8 | 1 - 9 | 1 - 10 | 1 - 11 | 1 - 12 | 1 - 13 | 1 - 13 | 2 - 14 | 1 - 14 | 2 - 15 | 1 - 16 | 1 - 17 | 1 - 18 | 1 - 18 | 2 -(21 rows) - -/* --q4.1 */ /* --q5 */ -SELECT pgr_createTopology('edges_noded', 0.001, 'geom'); -NOTICE: PROCESSING: -NOTICE: pgr_createTopology('edges_noded', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := f) -NOTICE: Performing checks, please wait ..... -NOTICE: Creating Topology, Please wait... -NOTICE: -------------> TOPOLOGY CREATED FOR 21 edges -NOTICE: Rows with NULL geometry or NULL id: 0 -NOTICE: Vertices table for table public.edges_noded is: public.edges_noded_vertices_pgr -NOTICE: ---------------------------------------------- - pgr_createtopology --------------------- - OK -(1 row) +SELECT old_id, ST_AsText(geom) FROM edges_noded ORDER BY old_id, sub_id; + old_id | st_astext +--------+--------------------------- + 13 | LINESTRING(3 3,3.5 3) + 13 | LINESTRING(3.5 3,4 3) + 18 | LINESTRING(3.5 2.3,3.5 3) + 18 | LINESTRING(3.5 3,3.5 4) +(4 rows) -/* --q5.1 */ /* --q6 */ -SELECT pgr_analyzegraph('edges_noded', 0.001, 'geom'); -WARNING: pgr_analyzegraph(text,double precision,text,text,text,text,text) deprecated function on v3.8.0 -NOTICE: PROCESSING: -NOTICE: pgr_analyzeGraph('edges_noded',0.001,'geom','id','source','target','true') -NOTICE: Performing checks, please wait ... -NOTICE: Analyzing for dead ends. Please wait... -NOTICE: Analyzing for gaps. Please wait... -NOTICE: Analyzing for isolated edges. Please wait... -NOTICE: Analyzing for ring geometries. Please wait... -NOTICE: Analyzing for intersections. Please wait... -NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES: -NOTICE: Isolated segments: 0 -NOTICE: Dead ends: 6 -NOTICE: Potential gaps found near dead ends: 0 -NOTICE: Intersections detected: 0 -NOTICE: Ring geometries: 0 - pgr_analyzegraph ------------------- - OK -(1 row) - -/* --q6.1 */ +INSERT INTO edges (cost, reverse_cost, geom) +WITH +the_fractions AS ( + SELECT e1.id id, st_lineLocatePoint(e1.geom, point) AS fraction + FROM intersections, edges e1, edges e2 WHERE e1.id = id1 AND e2.id = id2 + UNION + SELECT e2.id, st_lineLocatePoint(e2.geom, point) + FROM intersections, edges e1, edges e2 WHERE e1.id = id1 AND e2.id = id2 +) +SELECT + CASE WHEN sub_id = 1 + THEN cost*fraction ELSE cost*(1-fraction) END as cost, + CASE WHEN sub_id = 1 + THEN reverse_cost*(1-fraction) ELSE reverse_cost*(fraction) END AS reverse_cost, + segments.geom +FROM edges as edges +JOIN edges_noded as segments ON (edges.id = segments.old_id) +JOIN the_fractions f ON (segments.old_id = f.id); +INSERT 0 4 /* --q7 */ -alter table edges drop column if exists old_id; -NOTICE: column "old_id" of relation "edges" does not exist, skipping -ALTER TABLE -alter table edges add column old_id integer; -ALTER TABLE -insert into edges (old_id, cost, reverse_cost, geom) - (with - segmented as (select old_id,count(*) as i from edges_noded group by old_id) - select segments.old_id, cost, reverse_cost, segments.geom - from edges as edges join edges_noded as segments on (edges.id = segments.old_id) - where edges.id in (select old_id from segmented where i>1) ); -INSERT 0 6 -/* --q7.1 */ +INSERT INTO vertices (id, geom) +SELECT row_number() over() + 100, point +FROM intersections; +INSERT 0 1 /* --q8 */ -SELECT pgr_createTopology('edges', 0.001, 'geom'); -NOTICE: PROCESSING: -NOTICE: pgr_createTopology('edges', 0.001, 'geom', 'id', 'source', 'target', rows_where := 'true', clean := f) -NOTICE: Performing checks, please wait ..... -NOTICE: Creating Topology, Please wait... -NOTICE: -------------> TOPOLOGY CREATED FOR 6 edges -NOTICE: Rows with NULL geometry or NULL id: 0 -NOTICE: Vertices table for table public.edges is: public.edges_vertices_pgr -NOTICE: ---------------------------------------------- - pgr_createtopology --------------------- - OK -(1 row) - -/* --q8.1 */ +UPDATE edges e SET source = v.id FROM +vertices v where source IS NULL AND (st_startPoint(e.geom) = v.geom); +UPDATE 4 +UPDATE edges e SET target = v.id FROM +vertices v where target IS NULL AND (st_endPoint(e.geom) = v.geom); +UPDATE 4 /* --q9 */ -SELECT pgr_analyzegraph('edges', 0.001, 'geom', rows_where:='id not in (select old_id from edges where old_id is not null)'); -WARNING: pgr_analyzegraph(text,double precision,text,text,text,text,text) deprecated function on v3.8.0 -NOTICE: PROCESSING: -NOTICE: pgr_analyzeGraph('edges',0.001,'geom','id','source','target','id not in (select old_id from edges where old_id is not null)') -NOTICE: Performing checks, please wait ... -NOTICE: Analyzing for dead ends. Please wait... -NOTICE: Analyzing for gaps. Please wait... -NOTICE: Analyzing for isolated edges. Please wait... -NOTICE: Analyzing for ring geometries. Please wait... -NOTICE: Analyzing for intersections. Please wait... -NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES: -NOTICE: Isolated segments: 0 -NOTICE: Dead ends: 6 -NOTICE: Potential gaps found near dead ends: 0 -NOTICE: Intersections detected: 0 -NOTICE: Ring geometries: 0 - pgr_analyzegraph ------------------- - OK -(1 row) - -/* --q9.1 */ +DELETE FROM edges +WHERE id IN ( + SELECT id1 FROM intersections + UNION + SELECT id2 FROM intersections); +DELETE 2 /* --q10 */ -SELECT pgr_analyzegraph('edges', 0.001, 'geom', rows_where:='old_id is null'); -WARNING: pgr_analyzegraph(text,double precision,text,text,text,text,text) deprecated function on v3.8.0 -NOTICE: PROCESSING: -NOTICE: pgr_analyzeGraph('edges',0.001,'geom','id','source','target','old_id is null') -NOTICE: Performing checks, please wait ... -NOTICE: Analyzing for dead ends. Please wait... -NOTICE: Analyzing for gaps. Please wait... -NOTICE: Analyzing for isolated edges. Please wait... -NOTICE: Analyzing for ring geometries. Please wait... -NOTICE: Analyzing for intersections. Please wait... -NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES: -NOTICE: Isolated segments: 2 -NOTICE: Dead ends: 7 -NOTICE: Potential gaps found near dead ends: 1 -NOTICE: Intersections detected: 1 -NOTICE: Ring geometries: 0 - pgr_analyzegraph ------------------- - OK -(1 row) - -/* --q10.1 */ +WITH data AS ( + select p.id, p.in_edges, p.out_edges + FROM pgr_extractVertices('select id, source, target from edges') p) +UPDATE vertices v +SET (in_edges,out_edges) = (d.in_edges,d.out_edges) +FROM data d where d.id = v.id; +UPDATE 18 /* --q11 */ -SELECT pgr_analyzegraph('edges', 0.001, 'geom'); -WARNING: pgr_analyzegraph(text,double precision,text,text,text,text,text) deprecated function on v3.8.0 +SELECT e1.id, e2.id +FROM edges_noded e1, edges e2 +WHERE e1.id < e2.id AND st_crosses(e1.geom, e2.geom); + id | id +----+---- +(0 rows) + +/* --q12 */ +WITH +data AS ( + SELECT id, geom, (in_edges || out_edges)[1] as inhere + FROM vertices where array_length(in_edges || out_edges, 1) = 1) +SELECT + d.id, d.inhere, + (pgr_findCloseEdges('SELECT id, geom FROM edges WHERE id != ' || inhere , geom, 0.001)).* +INTO deadends +FROM data d; +SELECT 1 +/* --q13 */ +SELECT pgr_nodeNetwork('edges', 0.001, the_geom => 'geom', rows_where=>'id in ('||inhere||','||edge_id||')') +FROM deadends; NOTICE: PROCESSING: -NOTICE: pgr_analyzeGraph('edges',0.001,'geom','id','source','target','true') -NOTICE: Performing checks, please wait ... -NOTICE: Analyzing for dead ends. Please wait... -NOTICE: Analyzing for gaps. Please wait... -NOTICE: Analyzing for isolated edges. Please wait... -NOTICE: Analyzing for ring geometries. Please wait... -NOTICE: Analyzing for intersections. Please wait... -NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES: -NOTICE: Isolated segments: 0 -NOTICE: Dead ends: 3 -NOTICE: Potential gaps found near dead ends: 0 -NOTICE: Intersections detected: 5 -NOTICE: Ring geometries: 0 - pgr_analyzegraph ------------------- +NOTICE: id: id +NOTICE: the_geom: geom +NOTICE: table_ending: noded +NOTICE: rows_where: id in (17,14) +NOTICE: outall: f +NOTICE: pgr_nodeNetwork('edges', 0.001, 'id', 'geom', 'noded', 'id in (17,14)', f) +NOTICE: Performing checks, please wait ..... +NOTICE: Processing, please wait ..... +NOTICE: Split Edges: 1 +NOTICE: Untouched Edges: 1 +NOTICE: Total original Edges: 2 +NOTICE: Edges generated: 2 +NOTICE: Untouched Edges: 1 +NOTICE: Total New segments: 3 +NOTICE: New Table: public.edges_noded +NOTICE: ---------------------------------- + pgr_nodenetwork +----------------- OK (1 row) -/* --q11.1 */ +/* --q14 */ +SELECT old_id, ST_AsText(geom) FROM edges_noded ORDER BY old_id, sub_id; + old_id | st_astext +--------+---------------------------------------- + 14 | LINESTRING(2 3,2 3.5) + 14 | LINESTRING(2 3.5,2 4) + 17 | LINESTRING(0.5 3.5,1.999999999999 3.5) +(3 rows) + +/* --q15 */ +INSERT INTO edges (cost, reverse_cost, geom) +SELECT + CASE WHEN sub_id = 1 THEN cost*fraction ELSE cost*(1-fraction) END as cost, + CASE WHEN sub_id = 1 THEN reverse_cost*(1-fraction) ELSE reverse_cost*(fraction) END as reverse_cost, en.geom +FROM deadends r JOIN edges_noded en ON (old_id = edge_id) JOIN edges e ON (old_id = e.id) +UNION +SELECT 0,0,edge FROM deadends; +INSERT 0 3 +/* --q16 */ +/* Update the vertices table */ +INSERT INTO vertices (id, geom) +select row_number() over() + 200, st_endpoint(edge) FROM deadends; +INSERT 0 1 +/* --q17 */ +UPDATE edges e SET source = v.id FROM +vertices v where source IS NULL AND (st_startPoint(e.geom) = v.geom); +UPDATE 3 +UPDATE edges e SET target = v.id FROM +vertices v where target IS NULL AND (st_endPoint(e.geom) = v.geom); +UPDATE 3 +/* --q18 */ +DELETE FROM edges WHERE id IN (SELECT edge_id FROM deadends); +DELETE 1 +/* --q19 */ +WITH data AS ( + select p.id, p.in_edges, p.out_edges + FROM pgr_extractVertices('select id, source, target from edges') p) +UPDATE vertices v +SET (in_edges,out_edges) = (d.in_edges,d.out_edges) +FROM data d where d.id = v.id; +UPDATE 19 +/* --q20 */ +WITH +data AS ( + SELECT id, geom, (in_edges || out_edges)[1] as inhere + FROM vertices where array_length(in_edges || out_edges, 1) = 1), +results AS ( + SELECT (pgr_findCloseEdges( + 'SELECT id, geom FROM edges WHERE id != ' || inhere , geom, 0.001)).*, + d.id, d.inhere + FROM data d +) +SELECT * FROM results; + edge_id | fraction | side | distance | geom | edge | id | inhere +---------+----------+------+----------+------+------+----+-------- +(0 rows) + +/* --q21 */ ROLLBACK; ROLLBACK diff --git a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po index 6ce1c1f124c..b6f7d8a08a5 100644 --- a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po +++ b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v3.8\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-04 16:10+0000\n" +"POT-Creation-Date: 2025-04-05 01:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -8249,16 +8249,6 @@ msgid "" ":doc:`pgr_createTopology`" msgstr "" -msgid "" -"``integer`` Number of vertices in the edge_table that reference this " -"vertex. See :doc:`pgr_analyzeGgraph `." -msgstr "" - -msgid "" -"``integer`` Indicator that the vertex might have a problem. See " -":doc:`pgr_analyzeGraph `." -msgstr "" - msgid "" "``integer`` Number of vertices in the edge_table that reference this " "vertex as incoming." @@ -8269,9 +8259,6 @@ msgid "" "vertex as outgoing." msgstr "" -msgid ":doc:`pgr_analyzeGraph`" -msgstr "" - msgid "``pgr_articulationPoints``" msgstr "" @@ -10008,18 +9995,8 @@ msgid "``FAIL`` when the network topology was not built due to an error:" msgstr "" msgid "" -"The vertices table is a requirement of the :doc:`pgr_analyzeGraph` and " -"the :doc:`pgr_analyzeOneWay` functions." -msgstr "" - -msgid "" -"``integer`` Number of vertices in the edge_table that reference this " -"vertex. See :doc:`pgr_analyzeGraph`." -msgstr "" - -msgid "" -"``integer`` Indicator that the vertex might have a problem. See " -":doc:`pgr_analyzeGraph`." +"The vertices table is a requirement of the :doc:`pgr_analyzeOneWay` " +"functions." msgstr "" msgid "" @@ -10282,11 +10259,6 @@ msgid "" "based on the geometry." msgstr "" -msgid "" -":doc:`pgr_analyzeGraph` to analyze the edges and vertices of the edge " -"table." -msgstr "" - msgid ":doc:`pgr_analyzeOneWay` to analyze directionality of the edges." msgstr "" @@ -13429,162 +13401,66 @@ msgstr "" msgid "Examples" msgstr "" -msgid "Let's create the topology for the data in :doc:`sampledata`" +msgid "Create the topology for the data in :doc:`sampledata`" msgstr "" -msgid "Now we can analyze the network." +msgid "Analyze the network for intersections." msgstr "" -msgid "" -"The analysis tell us that the network has a gap and an intersection. We " -"try to fix the problem using:" +msgid "Analyze the network for gaps." msgstr "" -msgid "" -"Inspecting the generated table, we can see that edges 13,14 and 18 has " -"been segmented" -msgstr "" - -msgid "We can create the topology of the new network" +msgid "The analysis tell us that the network has a gap and an intersection." msgstr "" -msgid "Now let's analyze the new topology" -msgstr "" - -msgid "Images" +msgid "Fixing an intersection" msgstr "" -msgid "Before Image" +msgid "Storing the intersections." msgstr "" -msgid "Before image" -msgstr "" - -msgid "After Image" -msgstr "" - -msgid "After image" -msgstr "" - -msgid "Comparing the results" -msgstr "" - -msgid "Comparing with the Analysis in the original edge_table, we see that." -msgstr "" - -msgid "Before" -msgstr "" - -msgid "After" -msgstr "" - -msgid "Table name" -msgstr "" - -msgid "edge_table_noded" -msgstr "" - -msgid "Fields" -msgstr "" - -msgid "All original fields" -msgstr "" - -msgid "Has only basic fields to do a topology analysis" -msgstr "" - -msgid "Edges with 1 dead end: 1,6,24" -msgstr "" - -msgid "Edges with 2 dead ends: 17,18" -msgstr "" - -msgid "" -"Edge 17's right node is a dead end because there is no other edge sharing" -" that same node. (cnt=1)" -msgstr "" - -msgid "Edges with 1 dead end: 1-1 ,6-1,14-2, 18-1 17-1 18-2" -msgstr "" - -msgid "Isolated segments" -msgstr "" - -msgid "two isolated segments: 17 and 18 both they have 2 dead ends" -msgstr "" - -msgid "No Isolated segments" -msgstr "" - -msgid "Edge 17 now shares a node with edges 14-1 and 14-2" -msgstr "" - -msgid "Edges 18-1 and 18-2 share a node with edges 13-1 and 13-2" -msgstr "" - -msgid "Gaps" +msgid "Calling ``pgr_nodeNetwork``." msgstr "" msgid "" -"There is a gap between edge 17 and 14 because edge 14 is near to the " -"right node of edge 17" +"Inspecting the generated table, we can see that edges 13 and 18 have been" +" segmented." msgstr "" -msgid "" -"Edge 14 was segmented Now edges: 14-1 14-2 17 share the same node The " -"tolerance value was taken in account" +msgid "Update the topology" msgstr "" -msgid "Intersections" +msgid "Add new segments to the edges table." msgstr "" -msgid "Edges 13 and 18 were intersecting" +msgid "Insert the intersection as new vertices." msgstr "" -msgid "" -"Edges were segmented, So, now in the interection's point there is a node " -"and the following edges share it: 13-1 13-2 18-1 18-2" +msgid "Update source and target information on the edges table." msgstr "" -msgid "" -"Now, we are going to include the segments 13-1, 13-2 14-1, 14-2 ,18-1 and" -" 18-2 into our edge-table, copying the data for dir,cost,and reverse cost" -" with tho following steps:" +msgid "Delete original edge." msgstr "" -msgid "" -"Add a column old_id into edge_table, this column is going to keep track " -"the id of the original edge" +msgid "Update the vertex topology" msgstr "" -msgid "Insert only the segmented edges, that is, the ones whose max(sub_id) >1" +msgid "Fixing a gap" msgstr "" -msgid "We recreate the topology:" +msgid "Store the deadends" msgstr "" msgid "" -"To get the same analysis results as the topology of edge_table_noded, we " -"do the following query:" -msgstr "" - -msgid "" -"To get the same analysis results as the original edge_table, we do the " -"following query:" -msgstr "" - -msgid "" -"Or we can analyze everything because, maybe edge 18 is an overpass, edge " -"14 is an under pass and there is also a street level juction, and the " -"same happens with edges 17 and 13." +"Inspecting the generated table, we can see that edge 14 has been " +"segmented." msgstr "" msgid "" ":doc:`topology-functions` for an overview of a topology for routing " "algorithms. :doc:`pgr_analyzeOneWay` to analyze directionality of the " "edges. :doc:`pgr_createTopology` to create a topology based on the " -"geometry. :doc:`pgr_analyzeGraph` to analyze the edges and vertices of " -"the edge table." +"geometry." msgstr "" msgid "``pgr_pickDeliver`` - Experimental" @@ -18165,6 +18041,9 @@ msgstr "" msgid "Some functions accept soft restrictions about the segments." msgstr "" +msgid "Images" +msgstr "" + msgid "Red arrows correspond when ``cost`` > 0 in the edge table." msgstr "" diff --git a/locale/pot/pgrouting_doc_strings.pot b/locale/pot/pgrouting_doc_strings.pot index ebd1b4bf0c4..a7b6cb2c5b0 100644 --- a/locale/pot/pgrouting_doc_strings.pot +++ b/locale/pot/pgrouting_doc_strings.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v3.8\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-04 16:10+0000\n" +"POT-Creation-Date: 2025-04-05 01:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -7147,21 +7147,12 @@ msgstr "" msgid "The vertices table can be created with :doc:`pgr_createVerticesTable` or :doc:`pgr_createTopology`" msgstr "" -msgid "``integer`` Number of vertices in the edge_table that reference this vertex. See :doc:`pgr_analyzeGgraph `." -msgstr "" - -msgid "``integer`` Indicator that the vertex might have a problem. See :doc:`pgr_analyzeGraph `." -msgstr "" - msgid "``integer`` Number of vertices in the edge_table that reference this vertex as incoming." msgstr "" msgid "``integer`` Number of vertices in the edge_table that reference this vertex as outgoing." msgstr "" -msgid ":doc:`pgr_analyzeGraph`" -msgstr "" - msgid "``pgr_articulationPoints``" msgstr "" @@ -8590,13 +8581,7 @@ msgstr "" msgid "``FAIL`` when the network topology was not built due to an error:" msgstr "" -msgid "The vertices table is a requirement of the :doc:`pgr_analyzeGraph` and the :doc:`pgr_analyzeOneWay` functions." -msgstr "" - -msgid "``integer`` Number of vertices in the edge_table that reference this vertex. See :doc:`pgr_analyzeGraph`." -msgstr "" - -msgid "``integer`` Indicator that the vertex might have a problem. See :doc:`pgr_analyzeGraph`." +msgid "The vertices table is a requirement of the :doc:`pgr_analyzeOneWay` functions." msgstr "" msgid "``integer`` Number of vertices in the edge_table that reference this vertex AS incoming. See :doc:`pgr_analyzeOneWay`." @@ -8800,9 +8785,6 @@ msgstr "" msgid ":doc:`pgr_createTopology` ` to create a topology based on the geometry." msgstr "" -msgid ":doc:`pgr_analyzeGraph` to analyze the edges and vertices of the edge table." -msgstr "" - msgid ":doc:`pgr_analyzeOneWay` to analyze directionality of the edges." msgstr "" @@ -11398,133 +11380,58 @@ msgstr "" msgid "Examples" msgstr "" -msgid "Let's create the topology for the data in :doc:`sampledata`" -msgstr "" - -msgid "Now we can analyze the network." -msgstr "" - -msgid "The analysis tell us that the network has a gap and an intersection. We try to fix the problem using:" -msgstr "" - -msgid "Inspecting the generated table, we can see that edges 13,14 and 18 has been segmented" -msgstr "" - -msgid "We can create the topology of the new network" -msgstr "" - -msgid "Now let's analyze the new topology" -msgstr "" - -msgid "Images" -msgstr "" - -msgid "Before Image" -msgstr "" - -msgid "Before image" -msgstr "" - -msgid "After Image" -msgstr "" - -msgid "After image" +msgid "Create the topology for the data in :doc:`sampledata`" msgstr "" -msgid "Comparing the results" +msgid "Analyze the network for intersections." msgstr "" -msgid "Comparing with the Analysis in the original edge_table, we see that." +msgid "Analyze the network for gaps." msgstr "" -msgid "Before" +msgid "The analysis tell us that the network has a gap and an intersection." msgstr "" -msgid "After" +msgid "Fixing an intersection" msgstr "" -msgid "Table name" +msgid "Storing the intersections." msgstr "" -msgid "edge_table_noded" +msgid "Calling ``pgr_nodeNetwork``." msgstr "" -msgid "Fields" +msgid "Inspecting the generated table, we can see that edges 13 and 18 have been segmented." msgstr "" -msgid "All original fields" +msgid "Update the topology" msgstr "" -msgid "Has only basic fields to do a topology analysis" +msgid "Add new segments to the edges table." msgstr "" -msgid "Edges with 1 dead end: 1,6,24" +msgid "Insert the intersection as new vertices." msgstr "" -msgid "Edges with 2 dead ends: 17,18" +msgid "Update source and target information on the edges table." msgstr "" -msgid "Edge 17's right node is a dead end because there is no other edge sharing that same node. (cnt=1)" +msgid "Delete original edge." msgstr "" -msgid "Edges with 1 dead end: 1-1 ,6-1,14-2, 18-1 17-1 18-2" +msgid "Update the vertex topology" msgstr "" -msgid "Isolated segments" +msgid "Fixing a gap" msgstr "" -msgid "two isolated segments: 17 and 18 both they have 2 dead ends" +msgid "Store the deadends" msgstr "" -msgid "No Isolated segments" +msgid "Inspecting the generated table, we can see that edge 14 has been segmented." msgstr "" -msgid "Edge 17 now shares a node with edges 14-1 and 14-2" -msgstr "" - -msgid "Edges 18-1 and 18-2 share a node with edges 13-1 and 13-2" -msgstr "" - -msgid "Gaps" -msgstr "" - -msgid "There is a gap between edge 17 and 14 because edge 14 is near to the right node of edge 17" -msgstr "" - -msgid "Edge 14 was segmented Now edges: 14-1 14-2 17 share the same node The tolerance value was taken in account" -msgstr "" - -msgid "Intersections" -msgstr "" - -msgid "Edges 13 and 18 were intersecting" -msgstr "" - -msgid "Edges were segmented, So, now in the interection's point there is a node and the following edges share it: 13-1 13-2 18-1 18-2" -msgstr "" - -msgid "Now, we are going to include the segments 13-1, 13-2 14-1, 14-2 ,18-1 and 18-2 into our edge-table, copying the data for dir,cost,and reverse cost with tho following steps:" -msgstr "" - -msgid "Add a column old_id into edge_table, this column is going to keep track the id of the original edge" -msgstr "" - -msgid "Insert only the segmented edges, that is, the ones whose max(sub_id) >1" -msgstr "" - -msgid "We recreate the topology:" -msgstr "" - -msgid "To get the same analysis results as the topology of edge_table_noded, we do the following query:" -msgstr "" - -msgid "To get the same analysis results as the original edge_table, we do the following query:" -msgstr "" - -msgid "Or we can analyze everything because, maybe edge 18 is an overpass, edge 14 is an under pass and there is also a street level juction, and the same happens with edges 17 and 13." -msgstr "" - -msgid ":doc:`topology-functions` for an overview of a topology for routing algorithms. :doc:`pgr_analyzeOneWay` to analyze directionality of the edges. :doc:`pgr_createTopology` to create a topology based on the geometry. :doc:`pgr_analyzeGraph` to analyze the edges and vertices of the edge table." +msgid ":doc:`topology-functions` for an overview of a topology for routing algorithms. :doc:`pgr_analyzeOneWay` to analyze directionality of the edges. :doc:`pgr_createTopology` to create a topology based on the geometry." msgstr "" msgid "``pgr_pickDeliver`` - Experimental" @@ -15211,6 +15118,9 @@ msgstr "" msgid "Some functions accept soft restrictions about the segments." msgstr "" +msgid "Images" +msgstr "" + msgid "Red arrows correspond when ``cost`` > 0 in the edge table." msgstr ""