Skip to content

Commit f3c27f1

Browse files
committed
docs: replace table name 'vertices' with 'ways_vertices_pgr'
1 parent 6114f86 commit f3c27f1

11 files changed

Lines changed: 67 additions & 67 deletions

File tree

docs/advanced/chapter-12.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ This function:
9999
* Assigns a ``source`` and a ``target`` identifiers to each road link
100100
* It can logically "snap" nearby vertices within a certain tolerance by
101101
assigning the same identifier.
102-
* Creates a vertices table related to it.
102+
* Creates a ways_vertices_pgr table related to it.
103103
* Creates the basic indices.
104104

105105
.. code-block:: sql
@@ -150,7 +150,7 @@ To verify that there is a basic `Routing Network Topology`:
150150

151151
\d planet_osm_roads
152152

153-
Also a new table containing the vertices information was created:
153+
Also a new table containing the ways_vertices_pgr information was created:
154154

155155
::
156156

docs/basic/graphs.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ a graph.
140140
Description of the function can be found in `pgr_extractVertices
141141
<https://docs.pgrouting.org/latest/en/pgr_extractVertices.html>`__
142142

143-
Exercise 1: Create a vertices table
143+
Exercise 1: Create a ways_vertices_pgr table
144144
-------------------------------------------------------------------------------
145145

146146
.. rubric:: Problem
147147

148-
Create the vertices table corresponding to the edges in ``ways``.
148+
Create the ways_vertices_pgr table corresponding to the edges in ``ways``.
149149

150150
.. rubric:: Solution
151151

@@ -167,7 +167,7 @@ Create the vertices table corresponding to the edges in ``ways``.
167167

168168
.. literalinclude:: ../scripts/basic/graphs/create_vertices.txt
169169

170-
Reviewing the description of the vertices table
170+
Reviewing the description of the ways_vertices_pgr table
171171

172172
.. literalinclude:: ../scripts/basic/graphs/graphs.sql
173173
:start-after: vertices_description.txt
@@ -177,7 +177,7 @@ Reviewing the description of the vertices table
177177

178178
.. literalinclude:: ../scripts/basic/graphs/vertices_description.txt
179179

180-
Inspecting the information on the vertices table
180+
Inspecting the information on the ways_vertices_pgr table
181181

182182
.. literalinclude:: ../scripts/basic/graphs/graphs.sql
183183
:language: sql
@@ -189,12 +189,12 @@ Inspecting the information on the vertices table
189189
.. literalinclude:: ../scripts/basic/graphs/selected_rows.txt
190190

191191

192-
Exercise 2: Fill up other columns in the vertices table
192+
Exercise 2: Fill up other columns in the ways_vertices_pgr table
193193
-------------------------------------------------------------------------------
194194

195195
.. rubric:: Problem
196196

197-
Fill up geometry information on the vertices table.
197+
Fill up geometry information on the ways_vertices_pgr table.
198198

199199
.. rubric:: Solution
200200

@@ -211,7 +211,7 @@ Count the number of rows that need to be filled up.
211211
.. rubric:: Update the ``geom`` and ``osm_id`` columns
212212

213213
* The update based on the ``source`` column from ``ways`` table and the ``id``
214-
column of the vertices table.
214+
column of the ways_vertices_pgr table.
215215
* To update ``geom`` column, use the start point of the geometry on the ``ways``
216216
table.
217217
* Use the ``source_osm`` value to fill up ``osm_id`` column.
@@ -227,7 +227,7 @@ Count the number of rows that need to be filled up.
227227

228228
.. literalinclude:: ../scripts/basic/graphs/fill_columns_2.txt
229229

230-
Not expecting to be done due to the fact that some vertices are dead ends.
230+
Not expecting to be done due to the fact that some ways_vertices_pgr are dead ends.
231231

232232
.. literalinclude:: ../scripts/basic/graphs/graphs.sql
233233
:language: sql
@@ -241,7 +241,7 @@ Not expecting to be done due to the fact that some vertices are dead ends.
241241
.. rubric:: Continue update the ``geom`` and ``osm_id`` columns
242242

243243
* The update based on the ``target`` column from ``ways`` table and the ``id``
244-
column of the vertices table.
244+
column of the ways_vertices_pgr table.
245245
* To update ``geom`` column, use the end point of the geometry on the ``ways``
246246
table.
247247
* Use the ``target_osm`` value to fill up ``osm_id`` column.
@@ -305,7 +305,7 @@ Description of the function can be found in `pgr_connectedComponents
305305
<https://docs.pgrouting.org/latest/en/pgr_connectedComponents.html>`__
306306

307307

308-
Exercise 3: Set components on edges and vertices tables
308+
Exercise 3: Set components on edges and ways_vertices_pgr tables
309309
-------------------------------------------------------------------------------
310310

311311
.. rubric:: Problem
@@ -325,9 +325,9 @@ Create additional columns on the edges tables.
325325

326326
.. literalinclude:: ../scripts/basic/graphs/set_components1.txt
327327

328-
.. rubric:: Use the ``pgr_connectedComponents`` to fill up the vertices table.
328+
.. rubric:: Use the ``pgr_connectedComponents`` to fill up the ways_vertices_pgr table.
329329

330-
- Use the results to store the component numbers on the vertices table.
330+
- Use the results to store the component numbers on the ways_vertices_pgr table.
331331

332332
.. literalinclude:: ../scripts/basic/graphs/graphs.sql
333333
:language: sql
@@ -358,14 +358,14 @@ Exercise 4: Inspect the components
358358

359359
Answer the following questions:
360360

361-
#. How many components are in the vertices table?
361+
#. How many components are in the ways_vertices_pgr table?
362362
#. How many components are in the edges table?
363363
#. List the 10 components with more edges.
364364
#. Get the component with the maximum number of edges.
365365

366366
.. rubric:: Solution
367367

368-
.. rubric:: 1. How many components are in the vertices table?
368+
.. rubric:: 1. How many components are in the ways_vertices_pgr table?
369369

370370
Count the distinct components.
371371

docs/interactions/code/QGISfunctions.sql

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -439,17 +439,17 @@ FROM wrk_dijkstra('vehicle_net', 252643343, 302057309);
439439

440440

441441
DROP VIEW IF EXISTS ch8_e1 ; CREATE VIEW ch8_e1 AS
442-
-- Number of vertices in the original graph
442+
-- Number of ways_vertices_pgr in the original graph
443443
SELECT count(*) FROM ways_vertices_pgr;
444444

445-
-- Number of vertices in the vehicles_net graph
445+
-- Number of ways_vertices_pgr in the vehicles_net graph
446446
SELECT count(*) FROM ways_vertices_pgr
447447
WHERE id IN (
448448
SELECT source FROM vehicle_net
449449
UNION
450450
SELECT target FROM vehicle_net);
451451

452-
-- Number of vertices in the little_net graph
452+
-- Number of ways_vertices_pgr in the little_net graph
453453
SELECT count(*) FROM ways_vertices_pgr
454454
WHERE id IN (
455455
SELECT source FROM little_net
@@ -464,26 +464,26 @@ SELECT osm_id FROM ways_vertices_pgr
464464

465465
-- Closest osm_id in the vehicle_net graph
466466
WITH
467-
vertices AS (
467+
ways_vertices_pgr AS (
468468
SELECT * FROM ways_vertices_pgr
469469
WHERE id IN (
470470
SELECT source FROM vehicle_net
471471
UNION
472472
SELECT target FROM vehicle_net)
473473
)
474-
SELECT osm_id FROM vertices
474+
SELECT osm_id FROM ways_vertices_pgr
475475
ORDER BY the_geom <-> ST_SetSRID(ST_Point(39.291852, -6.811437), 4326) LIMIT 1;
476476

477477
-- Closest osm_id in the little_net graph
478478
WITH
479-
vertices AS (
479+
ways_vertices_pgr AS (
480480
SELECT * FROM ways_vertices_pgr
481481
WHERE id IN (
482482
SELECT source FROM little_net
483483
UNION
484484
SELECT target FROM little_net)
485485
)
486-
SELECT osm_id FROM vertices
486+
SELECT osm_id FROM ways_vertices_pgr
487487
ORDER BY the_geom <-> ST_SetSRID(ST_Point(39.291852, -6.811437), 4326) LIMIT 1;
488488

489489

@@ -510,7 +510,7 @@ BEGIN
510510
final_query :=
511511
FORMAT( $$
512512
WITH
513-
vertices AS (
513+
ways_vertices_pgr AS (
514514
SELECT * FROM ways_vertices_pgr
515515
WHERE id IN (
516516
SELECT source FROM %1$I
@@ -522,10 +522,10 @@ BEGIN
522522
FROM wrk_dijkstra(
523523
'%1$I',
524524
-- source
525-
(SELECT osm_id FROM vertices
525+
(SELECT osm_id FROM ways_vertices_pgr
526526
ORDER BY the_geom <-> ST_SetSRID(ST_Point(%2$s, %3$s), 4326) LIMIT 1),
527527
-- target
528-
(SELECT osm_id FROM vertices
528+
(SELECT osm_id FROM ways_vertices_pgr
529529
ORDER BY the_geom <-> ST_SetSRID(ST_Point(%4$s, %5$s), 4326) LIMIT 1))
530530
)
531531
SELECT

docs/interactions/code/functions.sql

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -439,17 +439,17 @@ FROM wrk_dijkstra('vehicle_net', 252643343, 302057309);
439439

440440

441441

442-
-- Number of vertices in the original graph
442+
-- Number of ways_vertices_pgr in the original graph
443443
SELECT count(*) FROM ways_vertices_pgr;
444444

445-
-- Number of vertices in the vehicles_net graph
445+
-- Number of ways_vertices_pgr in the vehicles_net graph
446446
SELECT count(*) FROM ways_vertices_pgr
447447
WHERE id IN (
448448
SELECT source FROM vehicle_net
449449
UNION
450450
SELECT target FROM vehicle_net);
451451

452-
-- Number of vertices in the little_net graph
452+
-- Number of ways_vertices_pgr in the little_net graph
453453
SELECT count(*) FROM ways_vertices_pgr
454454
WHERE id IN (
455455
SELECT source FROM little_net
@@ -464,26 +464,26 @@ SELECT osm_id FROM ways_vertices_pgr
464464

465465
-- Closest osm_id in the vehicle_net graph
466466
WITH
467-
vertices AS (
467+
ways_vertices_pgr AS (
468468
SELECT * FROM ways_vertices_pgr
469469
WHERE id IN (
470470
SELECT source FROM vehicle_net
471471
UNION
472472
SELECT target FROM vehicle_net)
473473
)
474-
SELECT osm_id FROM vertices
474+
SELECT osm_id FROM ways_vertices_pgr
475475
ORDER BY the_geom <-> ST_SetSRID(ST_Point(39.291852, -6.811437), 4326) LIMIT 1;
476476

477477
-- Closest osm_id in the little_net graph
478478
WITH
479-
vertices AS (
479+
ways_vertices_pgr AS (
480480
SELECT * FROM ways_vertices_pgr
481481
WHERE id IN (
482482
SELECT source FROM little_net
483483
UNION
484484
SELECT target FROM little_net)
485485
)
486-
SELECT osm_id FROM vertices
486+
SELECT osm_id FROM ways_vertices_pgr
487487
ORDER BY the_geom <-> ST_SetSRID(ST_Point(39.291852, -6.811437), 4326) LIMIT 1;
488488

489489

@@ -510,7 +510,7 @@ BEGIN
510510
final_query :=
511511
FORMAT( $$
512512
WITH
513-
vertices AS (
513+
ways_vertices_pgr AS (
514514
SELECT * FROM ways_vertices_pgr
515515
WHERE id IN (
516516
SELECT source FROM %1$I
@@ -522,10 +522,10 @@ BEGIN
522522
FROM wrk_dijkstra(
523523
'%1$I',
524524
-- source
525-
(SELECT osm_id FROM vertices
525+
(SELECT osm_id FROM ways_vertices_pgr
526526
ORDER BY the_geom <-> ST_SetSRID(ST_Point(%2$s, %3$s), 4326) LIMIT 1),
527527
-- target
528-
(SELECT osm_id FROM vertices
528+
(SELECT osm_id FROM ways_vertices_pgr
529529
ORDER BY the_geom <-> ST_SetSRID(ST_Point(%4$s, %5$s), 4326) LIMIT 1))
530530
)
531531
SELECT

docs/scripts/basic/graphs/graphs.sql

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DROP TABLE IF EXISTS vertices CASCADE;
1+
DROP TABLE IF EXISTS ways_vertices_pgr CASCADE;
22
DROP VIEW IF EXISTS vehicle_net CASCADE;
33
DROP VIEW IF EXISTS taxi_net CASCADE;
44
DROP MATERIALIZED VIEW IF EXISTS walk_net CASCADE;
@@ -20,37 +20,37 @@ ORDER BY tag_id;
2020
\o create_vertices.txt
2121

2222
SELECT id, in_edges, out_edges, x, y, NULL::BIGINT osm_id, NULL::BIGINT component, geom
23-
INTO vertices
23+
INTO ways_vertices_pgr
2424
FROM pgr_extractVertices(
2525
'SELECT gid AS id, source, target
2626
FROM ways ORDER BY id');
2727

2828
\o vertices_description.txt
29-
\dS+ vertices
29+
\dS+ ways_vertices_pgr
3030
\o selected_rows.txt
31-
SELECT * FROM vertices Limit 10;
31+
SELECT * FROM ways_vertices_pgr Limit 10;
3232

3333
\o fill_columns_1.txt
34-
SELECT count(*) FROM vertices WHERE geom IS NULL;
34+
SELECT count(*) FROM ways_vertices_pgr WHERE geom IS NULL;
3535
\o fill_columns_2.txt
36-
UPDATE vertices SET (geom, osm_id) = (ST_startPoint(the_geom), source_osm)
36+
UPDATE ways_vertices_pgr SET (geom, osm_id) = (ST_startPoint(the_geom), source_osm)
3737
FROM ways WHERE source = id;
3838
\o fill_columns_3.txt
39-
SELECT count(*) FROM vertices WHERE geom IS NULL;
39+
SELECT count(*) FROM ways_vertices_pgr WHERE geom IS NULL;
4040
\o fill_columns_4.txt
41-
UPDATE vertices SET (geom, osm_id) = (ST_endPoint(the_geom), target_osm)
41+
UPDATE ways_vertices_pgr SET (geom, osm_id) = (ST_endPoint(the_geom), target_osm)
4242
FROM ways WHERE geom IS NULL AND target = id;
4343
\o fill_columns_5.txt
44-
SELECT count(*) FROM vertices WHERE geom IS NULL;
44+
SELECT count(*) FROM ways_vertices_pgr WHERE geom IS NULL;
4545
\o fill_columns_6.txt
46-
UPDATE vertices set (x,y) = (ST_X(geom), ST_Y(geom));
46+
UPDATE ways_vertices_pgr set (x,y) = (ST_X(geom), ST_Y(geom));
4747

4848

4949
\o set_components1.txt
5050
ALTER TABLE ways ADD COLUMN component BIGINT;
5151

5252
\o set_components2.txt
53-
UPDATE vertices AS v SET component = c.component
53+
UPDATE ways_vertices_pgr AS v SET component = c.component
5454
FROM (
5555
SELECT seq, component, node
5656
FROM pgr_connectedComponents(
@@ -60,11 +60,11 @@ WHERE v.id = c.node;
6060
\o set_components3.txt
6161

6262
UPDATE ways SET component = v.component
63-
FROM (SELECT id, component FROM vertices) AS v
63+
FROM (SELECT id, component FROM ways_vertices_pgr) AS v
6464
WHERE source = v.id;
6565

6666
\o see_components1.txt
67-
SELECT count(DISTINCT component) FROM vertices;
67+
SELECT count(DISTINCT component) FROM ways_vertices_pgr;
6868
\o see_components2.txt
6969
SELECT count(DISTINCT component) FROM ways;
7070
\o see_components3.txt

docs/scripts/basic/graphs/images.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ INTO costMatrix_png
66
FROM pgr_dijkstraCostMatrix(
77
'SELECT * FROM vehicle_net',
88
ARRAY[@ID_1@, @ID_2@, @ID_3@, @ID_4@, @ID_5@])
9-
JOIN vertices v1 ON (start_vid=v1.id)
10-
JOIN vertices v2 ON (end_vid=v2.id);
9+
JOIN ways_vertices_pgr v1 ON (start_vid=v1.id)
10+
JOIN ways_vertices_pgr v2 ON (end_vid=v2.id);

docs/scripts/basic/pedestrian/images.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CASE
77
WHEN osm_id = @OSMID_4@ THEN '@PLACE_4@'
88
WHEN osm_id = @OSMID_5@ THEN '@PLACE_5@'
99
END AS name
10-
FROM vertices
10+
FROM ways_vertices_pgr
1111
WHERE osm_id IN (@OSMID_1@, @OSMID_2@, @OSMID_3@, @OSMID_4@, @OSMID_5@)
1212
ORDER BY osm_id;
1313

@@ -85,5 +85,5 @@ FROM pgr_dijkstraCost(
8585
directed := false)
8686
)
8787
SELECT row_number() over() AS gid, start_vid, end_vid, agg_cost, ST_MakeLine(v1.geom, v2.geom) AS geom FROM dijkstra
88-
JOIN vertices AS v1 ON (start_vid = v1.id)
89-
JOIN vertices AS v2 ON (end_vid = v2.id);
88+
JOIN ways_vertices_pgr AS v1 ON (start_vid = v1.id)
89+
JOIN ways_vertices_pgr AS v2 ON (end_vid = v2.id);

docs/scripts/basic/pedestrian/pedestrian.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
\o get_id.txt
22

3-
SELECT osm_id, id FROM vertices
3+
SELECT osm_id, id FROM ways_vertices_pgr
44
WHERE osm_id IN (@OSMID_1@, @OSMID_2@, @OSMID_3@, @OSMID_4@, @OSMID_5@)
55
ORDER BY osm_id;
66

0 commit comments

Comments
 (0)