diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index ff9a7353..035de71c 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -83,7 +83,7 @@ jobs: - name: Build run: | cd build - make -j 4 + make doc - name: Initialize mandatory git config run: | @@ -95,7 +95,7 @@ jobs: if [[ "${{ env.BRANCH }}" == "develop" ]]; then FOLDER_NAME="dev" elif [[ "${{ env.BRANCH }}" == "main" ]]; then - FOLDER_NAME="3.0" + FOLDER_NAME="3.1" fi git checkout -f origin/gh-pages git checkout -b gh-pages diff --git a/docs/basic/images/pedestrian/CMakeLists.txt b/docs/basic/images/pedestrian/CMakeLists.txt index d53fc7ed..6871f1f7 100644 --- a/docs/basic/images/pedestrian/CMakeLists.txt +++ b/docs/basic/images/pedestrian/CMakeLists.txt @@ -4,12 +4,11 @@ #--------------------- set(PGR_WORKSHOP_IMG_FILES pedestrian_combinations.png - pedestrian_route1.png - pedestrian_route2.png - pedestrian_route4.png - pedestrian_route5.png - route.png - ) + pedestrian_dijkstracost.png + pedestrian_many_to_many.png + pedestrian_one_to_many.png + pedestrian_one_to_one.png +) foreach (f ${PGR_WORKSHOP_IMG_FILES}) diff --git a/docs/basic/images/pedestrian/pedestrian_combinations.png b/docs/basic/images/pedestrian/pedestrian_combinations.png index fe569fa8..778d04e0 100644 Binary files a/docs/basic/images/pedestrian/pedestrian_combinations.png and b/docs/basic/images/pedestrian/pedestrian_combinations.png differ diff --git a/docs/basic/images/pedestrian/pedestrian_dijkstracost.png b/docs/basic/images/pedestrian/pedestrian_dijkstracost.png new file mode 100644 index 00000000..af50f68e Binary files /dev/null and b/docs/basic/images/pedestrian/pedestrian_dijkstracost.png differ diff --git a/docs/basic/images/pedestrian/pedestrian_many_to_many.png b/docs/basic/images/pedestrian/pedestrian_many_to_many.png new file mode 100644 index 00000000..0812f6bb Binary files /dev/null and b/docs/basic/images/pedestrian/pedestrian_many_to_many.png differ diff --git a/docs/basic/images/pedestrian/pedestrian_one_to_many.png b/docs/basic/images/pedestrian/pedestrian_one_to_many.png new file mode 100644 index 00000000..2bac5a22 Binary files /dev/null and b/docs/basic/images/pedestrian/pedestrian_one_to_many.png differ diff --git a/docs/basic/images/pedestrian/pedestrian_one_to_one.png b/docs/basic/images/pedestrian/pedestrian_one_to_one.png new file mode 100644 index 00000000..81169888 Binary files /dev/null and b/docs/basic/images/pedestrian/pedestrian_one_to_one.png differ diff --git a/docs/basic/images/pedestrian/pedestrian_route1.png b/docs/basic/images/pedestrian/pedestrian_route1.png deleted file mode 100644 index ab38e08e..00000000 Binary files a/docs/basic/images/pedestrian/pedestrian_route1.png and /dev/null differ diff --git a/docs/basic/images/pedestrian/pedestrian_route2.png b/docs/basic/images/pedestrian/pedestrian_route2.png deleted file mode 100644 index a0674e7b..00000000 Binary files a/docs/basic/images/pedestrian/pedestrian_route2.png and /dev/null differ diff --git a/docs/basic/images/pedestrian/pedestrian_route4.png b/docs/basic/images/pedestrian/pedestrian_route4.png deleted file mode 100644 index 76540d6b..00000000 Binary files a/docs/basic/images/pedestrian/pedestrian_route4.png and /dev/null differ diff --git a/docs/basic/images/pedestrian/pedestrian_route5.png b/docs/basic/images/pedestrian/pedestrian_route5.png deleted file mode 100644 index 78bfb600..00000000 Binary files a/docs/basic/images/pedestrian/pedestrian_route5.png and /dev/null differ diff --git a/docs/basic/images/pedestrian/route.png b/docs/basic/images/pedestrian/route.png deleted file mode 100644 index 918ce0b3..00000000 Binary files a/docs/basic/images/pedestrian/route.png and /dev/null differ diff --git a/docs/basic/pedestrian.rst b/docs/basic/pedestrian.rst index 6ecaeb0b..254fabdd 100644 --- a/docs/basic/pedestrian.rst +++ b/docs/basic/pedestrian.rst @@ -10,7 +10,7 @@ Pedestrian Routing =============================================================================== -.. image:: images/pedestrian/route.png +.. image:: images/pedestrian/pedestrian_one_to_one.png :scale: 25% :align: center @@ -18,6 +18,10 @@ Pedestrian Routing path search with *Dijkstra* algorithm. Later other functions were added and the library was renamed to pgRouting. +pgRouting functions in this chapter + +- `pgr_dijkstra`_ +- `pgr_dijkstraCost`_ .. contents:: Chapter Contents @@ -62,7 +66,7 @@ Description of the function can be found in `pgr_dijkstra The assignment of the vertices identifiers on the source and target columns may be different, the following exercises will use the results of this query. For the workshop, some locations near of the FOSS4G event are going to be used. -These locations are within this area https://www.openstreetmap.org/#map=14/-1.44228/-48.46069 +These locations are within this area https://www.openstreetmap.org/#map=16/-36.8520950/174.7631803 * |osmid_1| |place_1| * |osmid_2| |place_2| @@ -81,12 +85,12 @@ Get the vertex identifiers .. literalinclude:: ../scripts/basic/pedestrian/pedestrian.sql :language: sql - :start-after: exercise_5_0.txt - :end-before: exercise_5_1.txt + :start-after: get_id.txt + :end-before: one_to_one.txt | -.. literalinclude:: ../scripts/basic/pedestrian/exercise_5_0.txt +.. literalinclude:: ../scripts/basic/pedestrian/get_id.txt * |osmid_1| |place_1| (|id_1|) * |osmid_2| |place_2| (|id_2|) @@ -96,9 +100,9 @@ Get the vertex identifiers The corresponding :code:`id` are shown in the following image, and a sample route from -"|place_3|" to "|place_5|". +"|place_3|" to "|place_1|". -.. image:: images/pedestrian/route.png +.. image:: images/pedestrian/pedestrian_one_to_one.png :scale: 25% Exercise 1: Single pedestrian routing @@ -111,34 +115,32 @@ Exercise 1: Single pedestrian routing * from "|place_1|" * to "|place_3|". -* Calculate routes with costs in *osm2pgRouting* ``length`` default units. +* Calculate routes with costs in ``length`` in meters. -.. image:: images/pedestrian/pedestrian_route1.png +.. image:: images/pedestrian/pedestrian_one_to_one.png :scale: 25% - :alt: From the |place_1| to the |place_3| .. rubric:: Solution: -* The pedestrian wants to go from vertex |id_1| to vertex |id_3| (lines **9** and **10**). -* The pedestrian's cost is in terms of length. In this case ``length`` (line **6**), which - was calculated by osm2pgrouting, is in unit ``degrees``. -* From a pedestrian perspective the graph is ``undirected`` (line **11**), that is, the +* The pedestrian wants to go from vertex |id_1| to vertex |id_3| (lines **5** and **6**). +* The pedestrian's cost is in terms of length. In this case ``length`` (line **3**). +* From a pedestrian perspective the graph is ``undirected`` (line **7**), that is, the pedestrian can move in both directions on all segments. .. literalinclude:: ../scripts/basic/pedestrian/pedestrian.sql - :language: sql - :start-after: exercise_5_1.txt - :end-before: exercise_5_2.txt - :emphasize-lines: 3-7 + :language: sql + :start-after: one_to_one.txt + :end-before: many_to_one.txt + :linenos: .. collapse:: Query results - .. literalinclude:: ../scripts/basic/pedestrian/exercise_5_1.txt + .. literalinclude:: ../scripts/basic/pedestrian/one_to_one.txt .. note:: - * The returned cost attribute represents the cost specified in the - inner SQL query (``edges_sql::text`` argument). In this example cost is ``length`` in unit - "degrees". Cost may be time, distance or any combination of both or any + * The returned cost attribute represents the cost specified in the inner SQL + query (``edges_sql::text`` argument). In this example cost is ``length`` in + unit "meters". Cost may be time, distance or any combination of both or any other attributes or a custom formula. * ``node`` and ``edge`` results may vary depending on the assignment of the identifiers to the vertices given by osm2pgrouting. @@ -153,27 +155,26 @@ Exercise 2: Many Pedestrians going to the same destination * from "|place_1|" and "|place_2|" * to the "|place_3|". -* Calculate routes with costs in *osm2pgRouting* ``length_m`` which is in meters. +* Calculate routes with costs in ``length`` in kilometers. -.. image:: images/pedestrian/pedestrian_route2.png +.. image:: images/pedestrian/pedestrian_one_to_many.png :scale: 25% - :alt: From |place_1| and |place_2| to |place_3| .. rubric:: Solution: -* The pedestrians are departing at vertices |id_1| and |id_2| (line **9**). -* All pedestrians want to go to vertex |id_3| (line **10**). -* The cost to be in meters using attribute ``length_m`` (line **6**). +* The pedestrians are departing at vertices |id_1| and |id_2| (line **5**). +* All pedestrians want to go to vertex |id_3| (line **6**). +* The cost to be in kilometers using attribute ``length`` (line **3**). .. literalinclude:: ../scripts/basic/pedestrian/pedestrian.sql - :language: sql - :start-after: exercise_5_2.txt - :end-before: exercise_5_3.txt - :emphasize-lines: 6, 9 + :language: sql + :start-after: many_to_one.txt + :end-before: one_to_many.txt + :linenos: .. collapse:: Query results - .. literalinclude:: ../scripts/basic/pedestrian/exercise_5_2.txt + .. literalinclude:: ../scripts/basic/pedestrian/many_to_one.txt Exercise 3: Many Pedestrians departing from the same location ............................................................................... @@ -185,26 +186,29 @@ Exercise 3: Many Pedestrians departing from the same location * from "|place_3|" * to "|place_1|" and "|place_2|" -* Calculate routes with costs in seconds. +* Calculate routes using the ``cost`` which is in seconds for a walking speed of + ``2 mts/sec``. + + * See :doc:`graphs` for the costs setup. -.. image:: images/pedestrian/pedestrian_route2.png +.. image:: images/pedestrian/pedestrian_one_to_many.png :scale: 25% .. rubric:: Solution: -* All pedestrians are departing from vertex |id_3| (line **9**). -* Pedestrians want to go to locations |id_1| and |id_2| (line **10**). -* The cost to be in seconds, with a walking speed ``s = 1.3 m/s`` and ``t = d/s`` (line **6**). +* All pedestrians are departing from vertex |id_3| (line **5**). +* Pedestrians want to go to locations |id_1| and |id_2| (line **6**). +* The ``cost`` column on ``walk_net`` is in seconds. (line **3**) .. literalinclude:: ../scripts/basic/pedestrian/pedestrian.sql - :language: sql - :start-after: exercise_5_3.txt - :end-before: exercise_5_4.txt - :emphasize-lines: 6, 9, 10 + :language: sql + :start-after: one_to_many.txt + :end-before: many_to_many.txt + :linenos: .. collapse:: Query results - .. literalinclude:: ../scripts/basic/pedestrian/exercise_5_3.txt + .. literalinclude:: ../scripts/basic/pedestrian/one_to_many.txt Exercise 4: Many Pedestrians going to different destinations @@ -217,27 +221,26 @@ Exercise 4: Many Pedestrians going to different destinations * from "|place_1|" and "|place_2|" * to "|place_4|" and "|place_5|" -* Calculate routes with costs in minutes. +* Calculate routes with costs in minutes at walking speed ``s = 1.3 m/s``. -.. image:: images/pedestrian/pedestrian_route4.png +.. image:: images/pedestrian/pedestrian_many_to_many.png :scale: 25% .. rubric:: Solution: -* The pedestrians depart from |id_1| and |id_2| (line **9**). -* The pedestrians want to go to destinations |id_4| and |id_5| (line **10**). -* The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/s`` (line **6**). -* Result adds the costs per destination. +* The pedestrians depart from |id_1| and |id_2| (line **5**). +* The pedestrians want to go to destinations |id_4| and |id_5| (line **6**). +* The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/s``. .. literalinclude:: ../scripts/basic/pedestrian/pedestrian.sql - :language: sql - :start-after: exercise_5_4.txt - :end-before: exercise_5_5.txt - :emphasize-lines: 6, 9-10 + :language: sql + :start-after: many_to_many.txt + :end-before: combinations.txt + :linenos: .. collapse:: Query results - .. literalinclude:: ../scripts/basic/pedestrian/exercise_5_4.txt + .. literalinclude:: ../scripts/basic/pedestrian/many_to_many.txt .. note:: .. include:: ../scripts/basic/pedestrian/note_1.txt @@ -251,26 +254,26 @@ Exercise 5: Combination of routes * First pedestrian goes from "|place_1|" to "|place_4|" * Second pedestrian goes from "|place_2|" to "|place_5|" -* Calculate routes with costs in minutes. +* Calculate routes with costs in minutes at walking speed ``s = 1.3 m/s``. .. image:: images/pedestrian/pedestrian_combinations.png :scale: 25% .. rubric:: Solution: -* First pedestrian departs from |id_1| and the destination is |id_4| (line **11**). -* Second pedestrian departs from |id_2| and the destination is |id_5| (line **12**). -* The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/s`` +* First pedestrian departs from |id_1| and the destination is |id_4| (line **6**). +* Second pedestrian departs from |id_2| and the destination is |id_5| (line **7**). +* The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/s``. .. literalinclude:: ../scripts/basic/pedestrian/pedestrian.sql - :language: sql - :start-after: exercise_5_5.txt - :end-before: exercise_5_6.txt - :emphasize-lines: 11-12 + :language: sql + :start-after: combinations.txt + :end-before: dijkstracost.txt + :linenos: .. collapse:: Query results - .. literalinclude:: ../scripts/basic/pedestrian/exercise_5_5.txt + .. literalinclude:: ../scripts/basic/pedestrian/combinations.txt pgr_dijkstraCost ------------------------------------------------------------------------------- @@ -307,57 +310,24 @@ Exercise 6: Time for many Pedestrians going to different destinations * Get only the cost in minutes. -.. image:: images/pedestrian/pedestrian_route5.png +.. image:: images/pedestrian/pedestrian_dijkstracost.png :scale: 25% - :alt: From the hotels to the |place_4| and |place_5| .. rubric:: Solution: -* The pedestrians depart from |id_1| and |id_2| (line **9**). -* The pedestrians want to go to destinations |id_4| and |id_5| (line **10**). -* The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/s`` (line **6**). +* The pedestrians depart from |id_1| and |id_2| (line **5**). +* The pedestrians want to go to destinations |id_4| and |id_5| (line **6**). +* The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/s``. * Result as aggregated costs. .. literalinclude:: ../scripts/basic/pedestrian/pedestrian.sql - :language: sql - :start-after: exercise_5_6.txt - :end-before: exercise_5_7.txt - :emphasize-lines: 2 + :language: sql + :start-after: dijkstracost.txt + :end-before: note_1.txt + :linenos: .. collapse:: Query results - .. literalinclude:: ../scripts/basic/pedestrian/exercise_5_6.txt + .. literalinclude:: ../scripts/basic/pedestrian/dijkstracost.txt Compare with `Exercise 4: Many Pedestrians going to different destinations`_ 's note. - - -Exercise 7: Many Pedestrians going to different destinations summarizing the total costs per departure -........................................................................................................... - -.. rubric:: Problem: - -* Walking - - * from "|place_1|" or "|place_2|" - * to "|place_4|" or "|place_5|" - -* Summarize cost in minutes. - -.. rubric:: Solution: - -* The pedestrians depart from |id_1| and |id_2| (line **9**). -* The pedestrians want to go to destinations |id_4| and |id_5| (line **10**). -* The cost to be in minutes, with a walking speed s = 1.3 m/s and t = d/s (line **6**). -* Result adds the costs per destination. - -.. literalinclude:: ../scripts/basic/pedestrian/pedestrian.sql - :language: sql - :start-after: exercise_5_7.txt - :end-before: note_1.txt - :emphasize-lines: 13-14 - -.. collapse:: Query results - - .. literalinclude:: ../scripts/basic/pedestrian/exercise_5_7.txt - -.. note:: .. include:: ../scripts/basic/pedestrian/note_2.txt diff --git a/docs/basic/plpgsql_function.rst b/docs/basic/plpgsql_function.rst index 48c574f9..cccd4ff7 100644 --- a/docs/basic/plpgsql_function.rst +++ b/docs/basic/plpgsql_function.rst @@ -10,7 +10,7 @@ pl/pgsql function ############################################################################### -.. image:: images/pedestrian/route.png +.. image:: images/pedestrian/pedestrian_one_to_one.png :width: 250pt :align: center diff --git a/docs/basic/sql_function.rst b/docs/basic/sql_function.rst index 8c223417..81dbb2c6 100644 --- a/docs/basic/sql_function.rst +++ b/docs/basic/sql_function.rst @@ -11,7 +11,7 @@ SQL function ############################################################################### -.. image:: images/pedestrian/route.png +.. image:: images/pedestrian/pedestrian_one_to_one.png :scale: 25% :align: center diff --git a/docs/interactions/chapter-9.rst b/docs/interactions/chapter-9.rst index a479803a..e0f2024a 100644 --- a/docs/interactions/chapter-9.rst +++ b/docs/interactions/chapter-9.rst @@ -11,7 +11,7 @@ Using Qgis ############################################################################### -.. image:: ../basic/images/pedestrian/route.png +.. image:: ../basic/images/pedestrian/pedestrian_one_to_one.png :width: 250pt :align: center diff --git a/docs/scripts/basic/pedestrian/CMakeLists.txt b/docs/scripts/basic/pedestrian/CMakeLists.txt index 14186d2d..30ade599 100644 --- a/docs/scripts/basic/pedestrian/CMakeLists.txt +++ b/docs/scripts/basic/pedestrian/CMakeLists.txt @@ -1,32 +1,31 @@ -add_custom_target(basic_pedestrian_scripts) +# Script for basic/graphs chapter +configure_file(pedestrian.sql pedestrian.sql) +configure_file(images.sql images.sql) -#--------------------- -# Files -#--------------------- -set(PGR_WORKSHOP_FILES - "pedestrian.sql" - "images.sql" - ) +set(GENERATED_FILES + combinations.txt + get_id.txt + many_to_many.txt + many_to_one.txt + note_1.txt + one_to_many.txt + one_to_one.txt + dijkstracost.txt +) -foreach (f ${PGR_WORKSHOP_FILES}) - if (PGR_WORKSHOP_VERBOSE_DEBUG) - message(STATUS " Adding file ${f}") - endif() - configure_file(${f} ${f}) -endforeach() +#---------------------------------------------- +# Generating the results files +#--------------------------------------------- add_custom_command( - TARGET basic_pedestrian_scripts - PRE_BUILD - BYPRODUCTS - exercise_5_1.txt - exercise_5_2.txt - exercise_5_3.txt - exercise_5_4.txt - exercise_5_5.txt - exercise_5_6.txt COMMAND psql -d city_routing -f pedestrian.sql COMMAND psql -d city_routing -f images.sql - COMMENT "running pedestrian scripts" + OUTPUT ${GENERATED_FILES} + + DEPENDS pedestrian.sql images.sql + COMMENT "running chapter pedestrian scripts" ) +add_custom_target(basic_pedestrian_scripts + DEPENDS ${GENERATED_FILES} +) diff --git a/docs/scripts/basic/pedestrian/images.sql b/docs/scripts/basic/pedestrian/images.sql index 7a820d84..20d7ca7e 100644 --- a/docs/scripts/basic/pedestrian/images.sql +++ b/docs/scripts/basic/pedestrian/images.sql @@ -1,5 +1,5 @@ CREATE VIEW stars AS -SELECT osm_id, id, the_geom, +SELECT osm_id, id, geom, CASE WHEN osm_id = @OSMID_1@ THEN '@PLACE_1@' WHEN osm_id = @OSMID_2@ THEN '@PLACE_2@' @@ -7,70 +7,83 @@ CASE WHEN osm_id = @OSMID_4@ THEN '@PLACE_4@' WHEN osm_id = @OSMID_5@ THEN '@PLACE_5@' END AS name -FROM ways_vertices_pgr +FROM vertices WHERE osm_id IN (@OSMID_1@, @OSMID_2@, @OSMID_3@, @OSMID_4@, @OSMID_5@) ORDER BY osm_id; -CREATE VIEW route_png AS +CREATE VIEW pedestrian_one_to_one AS WITH dijkstra AS ( SELECT * FROM pgr_dijkstra( - ' SELECT gid AS id, source, target, length AS cost FROM ways ', - @ID_1@, - @ID_3@, - directed := false) + 'SELECT id, source, target, + length AS cost + FROM walk_net', + @ID_1@, + @ID_3@, + directed := false) ) -SELECT seq, the_geom AS geom FROM dijkstra JOIN ways ON(edge = gid); +SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id); -CREATE VIEW pedestrian_route1 AS +CREATE VIEW pedestrian_many_to_one AS WITH dijkstra AS ( SELECT * FROM pgr_dijkstra( - ' SELECT gid AS id, source, target, length AS cost FROM ways ', - @ID_1@, - @ID_3@, - directed := false) + 'SELECT id, source, target, + length/1000 AS cost + FROM walk_net', + ARRAY[@ID_1@, @ID_2@], + @ID_3@, + directed := false) ) -SELECT seq, the_geom AS geom FROM dijkstra JOIN ways ON(edge = gid); +SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id); -CREATE VIEW pedestrian_route2 AS +CREATE VIEW pedestrian_one_to_many AS WITH dijkstra AS ( SELECT * FROM pgr_dijkstra( - ' SELECT gid AS id, source, target, length_m AS cost FROM ways ', - ARRAY[@ID_1@,@ID_2@], - @ID_3@, - directed := false) + 'SELECT id, source, target, + cost + FROM walk_net', + @ID_3@, + ARRAY[@ID_1@, @ID_2@], + directed := false) ) -SELECT seq, start_vid, the_geom AS geom FROM dijkstra JOIN ways ON(edge = gid); - +SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id); -CREATE VIEW pedestrian_route4 AS +CREATE VIEW pedestrian_many_to_many AS WITH dijkstra AS ( SELECT * FROM pgr_dijkstra( - ' SELECT gid AS id, source, target, length_m / 1.3 / 60 AS cost FROM ways ', - ARRAY[@ID_1@, @ID_2@], - ARRAY[@ID_4@, @ID_5@], - directed := false) + 'SELECT id, source, target, + length / 1.3 / 60 AS cost + FROM walk_net', + ARRAY[@ID_1@, @ID_2@], + ARRAY[@ID_4@, @ID_5@], + directed := false) ) -SELECT seq, start_vid, end_vid, the_geom AS geom FROM dijkstra JOIN ways ON(edge = gid); - +SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id); -CREATE VIEW pedestrian_route5 AS +CREATE VIEW pedestrian_combinations AS WITH dijkstra AS ( -SELECT start_vid, end_vid, round(agg_cost::numeric,2) AS agg_cost -FROM pgr_dijkstraCost( - ' SELECT gid AS id, source, target, length_m / 1.3 / 60 AS cost FROM ways ', - ARRAY[@ID_1@, @ID_2@], - ARRAY[@ID_4@, @ID_5@], - directed := false) + SELECT * FROM pgr_dijkstra( + 'SELECT id, source, target, + length / 1.3 / 60 AS cost + FROM walk_net', + 'SELECT * FROM (VALUES + (@ID_1@, @ID_4@), + (@ID_2@, @ID_5@)) + AS combinations (source, target)', + directed := false) ) -SELECT row_number() over() AS gid, start_vid, end_vid, agg_cost, ST_MakeLine(v1.the_geom, v2.the_geom) AS geom FROM dijkstra -JOIN ways_vertices_pgr AS v1 ON (start_vid = v1.id) -JOIN ways_vertices_pgr AS v2 ON (end_vid = v2.id); +SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id); -CREATE VIEW pedestrian_combinations AS +CREATE VIEW pedestrian_dijkstraCost AS WITH dijkstra AS ( - SELECT * FROM pgr_dijkstra( - 'SELECT gid AS id, source, target, length_m / 1.3 / 60 AS cost FROM ways', - 'SELECT * FROM (VALUES (@ID_1@, @ID_4@), (@ID_2@, @ID_5@)) AS combinations (source, target)', +SELECT start_vid, end_vid, round(agg_cost::numeric,2) AS agg_cost +FROM pgr_dijkstraCost( + 'SELECT id, source, target, + length / 1.3 / 60 AS cost + FROM walk_net', + ARRAY[@ID_1@, @ID_2@], + ARRAY[@ID_4@, @ID_5@], directed := false) ) -SELECT seq, start_vid, end_vid, the_geom AS geom FROM dijkstra JOIN ways ON(edge = gid); +SELECT row_number() over() AS gid, start_vid, end_vid, agg_cost, ST_MakeLine(v1.geom, v2.geom) AS geom FROM dijkstra +JOIN vertices AS v1 ON (start_vid = v1.id) +JOIN vertices AS v2 ON (end_vid = v2.id); diff --git a/docs/scripts/basic/pedestrian/pedestrian.sql b/docs/scripts/basic/pedestrian/pedestrian.sql index 9bf4bc0e..e6985de5 100644 --- a/docs/scripts/basic/pedestrian/pedestrian.sql +++ b/docs/scripts/basic/pedestrian/pedestrian.sql @@ -1,112 +1,71 @@ -\o exercise_5_0.txt +\o get_id.txt -SELECT osm_id, id FROM ways_vertices_pgr +SELECT osm_id, id FROM vertices WHERE osm_id IN (@OSMID_1@, @OSMID_2@, @OSMID_3@, @OSMID_4@, @OSMID_5@) ORDER BY osm_id; -\o exercise_5_1.txt +\o one_to_one.txt SELECT * FROM pgr_dijkstra( - ' - SELECT gid AS id, - source, - target, - length AS cost -- line 6 - FROM ways - ', - @ID_1@, -- line 9 - @ID_3@, -- line 10 - directed := false); -- line 11 + 'SELECT id, source, target, + length AS cost + FROM walk_net', + @ID_1@, + @ID_3@, + directed := false); -\o exercise_5_2.txt +\o many_to_one.txt SELECT * FROM pgr_dijkstra( - ' - SELECT gid AS id, - source, - target, - length_m AS cost -- line 6 - FROM ways - ', - ARRAY[@ID_1@,@ID_2@], -- line 9 - @ID_3@, -- line 10 + 'SELECT id, source, target, + length/1000 AS cost + FROM walk_net', + ARRAY[@ID_1@, @ID_2@], + @ID_3@, directed := false); -\o exercise_5_3.txt +\o one_to_many.txt SELECT * FROM pgr_dijkstra( - ' - SELECT gid AS id, - source, - target, - length_m / 1.3 AS cost -- line 6 - FROM ways - ', - @ID_3@, -- line 9 - ARRAY[@ID_1@,@ID_2@], -- line 10 + 'SELECT id, source, target, + cost + FROM walk_net', + @ID_3@, + ARRAY[@ID_1@, @ID_2@], directed := false); -\o exercise_5_4.txt +\o many_to_many.txt SELECT * FROM pgr_dijkstra( - ' - SELECT gid AS id, - source, - target, - length_m / 1.3 / 60 AS cost -- line 6 - FROM ways - ', - ARRAY[@ID_1@, @ID_2@], -- line 9 - ARRAY[@ID_4@, @ID_5@], -- line 10 + 'SELECT id, source, target, + length / 1.3 / 60 AS cost + FROM walk_net', + ARRAY[@ID_1@, @ID_2@], + ARRAY[@ID_4@, @ID_5@], directed := false); -\o exercise_5_5.txt +\o combinations.txt SELECT * FROM pgr_dijkstra( - ' - SELECT gid AS id, - source, - target, - length_m / 1.3 / 60 AS cost - FROM ways - ', - 'SELECT * FROM - (VALUES - (@ID_1@, @ID_4@), -- line 11 - (@ID_2@, @ID_5@)) -- line 12 - AS combinations (source, target)', + 'SELECT id, source, target, + length / 1.3 / 60 AS cost + FROM walk_net', + 'SELECT * FROM (VALUES + (@ID_1@, @ID_4@), + (@ID_2@, @ID_5@)) + AS combinations (source, target)', directed := false); -\o exercise_5_6.txt +\o dijkstracost.txt SELECT * FROM pgr_dijkstraCost( - ' - SELECT gid AS id, - source, - target, - length_m / 1.3 / 60 AS cost -- line 6 - FROM ways - ', - ARRAY[@ID_1@, @ID_2@], -- line 9 - ARRAY[@ID_4@, @ID_5@], -- line 10 + 'SELECT id, source, target, + length / 1.3 / 60 AS cost + FROM walk_net', + ARRAY[@ID_1@, @ID_2@], + ARRAY[@ID_4@, @ID_5@], directed := false); -\o exercise_5_7.txt - -SELECT start_vid, sum(agg_cost) FROM pgr_dijkstraCost( - ' - SELECT gid AS id, - source, - target, - length_m / 1.3 / 60 AS cost -- line 6 - FROM ways - ', - ARRAY[@ID_1@, @ID_2@], -- line 9 - ARRAY[@ID_4@, @ID_5@], -- line 10 - directed := false) -GROUP BY start_vid -ORDER BY start_vid; - \o note_1.txt \t SELECT 'Inspecting the results, looking for totals (edge = -1):'; @@ -114,11 +73,11 @@ SELECT 'Inspecting the results, looking for totals (edge = -1):'; SELECT '- From @ID_1@ to vertex @ID_4@ takes ' || round(agg_cost::numeric, 2) || ' minutes (seq = ' || seq || ')' FROM pgr_dijkstra( ' - SELECT gid AS id, + SELECT id, source, target, - length_m / 1.3 / 60 AS cost - FROM ways + length / 1.3 / 60 AS cost + FROM walk_net ', ARRAY[@ID_1@, @ID_2@], ARRAY[@ID_4@, @ID_5@], @@ -127,11 +86,11 @@ WHERE edge = -1 AND start_vid = @ID_1@ AND end_vid = @ID_4@; SELECT '- From @ID_1@ to vertex @ID_5@ takes ' || round(agg_cost::numeric, 2) || ' minutes (seq = ' || seq || ')' FROM pgr_dijkstra( ' - SELECT gid AS id, + SELECT id, source, target, - length_m / 1.3 / 60 AS cost - FROM ways + length / 1.3 / 60 AS cost + FROM walk_net ', ARRAY[@ID_1@, @ID_2@], ARRAY[@ID_4@, @ID_5@], @@ -140,11 +99,11 @@ WHERE edge = -1 AND start_vid = @ID_1@ AND end_vid = @ID_5@; SELECT '- From @ID_2@ to vertex @ID_4@ takes ' || round(agg_cost::numeric, 2) || ' minutes (seq = ' || seq || ')' FROM pgr_dijkstra( ' - SELECT gid AS id, + SELECT id, source, target, - length_m / 1.3 / 60 AS cost - FROM ways + length / 1.3 / 60 AS cost + FROM walk_net ', ARRAY[@ID_1@, @ID_2@], ARRAY[@ID_4@, @ID_5@], @@ -153,29 +112,13 @@ WHERE edge = -1 AND start_vid = @ID_2@ AND end_vid = @ID_4@; SELECT '- From @ID_2@ to vertex @ID_5@ takes ' || round(agg_cost::numeric, 2) || ' minutes (seq = ' || seq || ')' FROM pgr_dijkstra( ' - SELECT gid AS id, + SELECT id, source, target, - length_m / 1.3 / 60 AS cost - FROM ways + length / 1.3 / 60 AS cost + FROM walk_net ', ARRAY[@ID_1@, @ID_2@], ARRAY[@ID_4@, @ID_5@], directed := false) WHERE edge = -1 AND start_vid = @ID_2@ AND end_vid = @ID_5@; -\o note_2.txt -WITH summary AS (SELECT start_vid, sum(agg_cost) - FROM pgr_dijkstraCost( - 'SELECT gid AS id, source, target, length_m / 1.3 / 60 AS cost FROM ways ', - ARRAY[@ID_1@, @ID_2@], ARRAY[@ID_4@, @ID_5@], - directed := false) - GROUP BY start_vid - ORDER BY start_vid), -the_min AS (select min(sum) from summary) -SELECT -'An interpretation of the result can be: In general, it is faster to depart from "' || -CASE WHEN start_vid = @ID_1@ THEN '@PLACE_1@' WHEN start_vid = @ID_2@ THEN '@PLACE_2@' END - || '" than from "' || - CASE WHEN start_vid = @ID_1@ THEN '@PLACE_2@' WHEN start_vid = @ID_2@ THEN '@PLACE_1@' END - || '"' - FROM summary WHERE sum = (SELECT min from the_min); diff --git a/locale/en/LC_MESSAGES/basic/pedestrian.po b/locale/en/LC_MESSAGES/basic/pedestrian.po index 811d66a9..dce8a1a4 100644 --- a/locale/en/LC_MESSAGES/basic/pedestrian.po +++ b/locale/en/LC_MESSAGES/basic/pedestrian.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Workshop FOSS4G Belém 3.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-30 17:36+0000\n" +"POT-Creation-Date: 2025-10-04 19:49+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -31,39 +31,51 @@ msgid "" "added and the library was renamed to pgRouting." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:22 +#: ../../build/docs/basic/pedestrian.rst:21 +msgid "pgRouting functions in this chapter" +msgstr "" + +#: ../../build/docs/basic/pedestrian.rst:23 +msgid "`pgr_dijkstra`_" +msgstr "" + +#: ../../build/docs/basic/pedestrian.rst:24 +msgid "`pgr_dijkstraCost`_" +msgstr "" + +#: ../../build/docs/basic/pedestrian.rst:26 msgid "Chapter Contents" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:25 +#: ../../build/docs/basic/pedestrian.rst:29 msgid "pgr_dijkstra" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:27 +#: ../../build/docs/basic/pedestrian.rst:31 msgid "" "Dijkstra algorithm was the first algorithm implemented in pgRouting. It " "doesn't require other attributes than the identifiers ``id``, ``source`` and " "``target`` and the weights ``cost`` and ``reverse_cost``." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:31 +#: ../../build/docs/basic/pedestrian.rst:35 msgid "" "You can specify when to consider the graph as `directed `__ or undirected." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:35 -#: ../../build/docs/basic/pedestrian.rst:282 +#: ../../build/docs/basic/pedestrian.rst:39 +#: ../../build/docs/basic/pedestrian.rst:285 msgid "Signature Summary" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:47 +#: ../../build/docs/basic/pedestrian.rst:51 msgid "" "Description of the function can be found in `pgr_dijkstra `__." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:51 +#: ../../build/docs/basic/pedestrian.rst:55 msgid "" "Many pgRouting functions have ``sql::text`` as one of their arguments. While " "this may look confusing at first, it makes the functions very flexible as " @@ -72,269 +84,254 @@ msgid "" "attribute names." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:56 +#: ../../build/docs/basic/pedestrian.rst:60 msgid "" "Most of pgRouting implemented algorithms do not require the **geometry**." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:57 +#: ../../build/docs/basic/pedestrian.rst:61 msgid "" "The pgRouting functions **do not** return a geometry, but only an ordered " "list of nodes or edges." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:61 +#: ../../build/docs/basic/pedestrian.rst:65 msgid "Identifiers for the Queries" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:62 +#: ../../build/docs/basic/pedestrian.rst:66 msgid "" "The assignment of the vertices identifiers on the source and target columns " "may be different, the following exercises will use the results of this " "query. For the workshop, some locations near of the FOSS4G event are going " "to be used. These locations are within this area https://www.openstreetmap." -"org/#map=14/-1.44228/-48.46069" +"org/#map=16/-36.8520950/174.7631803" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:67 +#: ../../build/docs/basic/pedestrian.rst:71 msgid "|osmid_1| |place_1|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:68 +#: ../../build/docs/basic/pedestrian.rst:72 msgid "|osmid_2| |place_2|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:69 +#: ../../build/docs/basic/pedestrian.rst:73 msgid "|osmid_3| |place_3|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:70 +#: ../../build/docs/basic/pedestrian.rst:74 msgid "|osmid_4| |place_4|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:71 +#: ../../build/docs/basic/pedestrian.rst:75 msgid "|osmid_5| |place_5|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:74 +#: ../../build/docs/basic/pedestrian.rst:78 msgid "Connect to the database, if not connected:" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:80 +#: ../../build/docs/basic/pedestrian.rst:84 msgid "Get the vertex identifiers" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:91 +#: ../../build/docs/basic/pedestrian.rst:95 msgid "|osmid_1| |place_1| (|id_1|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:92 +#: ../../build/docs/basic/pedestrian.rst:96 msgid "|osmid_2| |place_2| (|id_2|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:93 +#: ../../build/docs/basic/pedestrian.rst:97 msgid "|osmid_3| |place_3| (|id_3|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:94 +#: ../../build/docs/basic/pedestrian.rst:98 msgid "|osmid_4| |place_4| (|id_4|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:95 +#: ../../build/docs/basic/pedestrian.rst:99 msgid "|osmid_5| |place_5| (|id_5|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:98 +#: ../../build/docs/basic/pedestrian.rst:102 msgid "" "The corresponding :code:`id` are shown in the following image, and a sample " -"route from \"|place_3|\" to \"|place_5|\"." +"route from \"|place_3|\" to \"|place_1|\"." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:105 +#: ../../build/docs/basic/pedestrian.rst:109 msgid "Exercise 1: Single pedestrian routing" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:108 -#: ../../build/docs/basic/pedestrian.rst:150 -#: ../../build/docs/basic/pedestrian.rst:182 -#: ../../build/docs/basic/pedestrian.rst:214 -#: ../../build/docs/basic/pedestrian.rst:248 -#: ../../build/docs/basic/pedestrian.rst:302 -#: ../../build/docs/basic/pedestrian.rst:338 +#: ../../build/docs/basic/pedestrian.rst:112 +#: ../../build/docs/basic/pedestrian.rst:152 +#: ../../build/docs/basic/pedestrian.rst:183 +#: ../../build/docs/basic/pedestrian.rst:218 +#: ../../build/docs/basic/pedestrian.rst:251 +#: ../../build/docs/basic/pedestrian.rst:305 msgid "Problem:" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:109 -#: ../../build/docs/basic/pedestrian.rst:151 -#: ../../build/docs/basic/pedestrian.rst:183 -#: ../../build/docs/basic/pedestrian.rst:215 -#: ../../build/docs/basic/pedestrian.rst:249 -#: ../../build/docs/basic/pedestrian.rst:303 -#: ../../build/docs/basic/pedestrian.rst:339 +#: ../../build/docs/basic/pedestrian.rst:113 +#: ../../build/docs/basic/pedestrian.rst:153 +#: ../../build/docs/basic/pedestrian.rst:184 +#: ../../build/docs/basic/pedestrian.rst:219 +#: ../../build/docs/basic/pedestrian.rst:252 +#: ../../build/docs/basic/pedestrian.rst:306 msgid "Walking" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:111 +#: ../../build/docs/basic/pedestrian.rst:115 msgid "from \"|place_1|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:112 +#: ../../build/docs/basic/pedestrian.rst:116 msgid "to \"|place_3|\"." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:114 -msgid "" -"Calculate routes with costs in *osm2pgRouting* ``length`` default units." -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:116 -msgid "From the |place_1| to the |place_3|" +#: ../../build/docs/basic/pedestrian.rst:118 +msgid "Calculate routes with costs in ``length`` in meters." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:121 -#: ../../build/docs/basic/pedestrian.rst:163 -#: ../../build/docs/basic/pedestrian.rst:194 -#: ../../build/docs/basic/pedestrian.rst:226 -#: ../../build/docs/basic/pedestrian.rst:260 -#: ../../build/docs/basic/pedestrian.rst:315 -#: ../../build/docs/basic/pedestrian.rst:347 +#: ../../build/docs/basic/pedestrian.rst:124 +#: ../../build/docs/basic/pedestrian.rst:164 +#: ../../build/docs/basic/pedestrian.rst:198 +#: ../../build/docs/basic/pedestrian.rst:230 +#: ../../build/docs/basic/pedestrian.rst:263 +#: ../../build/docs/basic/pedestrian.rst:317 msgid "Solution:" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:122 +#: ../../build/docs/basic/pedestrian.rst:125 msgid "" -"The pedestrian wants to go from vertex |id_1| to vertex |id_3| (lines **9** " -"and **10**)." +"The pedestrian wants to go from vertex |id_1| to vertex |id_3| (lines **5** " +"and **6**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:123 +#: ../../build/docs/basic/pedestrian.rst:126 msgid "" "The pedestrian's cost is in terms of length. In this case ``length`` (line " -"**6**), which was calculated by osm2pgrouting, is in unit ``degrees``." +"**3**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:125 +#: ../../build/docs/basic/pedestrian.rst:127 msgid "" -"From a pedestrian perspective the graph is ``undirected`` (line **11**), " -"that is, the pedestrian can move in both directions on all segments." +"From a pedestrian perspective the graph is ``undirected`` (line **7**), that " +"is, the pedestrian can move in both directions on all segments." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:139 +#: ../../build/docs/basic/pedestrian.rst:141 msgid "" "The returned cost attribute represents the cost specified in the inner SQL " "query (``edges_sql::text`` argument). In this example cost is ``length`` in " -"unit \"degrees\". Cost may be time, distance or any combination of both or " +"unit \"meters\". Cost may be time, distance or any combination of both or " "any other attributes or a custom formula." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:143 +#: ../../build/docs/basic/pedestrian.rst:145 msgid "" "``node`` and ``edge`` results may vary depending on the assignment of the " "identifiers to the vertices given by osm2pgrouting." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:147 +#: ../../build/docs/basic/pedestrian.rst:149 msgid "Exercise 2: Many Pedestrians going to the same destination" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:153 -#: ../../build/docs/basic/pedestrian.rst:217 +#: ../../build/docs/basic/pedestrian.rst:155 +#: ../../build/docs/basic/pedestrian.rst:221 msgid "from \"|place_1|\" and \"|place_2|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:154 -msgid "to the \"|place_3|\"." -msgstr "" - #: ../../build/docs/basic/pedestrian.rst:156 -msgid "" -"Calculate routes with costs in *osm2pgRouting* ``length_m`` which is in " -"meters." +msgid "to the \"|place_3|\"." msgstr "" #: ../../build/docs/basic/pedestrian.rst:158 -msgid "From |place_1| and |place_2| to |place_3|" +msgid "Calculate routes with costs in ``length`` in kilometers." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:164 +#: ../../build/docs/basic/pedestrian.rst:165 msgid "" -"The pedestrians are departing at vertices |id_1| and |id_2| (line **9**)." +"The pedestrians are departing at vertices |id_1| and |id_2| (line **5**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:165 -msgid "All pedestrians want to go to vertex |id_3| (line **10**)." +#: ../../build/docs/basic/pedestrian.rst:166 +msgid "All pedestrians want to go to vertex |id_3| (line **6**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:166 -msgid "The cost to be in meters using attribute ``length_m`` (line **6**)." +#: ../../build/docs/basic/pedestrian.rst:167 +msgid "The cost to be in kilometers using attribute ``length`` (line **3**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:179 +#: ../../build/docs/basic/pedestrian.rst:180 msgid "Exercise 3: Many Pedestrians departing from the same location" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:185 +#: ../../build/docs/basic/pedestrian.rst:186 msgid "from \"|place_3|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:186 +#: ../../build/docs/basic/pedestrian.rst:187 msgid "to \"|place_1|\" and \"|place_2|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:188 -msgid "Calculate routes with costs in seconds." +#: ../../build/docs/basic/pedestrian.rst:189 +msgid "" +"Calculate routes using the ``cost`` which is in seconds for a walking speed " +"of ``2 mts/sec``." +msgstr "" + +#: ../../build/docs/basic/pedestrian.rst:192 +msgid "See :doc:`graphs` for the costs setup." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:195 -msgid "All pedestrians are departing from vertex |id_3| (line **9**)." +#: ../../build/docs/basic/pedestrian.rst:199 +msgid "All pedestrians are departing from vertex |id_3| (line **5**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:196 -msgid "Pedestrians want to go to locations |id_1| and |id_2| (line **10**)." +#: ../../build/docs/basic/pedestrian.rst:200 +msgid "Pedestrians want to go to locations |id_1| and |id_2| (line **6**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:197 -msgid "" -"The cost to be in seconds, with a walking speed ``s = 1.3 m/s`` and ``t = d/" -"s`` (line **6**)." +#: ../../build/docs/basic/pedestrian.rst:201 +msgid "The ``cost`` column on ``walk_net`` is in seconds. (line **3**)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:211 +#: ../../build/docs/basic/pedestrian.rst:215 msgid "Exercise 4: Many Pedestrians going to different destinations" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:218 +#: ../../build/docs/basic/pedestrian.rst:222 msgid "to \"|place_4|\" and \"|place_5|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:220 -#: ../../build/docs/basic/pedestrian.rst:254 -msgid "Calculate routes with costs in minutes." +#: ../../build/docs/basic/pedestrian.rst:224 +#: ../../build/docs/basic/pedestrian.rst:257 +msgid "" +"Calculate routes with costs in minutes at walking speed ``s = 1.3 m/s``." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:227 -#: ../../build/docs/basic/pedestrian.rst:316 -#: ../../build/docs/basic/pedestrian.rst:348 -msgid "The pedestrians depart from |id_1| and |id_2| (line **9**)." +#: ../../build/docs/basic/pedestrian.rst:231 +#: ../../build/docs/basic/pedestrian.rst:318 +msgid "The pedestrians depart from |id_1| and |id_2| (line **5**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:228 -#: ../../build/docs/basic/pedestrian.rst:317 -#: ../../build/docs/basic/pedestrian.rst:349 +#: ../../build/docs/basic/pedestrian.rst:232 +#: ../../build/docs/basic/pedestrian.rst:319 msgid "" -"The pedestrians want to go to destinations |id_4| and |id_5| (line **10**)." +"The pedestrians want to go to destinations |id_4| and |id_5| (line **6**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:229 -#: ../../build/docs/basic/pedestrian.rst:318 +#: ../../build/docs/basic/pedestrian.rst:233 +#: ../../build/docs/basic/pedestrian.rst:266 +#: ../../build/docs/basic/pedestrian.rst:320 msgid "" "The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/" -"s`` (line **6**)." -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:230 -#: ../../build/docs/basic/pedestrian.rst:351 -msgid "Result adds the costs per destination." +"s``." msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:1 @@ -342,119 +339,85 @@ msgid "Inspecting the results, looking for totals (edge = -1):" msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:3 -msgid "From 10840 to vertex 10928 takes 9.61 minutes (seq = 120)" +msgid "From 10840 to vertex 10928 takes 9.82 minutes (seq = 134)" msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:5 -msgid "From 10840 to vertex 12777 takes 10.44 minutes (seq = 163)" +msgid "From 10840 to vertex 12777 takes 10.85 minutes (seq = 185)" msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:7 -msgid "From 936 to vertex 10928 takes 8.94 minutes (seq = 34)" +msgid "From 936 to vertex 10928 takes 9.20 minutes (seq = 50)" msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:9 -msgid "From 936 to vertex 12777 takes 8.90 minutes (seq = 69)" +msgid "From 936 to vertex 12777 takes 9.04 minutes (seq = 85)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:245 +#: ../../build/docs/basic/pedestrian.rst:248 msgid "Exercise 5: Combination of routes" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:251 +#: ../../build/docs/basic/pedestrian.rst:254 msgid "First pedestrian goes from \"|place_1|\" to \"|place_4|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:252 +#: ../../build/docs/basic/pedestrian.rst:255 msgid "Second pedestrian goes from \"|place_2|\" to \"|place_5|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:261 +#: ../../build/docs/basic/pedestrian.rst:264 msgid "" "First pedestrian departs from |id_1| and the destination is |id_4| (line " -"**11**)." +"**6**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:262 +#: ../../build/docs/basic/pedestrian.rst:265 msgid "" "Second pedestrian departs from |id_2| and the destination is |id_5| (line " -"**12**)." -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:263 -msgid "" -"The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/" -"s``" +"**7**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:276 +#: ../../build/docs/basic/pedestrian.rst:279 msgid "pgr_dijkstraCost" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:278 +#: ../../build/docs/basic/pedestrian.rst:281 msgid "" "When the main goal is to calculate the total cost, without \"inspecting\" " "the `pgr_dijkstra` results, using ``pgr_dijkstraCost`` returns a more " "compact result." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:294 +#: ../../build/docs/basic/pedestrian.rst:297 msgid "" "Description of the parameters can be found in `pgr_dijkstraCost `__" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:299 +#: ../../build/docs/basic/pedestrian.rst:302 msgid "Exercise 6: Time for many Pedestrians going to different destinations" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:305 -#: ../../build/docs/basic/pedestrian.rst:341 +#: ../../build/docs/basic/pedestrian.rst:308 msgid "from \"|place_1|\" or \"|place_2|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:306 -#: ../../build/docs/basic/pedestrian.rst:342 +#: ../../build/docs/basic/pedestrian.rst:309 msgid "to \"|place_4|\" or \"|place_5|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:308 +#: ../../build/docs/basic/pedestrian.rst:311 msgid "Get only the cost in minutes." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:310 -msgid "From the hotels to the |place_4| and |place_5|" -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:319 +#: ../../build/docs/basic/pedestrian.rst:321 msgid "Result as aggregated costs." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:331 +#: ../../build/docs/basic/pedestrian.rst:333 msgid "" "Compare with `Exercise 4: Many Pedestrians going to different destinations`_ " "'s note." msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:335 -msgid "" -"Exercise 7: Many Pedestrians going to different destinations summarizing the " -"total costs per departure" -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:344 -msgid "Summarize cost in minutes." -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:350 -msgid "" -"The cost to be in minutes, with a walking speed s = 1.3 m/s and t = d/s " -"(line **6**)." -msgstr "" - -#: ../../build/docs/scripts/basic/pedestrian/note_2.txt:1 -msgid "" -"An interpretation of the result can be: In general, it is faster to depart " -"from \"The Band Rotunda\" than from \"Auckland University of Technology\"" -msgstr "" diff --git a/locale/pot/basic/pedestrian.pot b/locale/pot/basic/pedestrian.pot index af81feb5..487bf3b4 100644 --- a/locale/pot/basic/pedestrian.pot +++ b/locale/pot/basic/pedestrian.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Workshop FOSS4G Auckland 3.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-30 17:36+0000\n" +"POT-Creation-Date: 2025-10-04 19:49+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,267 +24,266 @@ msgstr "" msgid "**pgRouting** was first called *pgDijkstra*, because it implemented only shortest path search with *Dijkstra* algorithm. Later other functions were added and the library was renamed to pgRouting." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:22 +#: ../../build/docs/basic/pedestrian.rst:21 +msgid "pgRouting functions in this chapter" +msgstr "" + +#: ../../build/docs/basic/pedestrian.rst:23 +msgid "`pgr_dijkstra`_" +msgstr "" + +#: ../../build/docs/basic/pedestrian.rst:24 +msgid "`pgr_dijkstraCost`_" +msgstr "" + +#: ../../build/docs/basic/pedestrian.rst:26 msgid "Chapter Contents" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:25 +#: ../../build/docs/basic/pedestrian.rst:29 msgid "pgr_dijkstra" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:27 +#: ../../build/docs/basic/pedestrian.rst:31 msgid "Dijkstra algorithm was the first algorithm implemented in pgRouting. It doesn't require other attributes than the identifiers ``id``, ``source`` and ``target`` and the weights ``cost`` and ``reverse_cost``." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:31 +#: ../../build/docs/basic/pedestrian.rst:35 msgid "You can specify when to consider the graph as `directed `__ or undirected." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:35 -#: ../../build/docs/basic/pedestrian.rst:282 +#: ../../build/docs/basic/pedestrian.rst:39 +#: ../../build/docs/basic/pedestrian.rst:285 msgid "Signature Summary" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:47 +#: ../../build/docs/basic/pedestrian.rst:51 msgid "Description of the function can be found in `pgr_dijkstra `__." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:51 +#: ../../build/docs/basic/pedestrian.rst:55 msgid "Many pgRouting functions have ``sql::text`` as one of their arguments. While this may look confusing at first, it makes the functions very flexible as the user can pass a ``SELECT`` statement as function argument as long as the returned result contains the required number of attributes and the correct attribute names." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:56 +#: ../../build/docs/basic/pedestrian.rst:60 msgid "Most of pgRouting implemented algorithms do not require the **geometry**." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:57 +#: ../../build/docs/basic/pedestrian.rst:61 msgid "The pgRouting functions **do not** return a geometry, but only an ordered list of nodes or edges." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:61 +#: ../../build/docs/basic/pedestrian.rst:65 msgid "Identifiers for the Queries" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:62 -msgid "The assignment of the vertices identifiers on the source and target columns may be different, the following exercises will use the results of this query. For the workshop, some locations near of the FOSS4G event are going to be used. These locations are within this area https://www.openstreetmap.org/#map=14/-1.44228/-48.46069" +#: ../../build/docs/basic/pedestrian.rst:66 +msgid "The assignment of the vertices identifiers on the source and target columns may be different, the following exercises will use the results of this query. For the workshop, some locations near of the FOSS4G event are going to be used. These locations are within this area https://www.openstreetmap.org/#map=16/-36.8520950/174.7631803" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:67 +#: ../../build/docs/basic/pedestrian.rst:71 msgid "|osmid_1| |place_1|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:68 +#: ../../build/docs/basic/pedestrian.rst:72 msgid "|osmid_2| |place_2|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:69 +#: ../../build/docs/basic/pedestrian.rst:73 msgid "|osmid_3| |place_3|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:70 +#: ../../build/docs/basic/pedestrian.rst:74 msgid "|osmid_4| |place_4|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:71 +#: ../../build/docs/basic/pedestrian.rst:75 msgid "|osmid_5| |place_5|" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:74 +#: ../../build/docs/basic/pedestrian.rst:78 msgid "Connect to the database, if not connected:" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:80 +#: ../../build/docs/basic/pedestrian.rst:84 msgid "Get the vertex identifiers" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:91 +#: ../../build/docs/basic/pedestrian.rst:95 msgid "|osmid_1| |place_1| (|id_1|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:92 +#: ../../build/docs/basic/pedestrian.rst:96 msgid "|osmid_2| |place_2| (|id_2|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:93 +#: ../../build/docs/basic/pedestrian.rst:97 msgid "|osmid_3| |place_3| (|id_3|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:94 +#: ../../build/docs/basic/pedestrian.rst:98 msgid "|osmid_4| |place_4| (|id_4|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:95 +#: ../../build/docs/basic/pedestrian.rst:99 msgid "|osmid_5| |place_5| (|id_5|)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:98 -msgid "The corresponding :code:`id` are shown in the following image, and a sample route from \"|place_3|\" to \"|place_5|\"." +#: ../../build/docs/basic/pedestrian.rst:102 +msgid "The corresponding :code:`id` are shown in the following image, and a sample route from \"|place_3|\" to \"|place_1|\"." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:105 +#: ../../build/docs/basic/pedestrian.rst:109 msgid "Exercise 1: Single pedestrian routing" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:108 -#: ../../build/docs/basic/pedestrian.rst:150 -#: ../../build/docs/basic/pedestrian.rst:182 -#: ../../build/docs/basic/pedestrian.rst:214 -#: ../../build/docs/basic/pedestrian.rst:248 -#: ../../build/docs/basic/pedestrian.rst:302 -#: ../../build/docs/basic/pedestrian.rst:338 +#: ../../build/docs/basic/pedestrian.rst:112 +#: ../../build/docs/basic/pedestrian.rst:152 +#: ../../build/docs/basic/pedestrian.rst:183 +#: ../../build/docs/basic/pedestrian.rst:218 +#: ../../build/docs/basic/pedestrian.rst:251 +#: ../../build/docs/basic/pedestrian.rst:305 msgid "Problem:" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:109 -#: ../../build/docs/basic/pedestrian.rst:151 -#: ../../build/docs/basic/pedestrian.rst:183 -#: ../../build/docs/basic/pedestrian.rst:215 -#: ../../build/docs/basic/pedestrian.rst:249 -#: ../../build/docs/basic/pedestrian.rst:303 -#: ../../build/docs/basic/pedestrian.rst:339 +#: ../../build/docs/basic/pedestrian.rst:113 +#: ../../build/docs/basic/pedestrian.rst:153 +#: ../../build/docs/basic/pedestrian.rst:184 +#: ../../build/docs/basic/pedestrian.rst:219 +#: ../../build/docs/basic/pedestrian.rst:252 +#: ../../build/docs/basic/pedestrian.rst:306 msgid "Walking" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:111 +#: ../../build/docs/basic/pedestrian.rst:115 msgid "from \"|place_1|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:112 +#: ../../build/docs/basic/pedestrian.rst:116 msgid "to \"|place_3|\"." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:114 -msgid "Calculate routes with costs in *osm2pgRouting* ``length`` default units." -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:116 -msgid "From the |place_1| to the |place_3|" +#: ../../build/docs/basic/pedestrian.rst:118 +msgid "Calculate routes with costs in ``length`` in meters." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:121 -#: ../../build/docs/basic/pedestrian.rst:163 -#: ../../build/docs/basic/pedestrian.rst:194 -#: ../../build/docs/basic/pedestrian.rst:226 -#: ../../build/docs/basic/pedestrian.rst:260 -#: ../../build/docs/basic/pedestrian.rst:315 -#: ../../build/docs/basic/pedestrian.rst:347 +#: ../../build/docs/basic/pedestrian.rst:124 +#: ../../build/docs/basic/pedestrian.rst:164 +#: ../../build/docs/basic/pedestrian.rst:198 +#: ../../build/docs/basic/pedestrian.rst:230 +#: ../../build/docs/basic/pedestrian.rst:263 +#: ../../build/docs/basic/pedestrian.rst:317 msgid "Solution:" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:122 -msgid "The pedestrian wants to go from vertex |id_1| to vertex |id_3| (lines **9** and **10**)." +#: ../../build/docs/basic/pedestrian.rst:125 +msgid "The pedestrian wants to go from vertex |id_1| to vertex |id_3| (lines **5** and **6**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:123 -msgid "The pedestrian's cost is in terms of length. In this case ``length`` (line **6**), which was calculated by osm2pgrouting, is in unit ``degrees``." +#: ../../build/docs/basic/pedestrian.rst:126 +msgid "The pedestrian's cost is in terms of length. In this case ``length`` (line **3**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:125 -msgid "From a pedestrian perspective the graph is ``undirected`` (line **11**), that is, the pedestrian can move in both directions on all segments." +#: ../../build/docs/basic/pedestrian.rst:127 +msgid "From a pedestrian perspective the graph is ``undirected`` (line **7**), that is, the pedestrian can move in both directions on all segments." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:139 -msgid "The returned cost attribute represents the cost specified in the inner SQL query (``edges_sql::text`` argument). In this example cost is ``length`` in unit \"degrees\". Cost may be time, distance or any combination of both or any other attributes or a custom formula." +#: ../../build/docs/basic/pedestrian.rst:141 +msgid "The returned cost attribute represents the cost specified in the inner SQL query (``edges_sql::text`` argument). In this example cost is ``length`` in unit \"meters\". Cost may be time, distance or any combination of both or any other attributes or a custom formula." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:143 +#: ../../build/docs/basic/pedestrian.rst:145 msgid "``node`` and ``edge`` results may vary depending on the assignment of the identifiers to the vertices given by osm2pgrouting." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:147 +#: ../../build/docs/basic/pedestrian.rst:149 msgid "Exercise 2: Many Pedestrians going to the same destination" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:153 -#: ../../build/docs/basic/pedestrian.rst:217 +#: ../../build/docs/basic/pedestrian.rst:155 +#: ../../build/docs/basic/pedestrian.rst:221 msgid "from \"|place_1|\" and \"|place_2|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:154 -msgid "to the \"|place_3|\"." -msgstr "" - #: ../../build/docs/basic/pedestrian.rst:156 -msgid "Calculate routes with costs in *osm2pgRouting* ``length_m`` which is in meters." +msgid "to the \"|place_3|\"." msgstr "" #: ../../build/docs/basic/pedestrian.rst:158 -msgid "From |place_1| and |place_2| to |place_3|" -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:164 -msgid "The pedestrians are departing at vertices |id_1| and |id_2| (line **9**)." +msgid "Calculate routes with costs in ``length`` in kilometers." msgstr "" #: ../../build/docs/basic/pedestrian.rst:165 -msgid "All pedestrians want to go to vertex |id_3| (line **10**)." +msgid "The pedestrians are departing at vertices |id_1| and |id_2| (line **5**)." msgstr "" #: ../../build/docs/basic/pedestrian.rst:166 -msgid "The cost to be in meters using attribute ``length_m`` (line **6**)." +msgid "All pedestrians want to go to vertex |id_3| (line **6**)." +msgstr "" + +#: ../../build/docs/basic/pedestrian.rst:167 +msgid "The cost to be in kilometers using attribute ``length`` (line **3**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:179 +#: ../../build/docs/basic/pedestrian.rst:180 msgid "Exercise 3: Many Pedestrians departing from the same location" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:185 +#: ../../build/docs/basic/pedestrian.rst:186 msgid "from \"|place_3|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:186 +#: ../../build/docs/basic/pedestrian.rst:187 msgid "to \"|place_1|\" and \"|place_2|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:188 -msgid "Calculate routes with costs in seconds." +#: ../../build/docs/basic/pedestrian.rst:189 +msgid "Calculate routes using the ``cost`` which is in seconds for a walking speed of ``2 mts/sec``." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:195 -msgid "All pedestrians are departing from vertex |id_3| (line **9**)." +#: ../../build/docs/basic/pedestrian.rst:192 +msgid "See :doc:`graphs` for the costs setup." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:196 -msgid "Pedestrians want to go to locations |id_1| and |id_2| (line **10**)." +#: ../../build/docs/basic/pedestrian.rst:199 +msgid "All pedestrians are departing from vertex |id_3| (line **5**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:197 -msgid "The cost to be in seconds, with a walking speed ``s = 1.3 m/s`` and ``t = d/s`` (line **6**)." +#: ../../build/docs/basic/pedestrian.rst:200 +msgid "Pedestrians want to go to locations |id_1| and |id_2| (line **6**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:211 -msgid "Exercise 4: Many Pedestrians going to different destinations" +#: ../../build/docs/basic/pedestrian.rst:201 +msgid "The ``cost`` column on ``walk_net`` is in seconds. (line **3**)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:218 -msgid "to \"|place_4|\" and \"|place_5|\"" +#: ../../build/docs/basic/pedestrian.rst:215 +msgid "Exercise 4: Many Pedestrians going to different destinations" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:220 -#: ../../build/docs/basic/pedestrian.rst:254 -msgid "Calculate routes with costs in minutes." +#: ../../build/docs/basic/pedestrian.rst:222 +msgid "to \"|place_4|\" and \"|place_5|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:227 -#: ../../build/docs/basic/pedestrian.rst:316 -#: ../../build/docs/basic/pedestrian.rst:348 -msgid "The pedestrians depart from |id_1| and |id_2| (line **9**)." +#: ../../build/docs/basic/pedestrian.rst:224 +#: ../../build/docs/basic/pedestrian.rst:257 +msgid "Calculate routes with costs in minutes at walking speed ``s = 1.3 m/s``." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:228 -#: ../../build/docs/basic/pedestrian.rst:317 -#: ../../build/docs/basic/pedestrian.rst:349 -msgid "The pedestrians want to go to destinations |id_4| and |id_5| (line **10**)." +#: ../../build/docs/basic/pedestrian.rst:231 +#: ../../build/docs/basic/pedestrian.rst:318 +msgid "The pedestrians depart from |id_1| and |id_2| (line **5**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:229 -#: ../../build/docs/basic/pedestrian.rst:318 -msgid "The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/s`` (line **6**)." +#: ../../build/docs/basic/pedestrian.rst:232 +#: ../../build/docs/basic/pedestrian.rst:319 +msgid "The pedestrians want to go to destinations |id_4| and |id_5| (line **6**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:230 -#: ../../build/docs/basic/pedestrian.rst:351 -msgid "Result adds the costs per destination." +#: ../../build/docs/basic/pedestrian.rst:233 +#: ../../build/docs/basic/pedestrian.rst:266 +#: ../../build/docs/basic/pedestrian.rst:320 +msgid "The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/s``." msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:1 @@ -292,99 +291,73 @@ msgid "Inspecting the results, looking for totals (edge = -1):" msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:3 -msgid "From 10840 to vertex 10928 takes 9.61 minutes (seq = 120)" +msgid "From 10840 to vertex 10928 takes 9.82 minutes (seq = 134)" msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:5 -msgid "From 10840 to vertex 12777 takes 10.44 minutes (seq = 163)" +msgid "From 10840 to vertex 12777 takes 10.85 minutes (seq = 185)" msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:7 -msgid "From 936 to vertex 10928 takes 8.94 minutes (seq = 34)" +msgid "From 936 to vertex 10928 takes 9.20 minutes (seq = 50)" msgstr "" #: ../../build/docs/scripts/basic/pedestrian/note_1.txt:9 -msgid "From 936 to vertex 12777 takes 8.90 minutes (seq = 69)" +msgid "From 936 to vertex 12777 takes 9.04 minutes (seq = 85)" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:245 +#: ../../build/docs/basic/pedestrian.rst:248 msgid "Exercise 5: Combination of routes" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:251 +#: ../../build/docs/basic/pedestrian.rst:254 msgid "First pedestrian goes from \"|place_1|\" to \"|place_4|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:252 +#: ../../build/docs/basic/pedestrian.rst:255 msgid "Second pedestrian goes from \"|place_2|\" to \"|place_5|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:261 -msgid "First pedestrian departs from |id_1| and the destination is |id_4| (line **11**)." -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:262 -msgid "Second pedestrian departs from |id_2| and the destination is |id_5| (line **12**)." +#: ../../build/docs/basic/pedestrian.rst:264 +msgid "First pedestrian departs from |id_1| and the destination is |id_4| (line **6**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:263 -msgid "The cost to be in minutes, with a walking speed ``s = 1.3 m/s`` and ``t = d/s``" +#: ../../build/docs/basic/pedestrian.rst:265 +msgid "Second pedestrian departs from |id_2| and the destination is |id_5| (line **7**)." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:276 +#: ../../build/docs/basic/pedestrian.rst:279 msgid "pgr_dijkstraCost" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:278 +#: ../../build/docs/basic/pedestrian.rst:281 msgid "When the main goal is to calculate the total cost, without \"inspecting\" the `pgr_dijkstra` results, using ``pgr_dijkstraCost`` returns a more compact result." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:294 +#: ../../build/docs/basic/pedestrian.rst:297 msgid "Description of the parameters can be found in `pgr_dijkstraCost `__" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:299 +#: ../../build/docs/basic/pedestrian.rst:302 msgid "Exercise 6: Time for many Pedestrians going to different destinations" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:305 -#: ../../build/docs/basic/pedestrian.rst:341 +#: ../../build/docs/basic/pedestrian.rst:308 msgid "from \"|place_1|\" or \"|place_2|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:306 -#: ../../build/docs/basic/pedestrian.rst:342 +#: ../../build/docs/basic/pedestrian.rst:309 msgid "to \"|place_4|\" or \"|place_5|\"" msgstr "" -#: ../../build/docs/basic/pedestrian.rst:308 +#: ../../build/docs/basic/pedestrian.rst:311 msgid "Get only the cost in minutes." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:310 -msgid "From the hotels to the |place_4| and |place_5|" -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:319 +#: ../../build/docs/basic/pedestrian.rst:321 msgid "Result as aggregated costs." msgstr "" -#: ../../build/docs/basic/pedestrian.rst:331 +#: ../../build/docs/basic/pedestrian.rst:333 msgid "Compare with `Exercise 4: Many Pedestrians going to different destinations`_ 's note." msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:335 -msgid "Exercise 7: Many Pedestrians going to different destinations summarizing the total costs per departure" -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:344 -msgid "Summarize cost in minutes." -msgstr "" - -#: ../../build/docs/basic/pedestrian.rst:350 -msgid "The cost to be in minutes, with a walking speed s = 1.3 m/s and t = d/s (line **6**)." -msgstr "" - -#: ../../build/docs/scripts/basic/pedestrian/note_2.txt:1 -msgid "An interpretation of the result can be: In general, it is faster to depart from \"The Band Rotunda\" than from \"Auckland University of Technology\"" -msgstr ""