Skip to content

Commit 4c69887

Browse files
committed
Removing use of pgr_analyzeGraph on the documentation
1 parent 109ffa8 commit 4c69887

File tree

11 files changed

+419
-351
lines changed

11 files changed

+419
-351
lines changed

doc/_static/page_history.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ var filesArr = [
224224
]),
225225
new createInfo('pgr_analyzeOneWay', '2.0', [
226226
{ v: '2.1', n: 'src/common/doc/functions/analyze_oneway'},
227-
{ v: '2.3', n: 'src/topology/doc/pgr_analyzeOneWay'},
227+
{ v: '2.3', n: 'src/topology/doc/pgr_analyzeOneWay'}, 3.8
228228
]),
229229
new createInfo('pgr_analyzeGraph', '2.0', [
230230
{ v: '2.1', n: 'src/common/doc/functions/analyze_graph'},

doc/topology/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,4 @@ foreach (f ${LOCAL_FILES})
1414
list(APPEND LOCAL_DOC_FILES ${PGR_DOCUMENTATION_SOURCE_DIR}/${f})
1515
endforeach()
1616

17-
18-
add_subdirectory("images")
1917
set(PROJECT_DOC_FILES ${PROJECT_DOC_FILES} ${LOCAL_DOC_FILES} PARENT_SCOPE)
20-
set(PROJECT_IMG_FILES ${PROJECT_IMG_FILES} PARENT_SCOPE)
21-

doc/topology/images/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.
-71.7 KB
Binary file not shown.
-66.7 KB
Binary file not shown.

doc/topology/pgr_analyzeOneWay.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ The structure of the vertices table is:
121121

122122
:id: ``bigint`` Identifier of the vertex.
123123
:cnt: ``integer`` Number of vertices in the edge_table that reference this
124-
vertex. See :doc:`pgr_analyzeGgraph <pgr_analyzeGraph>`.
125-
:chk: ``integer`` Indicator that the vertex might have a problem. See
126-
:doc:`pgr_analyzeGraph <pgr_analyzeGraph>`.
124+
vertex.
125+
:chk: ``integer`` Indicator that the vertex might have a problem.
127126
:ein: ``integer`` Number of vertices in the edge_table that reference this
128127
vertex as incoming.
129128
:eout: ``integer`` Number of vertices in the edge_table that reference this
@@ -142,7 +141,6 @@ See Also
142141
-------------------------------------------------------------------------------
143142

144143
* :doc:`topology-functions`
145-
* :doc:`pgr_analyzeGraph`
146144
* :doc:`pgr_createVerticesTable`
147145
* :doc:`sampledata`
148146

doc/topology/pgr_createTopology.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,15 @@ The function returns:
104104

105105
.. rubric:: The Vertices Table
106106

107-
The vertices table is a requirement of the :doc:`pgr_analyzeGraph` and the
107+
The vertices table is a requirement of the
108108
:doc:`pgr_analyzeOneWay` functions.
109109

110110
The structure of the vertices table is:
111111

112112
:id: ``bigint`` Identifier of the vertex.
113113
:cnt: ``integer`` Number of vertices in the edge_table that reference this
114-
vertex. See :doc:`pgr_analyzeGraph`.
115-
:chk: ``integer`` Indicator that the vertex might have a problem. See
116-
:doc:`pgr_analyzeGraph`.
114+
vertex.
115+
:chk: ``integer`` Indicator that the vertex might have a problem.
117116
:ein: ``integer`` Number of vertices in the edge_table that reference this
118117
vertex AS incoming. See :doc:`pgr_analyzeOneWay`.
119118
:eout: ``integer`` Number of vertices in the edge_table that reference this
@@ -279,7 +278,6 @@ See Also
279278
* :doc:`sampledata`
280279
* :doc:`topology-functions`
281280
* :doc:`pgr_createVerticesTable`
282-
* :doc:`pgr_analyzeGraph`
283281

284282
.. rubric:: Indices and tables
285283

doc/topology/pgr_createVerticesTable.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,15 @@ The function returns:
9191

9292
.. rubric:: The Vertices Table
9393

94-
The vertices table is a requirement of the :doc:`pgr_analyzeGraph` and the
94+
The vertices table is a requirement of the
9595
:doc:`pgr_analyzeOneWay` functions.
9696

9797
The structure of the vertices table is:
9898

9999
:id: ``bigint`` Identifier of the vertex.
100100
:cnt: ``integer`` Number of vertices in the edge_table that reference this
101-
vertex. See :doc:`pgr_analyzeGraph`.
102-
:chk: ``integer`` Indicator that the vertex might have a problem. See
103-
:doc:`pgr_analyzeGraph`.
101+
vertex.
102+
:chk: ``integer`` Indicator that the vertex might have a problem.
104103
:ein: ``integer`` Number of vertices in the edge_table that reference this
105104
vertex as incoming. See :doc:`pgr_analyzeOneWay`.
106105
:eout: ``integer`` Number of vertices in the edge_table that reference this
@@ -284,7 +283,6 @@ See Also
284283
algorithms.
285284
* :doc:`pgr_createTopology` <pgr_create_topology>` to create a topology based on
286285
the geometry.
287-
* :doc:`pgr_analyzeGraph` to analyze the edges and vertices of the edge table.
288286
* :doc:`pgr_analyzeOneWay` to analyze directionality of the edges.
289287

290288
.. rubric:: Indices and tables

doc/topology/pgr_nodeNetwork.rst

Lines changed: 97 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -87,143 +87,156 @@ The output table will have for ``edge_table_noded``
8787
Examples
8888
-------------------------------------------------------------------------------
8989

90-
Let's create the topology for the data in :doc:`sampledata`
90+
Create the topology for the data in :doc:`sampledata`
91+
92+
.. literalinclude:: sampledata.queries
93+
:start-after: -- q1
94+
:end-before: -- q1-1
95+
96+
.. literalinclude:: sampledata.queries
97+
:start-after: -- q3
98+
:end-before: -- q4
99+
100+
Analyze the network for intersections.
91101

92102
.. literalinclude:: nodeNetwork.queries
93103
:start-after: --q1
94-
:end-before: --q1.1
104+
:end-before: --q2
95105

96-
Now we can analyze the network.
106+
Analyze the network for gaps.
97107

98108
.. literalinclude:: nodeNetwork.queries
99109
:start-after: --q2
100-
:end-before: --q2.1
110+
:end-before: --q3
101111

102-
The analysis tell us that the network has a gap and an intersection. We try to
103-
fix the problem using:
112+
The analysis tell us that the network has a gap and an intersection.
113+
114+
Fixing an intersection
115+
...............................................................................
116+
117+
Storing the intersections.
104118

105119
.. literalinclude:: nodeNetwork.queries
106120
:start-after: --q3
107-
:end-before: --q3.1
121+
:end-before: --q4
108122

109-
Inspecting the generated table, we can see that edges 13,14 and 18 has been
110-
segmented
123+
Calling ``pgr_nodeNetwork``.
111124

112125
.. literalinclude:: nodeNetwork.queries
113126
:start-after: --q4
114-
:end-before: --q4.1
127+
:end-before: --q5
115128

116-
We can create the topology of the new network
129+
Inspecting the generated table, we can see that edges 13 and 18 has been
130+
segmented
117131

118132
.. literalinclude:: nodeNetwork.queries
119133
:start-after: --q5
120-
:end-before: --q5.1
134+
:end-before: --q6
135+
136+
.. rubric:: Update the topology
121137

122-
Now let's analyze the new topology
138+
Add new segmentes to the edges table.
123139

124140
.. literalinclude:: nodeNetwork.queries
125141
:start-after: --q6
126-
:end-before: --q6.1
142+
:end-before: --q7
127143

128-
Images
129-
-------------------------------------------------------------------------------
144+
Insert the intersection as new vertices.
130145

131-
.. Rubric:: Before Image
146+
.. literalinclude:: nodeNetwork.queries
147+
:start-after: --q7
148+
:end-before: --q8
132149

133-
.. image:: images/before_node_net.png
134-
:scale: 60%
135-
:alt: Before image
136-
:align: left
150+
Update source and target information on the edges table.
137151

152+
.. literalinclude:: nodeNetwork.queries
153+
:start-after: --q8
154+
:end-before: --q9
138155

139-
.. Rubric:: After Image
156+
Delete original edge.
140157

141-
.. image:: images/after_node_net.png
142-
:scale: 60%
143-
:alt: After image
144-
:align: left
158+
.. literalinclude:: nodeNetwork.queries
159+
:start-after: --q9
160+
:end-before: --q10
145161

162+
Update the vertex topology
146163

147-
Comparing the results
148-
-------------------------------------------------------------------------------
164+
.. literalinclude:: nodeNetwork.queries
165+
:start-after: --q10
166+
:end-before: --q11
149167

150-
Comparing with the Analysis in the original edge_table, we see that.
151-
152-
+------------------+-----------------------------------------+--------------------------------------------------------------+
153-
| | Before | After |
154-
+==================+=========================================+==============================================================+
155-
|Table name | edge_table | edge_table_noded |
156-
+------------------+-----------------------------------------+--------------------------------------------------------------+
157-
|Fields | All original fields | Has only basic fields to do a topology analysis |
158-
+------------------+-----------------------------------------+--------------------------------------------------------------+
159-
|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 |
160-
| | - Edges with 2 dead ends: 17,18 | |
161-
| | | |
162-
| | Edge 17's right node is a dead end | |
163-
| | because there is no other edge sharing | |
164-
| | that same node. (cnt=1) | |
165-
+------------------+-----------------------------------------+--------------------------------------------------------------+
166-
|Isolated segments | two isolated segments: 17 and 18 both | No Isolated segments |
167-
| | they have 2 dead ends | - Edge 17 now shares a node with edges 14-1 and 14-2 |
168-
| | | - Edges 18-1 and 18-2 share a node with edges 13-1 and 13-2 |
169-
+------------------+-----------------------------------------+--------------------------------------------------------------+
170-
|Gaps | There is a gap between edge 17 and 14 | Edge 14 was segmented |
171-
| | because edge 14 is near to the right | Now edges: 14-1 14-2 17 share the same node |
172-
| | node of edge 17 | The tolerance value was taken in account |
173-
+------------------+-----------------------------------------+--------------------------------------------------------------+
174-
|Intersections | Edges 13 and 18 were intersecting | Edges were segmented, So, now in the interection's |
175-
| | | point there is a node and the following edges share it: |
176-
| | | 13-1 13-2 18-1 18-2 |
177-
+------------------+-----------------------------------------+--------------------------------------------------------------+
178-
179-
180-
Now, we are going to include the segments 13-1, 13-2 14-1, 14-2 ,18-1 and 18-2
181-
into our edge-table, copying the data for dir,cost,and reverse cost with tho
182-
following steps:
183-
184-
- Add a column old_id into edge_table, this column is going to keep track the id
185-
of the original edge
186-
- Insert only the segmented edges, that is, the ones whose max(sub_id) >1
168+
Analyze the network for intersections.
187169

188170
.. literalinclude:: nodeNetwork.queries
189-
:start-after: --q7
190-
:end-before: --q7.1
171+
:start-after: --q11
172+
:end-before: --q12
173+
174+
Fixing an gap
175+
...............................................................................
191176

192-
We recreate the topology:
177+
Store the deadends
193178

194179
.. literalinclude:: nodeNetwork.queries
195-
:start-after: --q8
196-
:end-before: --q8.1
180+
:start-after: --q12
181+
:end-before: --q13
197182

198-
To get the same analysis results as the topology of edge_table_noded, we do the
199-
following query:
183+
Calling ``pgr_nodeNetwork``.
200184

201185
.. literalinclude:: nodeNetwork.queries
202-
:start-after: --q9
203-
:end-before: --q9.1
186+
:start-after: --q13
187+
:end-before: --q14
204188

205-
To get the same analysis results as the original edge_table, we do the following
206-
query:
189+
Inspecting the generated table, we can see that edges 13 and 18 has been
190+
segmented
207191

208192
.. literalinclude:: nodeNetwork.queries
209-
:start-after: --q10
210-
:end-before: --q10.1
193+
:start-after: --q14
194+
:end-before: --q15
195+
196+
.. rubric:: Update the topology
211197

212-
Or we can analyze everything because, maybe edge 18 is an overpass, edge 14 is
213-
an under pass and there is also a street level juction, and the same happens
214-
with edges 17 and 13.
198+
Add new segmentes to the edges table.
215199

216200
.. literalinclude:: nodeNetwork.queries
217-
:start-after: --q11
218-
:end-before: --q11.1
201+
:start-after: --q15
202+
:end-before: --q16
203+
204+
Insert the intersection as new vertices.
205+
206+
.. literalinclude:: nodeNetwork.queries
207+
:start-after: --q16
208+
:end-before: --q17
209+
210+
Update source and target information on the edges table.
211+
212+
.. literalinclude:: nodeNetwork.queries
213+
:start-after: --q17
214+
:end-before: --q18
215+
216+
Delete original edge.
217+
218+
.. literalinclude:: nodeNetwork.queries
219+
:start-after: --q18
220+
:end-before: --q19
221+
222+
Update the vertex topology
223+
224+
.. literalinclude:: nodeNetwork.queries
225+
:start-after: --q19
226+
:end-before: --q20
227+
228+
Analyze the network for gaps.
229+
230+
.. literalinclude:: nodeNetwork.queries
231+
:start-after: --q20
232+
:end-before: --q21
219233

220234
See Also
221235
-------------------------------------------------------------------------------
222236

223237
:doc:`topology-functions` for an overview of a topology for routing algorithms.
224238
:doc:`pgr_analyzeOneWay` to analyze directionality of the edges.
225239
:doc:`pgr_createTopology` to create a topology based on the geometry.
226-
:doc:`pgr_analyzeGraph` to analyze the edges and vertices of the edge table.
227240

228241
.. rubric:: Indices and tables
229242

0 commit comments

Comments
 (0)