diff --git a/REQUIREMENTS.txt b/REQUIREMENTS.txt index 7f8bb9084..37608c95d 100644 --- a/REQUIREMENTS.txt +++ b/REQUIREMENTS.txt @@ -2,3 +2,4 @@ Sphinx>4.0.0 sphinx_bootstrap_theme>=0.4 sphinx-intl sphinx-collapse +sphinx-copybutton diff --git a/docs/basic/CMakeLists.txt b/docs/basic/CMakeLists.txt index 6c733c363..c91fa0ad7 100644 --- a/docs/basic/CMakeLists.txt +++ b/docs/basic/CMakeLists.txt @@ -7,9 +7,9 @@ add_dependencies(basic scripts) #--------------------- set(PGR_WORKSHOP_FILES data.rst + graphs.rst pedestrian.rst vehicle.rst - graphs.rst sql_function.rst plpgsql_function.rst ) diff --git a/docs/basic/graphs.rst b/docs/basic/graphs.rst index 9e1e8657f..6246380da 100644 --- a/docs/basic/graphs.rst +++ b/docs/basic/graphs.rst @@ -8,10 +8,10 @@ **************************************************************************** -Graph views +Graphs ############################################################################### -.. image:: images/pedestrian/route.png +.. image:: images/graphs/taxi_net.png :scale: 25% :align: center @@ -20,13 +20,19 @@ Graph views Different application require different graphs. This chapter covers how to discard disconnected segments and different approaches to create graphs. +pgRouting functions in this chapter + +- `pgr_extractVertices`_ +- `pgr_connectedComponents`_ +- `pgr_dijkstraCostMatrix`_ + The graph requirements =============================================================================== In this chapter there are three graph requirements. It consists on three graphs based on a **fully connected** graph derived from ``ways``: two for different types of vehicles and one for pedestrian, the source and the target in all of them are -based on the ``source_osm`` and ``target_osm``. +based on the ``source`` and ``target``. The description of the graphs: @@ -34,7 +40,7 @@ The description of the graphs: - Circulate on the whole @PGR_WORKSHOP_CITY@ area. - - Do not use `steps`, `footway`, `path`, `cycleway`. + - Do not use `pedestrian`, `steps`, `footway`, `path`, `cycleway` - Speed is the default speed from OSM information. @@ -43,24 +49,84 @@ The description of the graphs: - Circulate on a smaller area: - Bounding box: ``(@PGR_WORKSHOP_LITTLE_NET_BBOX@)`` - - Do not use `steps`, `footway`, `path`, `cycleway`. + - Do not use `pedestrian`, `steps`, `footway`, `path`, `cycleway` - Speed is 10% slower than that of the particular vehicles. - Pedestrians: - Walk on the whole @PGR_WORKSHOP_CITY@ area. - - Can not walk on exclusive vehicle ways + - Can only use pedestrian only ways: - - `motorways` and on `primary` segments. + - `pedestrian`, `steps`, `footway`, `path`, `cycleway` - - The speed is ``2 mts/sec``. + - The walking speed is ``2 mts/sec``. + +Configuration from osm2pgrouting +================================================================================ + +When dealing with data, being aware of what kind of data is being used can +improve results. + +* Vehicles can not circulate on pedestrian ways + +.. image:: images/graphs/pedestrian_only_roads.png + :scale: 25% + +| + +Penalizing or removal of pedestrian ways will make the results closer to reality. + +When converting data from OSM format using the `osm2pgrouting` tool, there is an +additional table: ``configuration``. + +.. rubric:: The ``configuration`` table structure can be obtained with the following command. + +.. literalinclude:: ../scripts/basic/graphs/graphs.sql + :start-after: configuration_structure + :end-before: configuration_contents + +.. collapse:: The table description + + .. literalinclude:: ../scripts/basic/graphs/configuration_structure.txt + +.. image:: images/graphs/roads_tag_ids.png + :scale: 25% + :alt: tag_id values + +| + +In the image above there is a detail of the ``tag_id`` of the roads. + +.. rubric:: The `OSM highway `__ + types: + +.. literalinclude:: ../scripts/basic/graphs/graphs.sql + :start-after: configuration_contents + :end-before: configuration_used + :language: sql + +.. collapse:: Query results + + .. literalinclude:: ../scripts/basic/graphs/configuration_contents.txt + +Also, on the ``ways`` table there is a column that can be used to ``JOIN`` with the ``configuration`` table. + +.. rubric:: The configuration types in the @PGR_WORKSHOP_CITY@ data + +.. literalinclude:: ../scripts/basic/graphs/graphs.sql + :start-after: configuration_used + :end-before: create_vertices + +.. collapse:: Query results + + .. literalinclude:: ../scripts/basic/graphs/configuration_used.txt pgr_extractVertices ================================================================================ -``pgr_extractVertices`` extracts the vertices (nodes) from an edge table and -reports per-vertex attributes such as degree +``pgr_extractVertices`` extracting the vertex information of the set of edges of +a graph. .. rubric:: Signature summary @@ -69,7 +135,7 @@ reports per-vertex attributes such as degree pgr_extractVertices(Edges SQL, [dryrun]) RETURNS SETOF (id, in_edges, out_edges, x, y, geom) - OR EMTPY SET + OR EMPTY SET Description of the function can be found in `pgr_extractVertices `__ @@ -87,7 +153,8 @@ Create the vertices table corresponding to the edges in ``ways``. - In this case, the ``ways`` table is a set of edges. - In order to make use of all the graph functions from pgRouting, it is required have the set of vertices defined. -- From the requirements, the graph is going to be based on OSM identifiers. +- From the requirements, a fully connected graph is needed, therefore adding a + ``component`` column. .. literalinclude:: ../scripts/basic/graphs/graphs.sql @@ -106,7 +173,7 @@ Reviewing the description of the vertices table :start-after: vertices_description.txt :end-before: selected_rows.txt -.. collapse:: Description +.. collapse:: The table description .. literalinclude:: ../scripts/basic/graphs/vertices_description.txt @@ -117,7 +184,7 @@ Inspecting the information on the vertices table :start-after: selected_rows.txt :end-before: fill_columns_1.txt -.. collapse:: Data on table +.. collapse:: Query results .. literalinclude:: ../scripts/basic/graphs/selected_rows.txt @@ -141,20 +208,26 @@ Count the number of rows that need to be filled up. .. literalinclude:: ../scripts/basic/graphs/fill_columns_1.txt -* Update the ``geom`` columns based on the ``source_osm`` column - from ``ways`` table. -* Use the start point of the geometry. +.. rubric:: Update the ``geom`` and ``osm_id`` columns + +* The update based on the ``source`` column from ``ways`` table and the ``id`` + column of the vertices table. +* To update ``geom`` column, use the start point of the geometry on the ``ways`` + table. +* Use the ``source_osm`` value to fill up ``osm_id`` column. .. literalinclude:: ../scripts/basic/graphs/graphs.sql :language: sql :start-after: fill_columns_2.txt :end-before: fill_columns_3.txt +.. rubric:: Verification + .. collapse:: Number of updated records .. literalinclude:: ../scripts/basic/graphs/fill_columns_2.txt -Not expecting to be done due to the fact that some vertices are only dead ends. +Not expecting to be done due to the fact that some vertices are dead ends. .. literalinclude:: ../scripts/basic/graphs/graphs.sql :language: sql @@ -165,15 +238,21 @@ Not expecting to be done due to the fact that some vertices are only dead ends. .. literalinclude:: ../scripts/basic/graphs/fill_columns_3.txt -* Update the ``geom`` columns based on the ``target_osm`` column - from ``ways`` table. -* Use the end point of the geometry. +.. rubric:: Continue update the ``geom`` and ``osm_id`` columns + +* The update based on the ``target`` column from ``ways`` table and the ``id`` + column of the vertices table. +* To update ``geom`` column, use the end point of the geometry on the ``ways`` + table. +* Use the ``target_osm`` value to fill up ``osm_id`` column. .. literalinclude:: ../scripts/basic/graphs/graphs.sql :language: sql :start-after: fill_columns_4.txt :end-before: fill_columns_5.txt +.. rubric:: Verification + .. collapse:: Number of updated records .. literalinclude:: ../scripts/basic/graphs/fill_columns_4.txt @@ -190,6 +269,8 @@ value. .. literalinclude:: ../scripts/basic/graphs/fill_columns_5.txt +.. rubric:: Update the ``x`` and ``y`` columns + Update the ``x`` and ``y`` columns based on the ``geom`` column. .. literalinclude:: ../scripts/basic/graphs/graphs.sql @@ -197,6 +278,8 @@ Update the ``x`` and ``y`` columns based on the ``geom`` column. :start-after: fill_columns_6.txt :end-before: set_components1.txt +.. rubric:: Verification + .. collapse:: Number of updated records .. literalinclude:: ../scripts/basic/graphs/fill_columns_6.txt @@ -231,26 +314,24 @@ Get the information about the graph components. .. rubric:: Solution -Create additional columns on the edges and vertices tables. +Create additional columns on the edges tables. .. literalinclude:: ../scripts/basic/graphs/graphs.sql :language: sql :start-after: set_components1.txt :end-before: set_components2.txt -.. collapse:: Message about creation of columns +.. collapse:: Command output .. literalinclude:: ../scripts/basic/graphs/set_components1.txt -- Use the ``pgr_connectedComponents`` to fill up the vertices table. +.. rubric:: Use the ``pgr_connectedComponents`` to fill up the vertices table. - - Use the results to store the component numbers on the vertices table. - (**line 1**) - - Use the OSM identifiers of the vertices. (**lines 4-5**) +- Use the results to store the component numbers on the vertices table. .. literalinclude:: ../scripts/basic/graphs/graphs.sql :language: sql - :emphasize-lines: 1, 4-5 + :emphasize-lines: 1 :start-after: set_components2.txt :end-before: set_components3.txt @@ -258,7 +339,7 @@ Create additional columns on the edges and vertices tables. .. literalinclude:: ../scripts/basic/graphs/set_components2.txt -- Update the edges table with based on the component number of the vertex +.. rubric:: Update the edges table with based on the component number of the vertex .. literalinclude:: ../scripts/basic/graphs/graphs.sql :language: sql @@ -284,7 +365,7 @@ Answer the following questions: .. rubric:: Solution -1. How many components are in the vertices table? +.. rubric:: 1. How many components are in the vertices table? Count the distinct components. @@ -297,7 +378,7 @@ Count the distinct components. .. literalinclude:: ../scripts/basic/graphs/see_components1.txt -2. How many components are in the edges table? +.. rubric:: 2. How many components are in the edges table? Count the distinct components. @@ -310,7 +391,7 @@ Count the distinct components. .. literalinclude:: ../scripts/basic/graphs/see_components2.txt -3. List the 10 components with more edges. +.. rubric:: 3. List the 10 components with more edges. * Count number of rows grouped by component. (**line 1**) * Inverse order to display the top 10. (**line 2**) @@ -324,7 +405,7 @@ Count the distinct components. .. literalinclude:: ../scripts/basic/graphs/see_components3.txt -4. Get the component with the maximum number of edges. +.. rubric:: 4. Get the component with the maximum number of edges. * Use the query from last question to get the maximum count * Get the component that matches the maximum value. @@ -338,8 +419,6 @@ Count the distinct components. .. literalinclude:: ../scripts/basic/graphs/see_components4.txt - - Preparing the graphs ================================================================================ @@ -353,14 +432,14 @@ Exercise 5: Creating a view for routing .. rubric:: Problem - Create a view with minimal amount of information for processing the particular vehicles. -- Use the OSM identifiers on the vertices. - Routing `cost` and `reverse_cost` in terms of seconds for routing calculations. - Exclude `steps`, `footway`, `path`, `cycleway` segments. - Data needed in the view for further processing. - - `name` The name of the segment. - - `length_m` The length in meters rename to ``length``. - - `the_geom` The geometry rename to ``geom``. + - ``name`` The name of the segment. + - ``length_m`` The length in meters rename to ``length``. + - ``the_geom`` The geometry rename to ``geom``. + - ``tag_id`` Keep as is. - Verify the number of edges was reduced. @@ -382,22 +461,22 @@ Creating the view: .. literalinclude:: ../scripts/basic/graphs/graphs.sql - :language: sql - :emphasize-lines: 6-10,14-16,18 - :start-after: create_vehicle_net1.txt - :end-before: create_vehicle_net2.txt + :language: sql + :linenos: + :start-after: create_vehicle_net1.txt + :end-before: create_vehicle_net2.txt -.. collapse:: Response of command +.. collapse:: Command output .. literalinclude:: ../scripts/basic/graphs/create_vehicle_net1.txt -Verification: +.. rubric:: Verification Count the rows on the original ``ways`` and on ``vehicle_net``. .. literalinclude:: ../scripts/basic/graphs/graphs.sql - :start-after: create_vehicle_net2.txt - :end-before: create_vehicle_net3.txt + :start-after: create_vehicle_net2.txt + :end-before: create_vehicle_net3.txt .. collapse:: Row count results @@ -481,16 +560,18 @@ Exercise 7: Creating a materialized view for routing pedestrians .. rubric:: Problem -- Create a materialized view with minimal amount of information for processing pedestrians. +- Create a materialized view with minimal amount of information for processing + pedestrians. - Routing `cost` and `reverse_cost` will be on seconds for routing calculations. - The speed is ``2 mts/sec``. -- Exclude `motorway` , `primary` and `secondary` segments. +- Only include the pedestrian only roads: ``pedestrian``, ``steps``, ``footway``, + ``path``, ``cycleway`` - Data needed in the view for further processing. - - `length_m` The length in meters. - - `the_geom` The geometry. + - ``length_m`` The length in meters. + - ``the_geom`` The geometry. - Verify the number of edges was reduced. @@ -500,8 +581,9 @@ Exercise 7: Creating a materialized view for routing pedestrians - Similar to `Exercise 5: Creating a view for routing`_: - - The ``cost`` and ``reverse_cost`` are in terms of seconds with speed of ``2 mts/sec``. (line **7**) - - Exclude `motorway`, `primary` and `secondary` . (line **11**) + - The ``cost`` and ``reverse_cost`` are in terms of seconds with speed of + ``2 mts/sec``. (line **7**) + - Exclude ``motorway``, ``primary`` and ``secondary`` . (line **11**) .. literalinclude:: ../scripts/basic/graphs/graphs.sql :language: sql @@ -529,19 +611,34 @@ Get the description. .. literalinclude:: ../scripts/basic/graphs/graphs.sql :start-after: create_walk_net3.txt - :end-before: test_view1.txt + :end-before: create_net_vertices.txt .. collapse:: The view description .. literalinclude:: ../scripts/basic/graphs/create_walk_net3.txt +pgr_dijkstraCostMatrix +================================================================================ + +``pgr_dijkstraCostMatrix`` Calculates a cost matrix using Dijkstra algorithm. -Exercise 8: Testing the views for routing +.. rubric:: Signature summary + +.. code-block:: sql + + pgr_dijkstraCostMatrix(Edges SQL, start vids, [directed]) + + RETURNS SETOF (start_vid, end_vid, agg_cost) + OR EMPTY SET + +Description of the function can be found in `pgr_dijkstraCostMatrix +`__ + +Exercise 8: Testing the views ------------------------------------------------------------------------------- -.. image:: images/graphs/ch7-e3.png +.. image:: images/graphs/costMatrix.png :scale: 25% - :alt: From the |ch7_place_1| to the |ch7_place_2| .. rubric:: Problem @@ -549,25 +646,19 @@ Exercise 8: Testing the views for routing In particular: -* From the |ch7_place_1| to the "|ch7_place_2| using the OSM identifier +* Get a traveling cost matrix in seconds from all locations to all locations. * the views to be tested are: * ``vehicle_net`` * ``taxi_net`` * ``walk_net`` -* Only show the following results, as the other columns are to be ignored on the function. - - * ``seq`` - * ``edge`` with the name ``id`` - * ``cost`` with the name: ``seconds`` - .. rubric:: Solution -* In general +* The locations are: - * The departure is |ch7_place_1| with OSM identifier |ch7_osmid_1|. - * The destination is |ch7_place_2| with OSM identifier |ch7_osmid_2|. + * |id_1|, |id_2|, |id_3|, |id_4| and |id_5|. + * Passed as an array to the function. For ``vehicle_net``: @@ -586,7 +677,7 @@ For ``vehicle_net``: :start-after: test_view1.txt :end-before: test_view2.txt -.. collapse:: Query resultes +.. collapse:: Query results .. literalinclude:: ../scripts/basic/graphs/test_view1.txt @@ -602,7 +693,7 @@ For ``taxi_net``: :start-after: test_view2.txt :end-before: test_view3.txt -.. collapse:: Query resultes +.. collapse:: Query results .. literalinclude:: ../scripts/basic/graphs/test_view2.txt @@ -617,6 +708,6 @@ For ``walk_net``: :start-after: test_view3.txt :end-before: graphs_end.txt -.. collapse:: Query resultes +.. collapse:: Query results .. literalinclude:: ../scripts/basic/graphs/test_view3.txt diff --git a/docs/basic/images/CMakeLists.txt b/docs/basic/images/CMakeLists.txt index da805497d..65e7d2604 100644 --- a/docs/basic/images/CMakeLists.txt +++ b/docs/basic/images/CMakeLists.txt @@ -16,8 +16,11 @@ set(PGR_WORKSHOP_IMG_SUBDIRS #--------------------------------------------- foreach (dir ${PGR_WORKSHOP_IMG_SUBDIRS}) - file(COPY "${dir}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") if (PGR_WORKSHOP_DEBUG) - message(STATUS " Adding images directory ${dir}") + message(STATUS " -> basic/images/${dir}") + endif() + add_subdirectory("${dir}") + if (PGR_WORKSHOP_DEBUG) + message(STATUS " <- basic/images/${dir}") endif() endforeach() diff --git a/docs/basic/images/graphs/CMakeLists.txt b/docs/basic/images/graphs/CMakeLists.txt index 8edf731ba..dc4542969 100644 --- a/docs/basic/images/graphs/CMakeLists.txt +++ b/docs/basic/images/graphs/CMakeLists.txt @@ -3,17 +3,18 @@ # Files #--------------------- set(PGR_WORKSHOP_IMG_FILES - ch7-e3.png + costMatrix.png + pedestrian_only_roads.png + roads_tag_ids.png + taxi_net.png vehicle_net.png walk_net.png - taxi_net.png - ) +) foreach (f ${PGR_WORKSHOP_IMG_FILES}) if (PGR_WORKSHOP_VERBOSE_DEBUG) - message(STATUS " Adding file ${f}") + message(STATUS " -> ${f}") endif() - FILE(COPY ${f} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") + configure_file(${f} ${f} COPYONLY) endforeach() - diff --git a/docs/basic/images/graphs/ch7-e3.png b/docs/basic/images/graphs/ch7-e3.png deleted file mode 100644 index 0dd9f552d..000000000 Binary files a/docs/basic/images/graphs/ch7-e3.png and /dev/null differ diff --git a/docs/basic/images/graphs/costMatrix.png b/docs/basic/images/graphs/costMatrix.png new file mode 100644 index 000000000..5ca41ce5e Binary files /dev/null and b/docs/basic/images/graphs/costMatrix.png differ diff --git a/docs/basic/images/graphs/pedestrian_only_roads.png b/docs/basic/images/graphs/pedestrian_only_roads.png new file mode 100644 index 000000000..70700cf82 Binary files /dev/null and b/docs/basic/images/graphs/pedestrian_only_roads.png differ diff --git a/docs/basic/images/graphs/roads_tag_ids.png b/docs/basic/images/graphs/roads_tag_ids.png new file mode 100644 index 000000000..d91053b8c Binary files /dev/null and b/docs/basic/images/graphs/roads_tag_ids.png differ diff --git a/docs/basic/images/graphs/taxi_net.png b/docs/basic/images/graphs/taxi_net.png index 933a5879f..bd47ad33f 100644 Binary files a/docs/basic/images/graphs/taxi_net.png and b/docs/basic/images/graphs/taxi_net.png differ diff --git a/docs/basic/images/graphs/vehicle_net.png b/docs/basic/images/graphs/vehicle_net.png index 984b6816b..bae43aaed 100644 Binary files a/docs/basic/images/graphs/vehicle_net.png and b/docs/basic/images/graphs/vehicle_net.png differ diff --git a/docs/basic/images/graphs/walk_net.png b/docs/basic/images/graphs/walk_net.png index a1ab93789..085ca2827 100644 Binary files a/docs/basic/images/graphs/walk_net.png and b/docs/basic/images/graphs/walk_net.png differ diff --git a/docs/conf.py b/docs/conf.py index 0190df449..abf914b26 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,6 +30,7 @@ 'sphinx.ext.todo', 'sphinx.ext.autosectionlabel', 'sphinx_collapse', + 'sphinx_copybutton', ] autosectionlabel_prefix_document = True diff --git a/docs/index.rst b/docs/index.rst index c1ca00e09..a81bbb279 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -31,9 +31,9 @@ Basic :maxdepth: 2 basic/data.rst + basic/graphs.rst basic/pedestrian.rst basic/vehicle.rst - basic/graphs.rst basic/sql_function.rst basic/plpgsql_function.rst diff --git a/docs/scripts/basic/CMakeLists.txt b/docs/scripts/basic/CMakeLists.txt index 5e15e38c9..161a33fc1 100644 --- a/docs/scripts/basic/CMakeLists.txt +++ b/docs/scripts/basic/CMakeLists.txt @@ -5,9 +5,9 @@ add_custom_target(basic_scripts ALL) #--------------------- SET(PGR_WORKSHOP_DIR data + graphs pedestrian vehicles - graphs sql_function plpgsql_function ) @@ -20,8 +20,9 @@ foreach (d ${PGR_WORKSHOP_DIR}) add_dependencies(basic_scripts basic_${d}_scripts) endforeach() -add_dependencies(basic_pedestrian_scripts basic_data_scripts) -add_dependencies(basic_vehicles_scripts basic_pedestrian_scripts) -add_dependencies(basic_sql_function_scripts basic_vehicles_scripts) +add_dependencies(basic_graphs_scripts basic_data_scripts) +add_dependencies(basic_pedestrian_scripts basic_graphs_scripts) +add_dependencies(basic_vehicles_scripts basic_graphs_scripts) add_dependencies(basic_sql_function_scripts basic_graphs_scripts) +add_dependencies(basic_sql_function_scripts basic_vehicles_scripts) add_dependencies(basic_plpgsql_function_scripts basic_sql_function_scripts) diff --git a/docs/scripts/basic/data/CMakeLists.txt b/docs/scripts/basic/data/CMakeLists.txt index 46fa30d01..1bb2c6e18 100644 --- a/docs/scripts/basic/data/CMakeLists.txt +++ b/docs/scripts/basic/data/CMakeLists.txt @@ -1,22 +1,11 @@ -#--------------------- -# Files -#--------------------- -set(PGR_WORKSHOP_FILES - "data.sh" -) - -foreach (f ${PGR_WORKSHOP_FILES}) - if (PGR_WORKSHOP_VERBOSE_DEBUG) - message(STATUS " Adding file ${f}") - endif() - configure_file(${f} ${f}) -endforeach() +# Script for basic/data chapter +configure_file(data.sh data.sh) add_custom_command( OUTPUT data.txt COMMAND bash data.sh > data.txt - ) +) add_custom_target(basic_data_scripts DEPENDS "data.txt" - ) +) diff --git a/docs/scripts/basic/graphs/CMakeLists.txt b/docs/scripts/basic/graphs/CMakeLists.txt index 8a56f2860..6b11410b8 100644 --- a/docs/scripts/basic/graphs/CMakeLists.txt +++ b/docs/scripts/basic/graphs/CMakeLists.txt @@ -1,18 +1,11 @@ -add_custom_target(basic_graphs_scripts) - -#--------------------- -# Files -#--------------------- +# Script for basic/graphs chapter configure_file(graphs.sql graphs.sql) +configure_file(images.sql images.sql) -#---------------------------------------------- -# Generating the results files -#--------------------------------------------- - -add_custom_command( - TARGET basic_graphs_scripts - PRE_BUILD - BYPRODUCTS +set(GENERATED_FILES + configuration_structure.txt + configuration_contents.txt + configuration-used.txt create_vertices.txt vertices_description.txt @@ -39,10 +32,25 @@ add_custom_command( create_walk_net1.txt create_walk_net2.txt create_walk_net3.txt + create_net_vertices.txt test_view1.txt test_view2.txt test_view3.txt + graphs_end.txt +) +#---------------------------------------------- +# Generating the results files +#--------------------------------------------- + +add_custom_command( COMMAND psql -d city_routing -f graphs.sql - COMMENT "running graphs scripts" + COMMAND psql -d city_routing -f images.sql + OUTPUT ${GENERATED_FILES} + + COMMENT "running chapter graphs scripts" +) + +add_custom_target(basic_graphs_scripts + DEPENDS ${GENERATED_FILES} ) diff --git a/docs/scripts/basic/graphs/graphs.sql b/docs/scripts/basic/graphs/graphs.sql index ba12ce574..a7f20a030 100644 --- a/docs/scripts/basic/graphs/graphs.sql +++ b/docs/scripts/basic/graphs/graphs.sql @@ -1,55 +1,70 @@ - +DROP TABLE IF EXISTS vertices CASCADE; DROP VIEW IF EXISTS vehicle_net CASCADE; DROP VIEW IF EXISTS taxi_net CASCADE; DROP MATERIALIZED VIEW IF EXISTS walk_net CASCADE; +\o configuration_structure.txt +\dS+ configuration +\o configuration_contents.txt + +SELECT tag_id, tag_key, tag_value +FROM configuration +ORDER BY tag_id; + +\o configuration_used.txt + +SELECT distinct tag_id, tag_key, tag_value +FROM ways JOIN configuration USING (tag_id) +ORDER BY tag_id; + \o create_vertices.txt -SELECT * INTO ways_vertices +SELECT id, in_edges, out_edges, x, y, NULL::BIGINT osm_id, NULL::BIGINT component, geom +INTO vertices FROM pgr_extractVertices( - 'SELECT gid AS id, source_osm AS source, target_osm AS target + 'SELECT gid AS id, source, target FROM ways ORDER BY id'); \o vertices_description.txt -\dS+ ways_vertices +\dS+ vertices \o selected_rows.txt -SELECT * FROM ways_vertices Limit 10; +SELECT * FROM vertices Limit 10; \o fill_columns_1.txt -SELECT count(*) FROM ways_vertices WHERE geom IS NULL; +SELECT count(*) FROM vertices WHERE geom IS NULL; \o fill_columns_2.txt -UPDATE ways_vertices SET geom = ST_startPoint(the_geom) FROM ways WHERE source_osm = id; +UPDATE vertices SET (geom, osm_id) = (ST_startPoint(the_geom), source_osm) +FROM ways WHERE source = id; \o fill_columns_3.txt -SELECT count(*) FROM ways_vertices WHERE geom IS NULL; +SELECT count(*) FROM vertices WHERE geom IS NULL; \o fill_columns_4.txt -UPDATE ways_vertices SET geom = ST_endPoint(the_geom) FROM ways WHERE geom IS NULL AND target_osm = id; +UPDATE vertices SET (geom, osm_id) = (ST_endPoint(the_geom), target_osm) +FROM ways WHERE geom IS NULL AND target = id; \o fill_columns_5.txt -SELECT count(*) FROM ways_vertices WHERE geom IS NULL; +SELECT count(*) FROM vertices WHERE geom IS NULL; \o fill_columns_6.txt -UPDATE ways_vertices set (x,y) = (ST_X(geom), ST_Y(geom)); +UPDATE vertices set (x,y) = (ST_X(geom), ST_Y(geom)); \o set_components1.txt ALTER TABLE ways ADD COLUMN component BIGINT; -ALTER TABLE ways_vertices ADD COLUMN component BIGINT; \o set_components2.txt -UPDATE ways_vertices SET component = c.component -FROM (SELECT * FROM pgr_connectedComponents( - 'SELECT gid as id, - source_osm AS source, - target_osm AS target, - cost, reverse_cost FROM ways' +UPDATE vertices AS v SET component = c.component +FROM ( + SELECT seq, component, node + FROM pgr_connectedComponents( + 'SELECT gid as id, source, target, cost, reverse_cost FROM ways' )) AS c -WHERE id = node; +WHERE v.id = c.node; \o set_components3.txt UPDATE ways SET component = v.component -FROM (SELECT id, component FROM ways_vertices) AS v -WHERE source_osm = v.id; +FROM (SELECT id, component FROM vertices) AS v +WHERE source = v.id; \o see_components1.txt -SELECT count(DISTINCT component) FROM ways_vertices; +SELECT count(DISTINCT component) FROM vertices; \o see_components2.txt SELECT count(DISTINCT component) FROM ways; \o see_components3.txt @@ -75,11 +90,11 @@ the_component AS ( SELECT gid AS id, - source_osm AS source, target_osm AS target, -- line 14 + source, target, cost_s AS cost, reverse_cost_s AS reverse_cost, - name, length_m AS length, the_geom AS geom + name, length_m AS length, tag_id, the_geom AS geom FROM ways JOIN the_component USING (component) JOIN configuration USING (tag_id) -WHERE tag_value NOT IN ('steps','footway','path','cycleway'); -- line 18 +WHERE tag_value NOT IN ('pedestrian', 'steps','footway','path','cycleway'); -- line 18 \o create_vehicle_net2.txt SELECT count(*) FROM ways; @@ -95,7 +110,7 @@ CREATE VIEW taxi_net AS id, source, target, cost * 1.10 AS cost, reverse_cost * 1.10 AS reverse_cost, - name, length, geom + name, length, tag_id, geom FROM vehicle_net WHERE vehicle_net.geom && ST_MakeEnvelope(@PGR_WORKSHOP_LITTLE_NET_BBOX@); @@ -116,11 +131,11 @@ the_component AS (SELECT component FROM allc WHERE count = (SELECT max FROM maxc SELECT gid AS id, - source_osm AS source, target_osm AS target, - cost_s AS cost, reverse_cost_s AS reverse_cost, + source, target, + length_m / 2.0 AS cost, length_m / 2.0 AS reverse_cost, name, length_m AS length, the_geom AS geom FROM ways JOIN the_component USING (component) JOIN configuration USING (tag_id) -WHERE tag_value NOT IN ('motorway','primary','secondary'); +WHERE tag_value IN ('pedestrian', 'steps','footway','path','cycleway'); -- line 18 \o create_walk_net2.txt @@ -128,26 +143,43 @@ SELECT count(*) FROM walk_net; \o create_walk_net3.txt \dS+ walk_net +\o create_net_vertices.txt + +SELECT * INTO vehicle_vertices +FROM pgr_extractVertices( + 'SELECT id, source, target + FROM vehicle_net ORDER BY id'); + +SELECT * INTO taxi_vertices +FROM pgr_extractVertices( + 'SELECT id, source, target + FROM taxi_net ORDER BY id'); + +SELECT * INTO walk_vertices +FROM pgr_extractVertices( + 'SELECT id, source, target + FROM walk_net ORDER BY id'); + \o test_view1.txt -SELECT start_vid, end_vid, agg_cost AS seconds -FROM pgr_dijkstraCost( +SELECT start_vid, end_vid, agg_cost +FROM pgr_dijkstraCostMatrix( 'SELECT * FROM vehicle_net', - @CH7_OSMID_1@, @CH7_OSMID_2@); + ARRAY[@ID_1@, @ID_2@, @ID_3@, @ID_4@, @ID_5@]); \o test_view2.txt -SELECT start_vid, end_vid, agg_cost AS seconds -FROM pgr_dijkstraCost( +SELECT start_vid, end_vid, agg_cost +FROM pgr_dijkstraCostMatrix( 'SELECT * FROM taxi_net', - @CH7_OSMID_1@, @CH7_OSMID_2@); + ARRAY[@ID_1@, @ID_2@, @ID_3@, @ID_4@, @ID_5@]); \o test_view3.txt -SELECT start_vid, end_vid, agg_cost AS seconds -FROM pgr_dijkstraCost( +SELECT start_vid, end_vid, agg_cost +FROM pgr_dijkstraCostMatrix( 'SELECT * FROM walk_net', - @CH7_OSMID_1@, @CH7_OSMID_2@); + ARRAY[@ID_1@, @ID_2@, @ID_3@, @ID_4@, @ID_5@]); \o graphs_end.txt \o diff --git a/docs/scripts/basic/graphs/images.sql b/docs/scripts/basic/graphs/images.sql new file mode 100644 index 000000000..7645a317f --- /dev/null +++ b/docs/scripts/basic/graphs/images.sql @@ -0,0 +1,10 @@ +DROP TABLE IF EXISTS costMatrix_png; + +SELECT row_number() over() as gid, ST_makeline(v1.geom, v2.geom) AS geom, +'('||start_vid||', '||end_vid||') t= ' || round(agg_cost::NUMERIC, 2) AS name +INTO costMatrix_png +FROM pgr_dijkstraCostMatrix( + 'SELECT * FROM vehicle_net', + ARRAY[@ID_1@, @ID_2@, @ID_3@, @ID_4@, @ID_5@]) +JOIN vertices v1 ON (start_vid=v1.id) +JOIN vertices v2 ON (end_vid=v2.id); diff --git a/locale/en/LC_MESSAGES/basic/graphs.po b/locale/en/LC_MESSAGES/basic/graphs.po index 07a8d2f34..6b1207357 100644 --- a/locale/en/LC_MESSAGES/basic/graphs.po +++ b/locale/en/LC_MESSAGES/basic/graphs.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 18:35+0000\n" +"POT-Creation-Date: 2025-10-03 17:35+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -21,7 +21,7 @@ msgstr "" "Generated-By: Babel 2.17.0\n" #: ../../build/docs/basic/graphs.rst:12 -msgid "Graph views" +msgid "Graphs" msgstr "" #: ../../build/docs/basic/graphs.rst:18 @@ -34,197 +34,298 @@ msgid "" "discard disconnected segments and different approaches to create graphs." msgstr "" -#: ../../build/docs/basic/graphs.rst:24 -msgid "The graph requirements" +#: ../../build/docs/basic/graphs.rst:23 +msgid "pgRouting functions in this chapter" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:25 +msgid "`pgr_extractVertices`_" msgstr "" #: ../../build/docs/basic/graphs.rst:26 +msgid "`pgr_connectedComponents`_" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:27 +msgid "`pgr_dijkstraCostMatrix`_" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:30 +msgid "The graph requirements" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:32 msgid "" "In this chapter there are three graph requirements. It consists on three " "graphs based on a **fully connected** graph derived from ``ways``: two for " "different types of vehicles and one for pedestrian, the source and the " -"target in all of them are based on the ``source_osm`` and ``target_osm``." +"target in all of them are based on the ``source`` and ``target``." msgstr "" -#: ../../build/docs/basic/graphs.rst:31 +#: ../../build/docs/basic/graphs.rst:37 msgid "The description of the graphs:" msgstr "" -#: ../../build/docs/basic/graphs.rst:33 +#: ../../build/docs/basic/graphs.rst:39 msgid "Particular vehicle:" msgstr "" -#: ../../build/docs/basic/graphs.rst:35 +#: ../../build/docs/basic/graphs.rst:41 msgid "Circulate on the whole Auckland area." msgstr "" -#: ../../build/docs/basic/graphs.rst:37 ../../build/docs/basic/graphs.rst:46 -msgid "Do not use `steps`, `footway`, `path`, `cycleway`." +#: ../../build/docs/basic/graphs.rst:43 ../../build/docs/basic/graphs.rst:52 +msgid "Do not use `pedestrian`, `steps`, `footway`, `path`, `cycleway`" msgstr "" -#: ../../build/docs/basic/graphs.rst:39 +#: ../../build/docs/basic/graphs.rst:45 msgid "Speed is the default speed from OSM information." msgstr "" -#: ../../build/docs/basic/graphs.rst:41 +#: ../../build/docs/basic/graphs.rst:47 msgid "Taxi vehicle:" msgstr "" -#: ../../build/docs/basic/graphs.rst:43 +#: ../../build/docs/basic/graphs.rst:49 msgid "Circulate on a smaller area:" msgstr "" -#: ../../build/docs/basic/graphs.rst:45 +#: ../../build/docs/basic/graphs.rst:51 msgid "Bounding box: ``(174.775,-36.855,174.76,-36.84)``" msgstr "" -#: ../../build/docs/basic/graphs.rst:48 +#: ../../build/docs/basic/graphs.rst:54 #, python-format msgid "Speed is 10% slower than that of the particular vehicles." msgstr "" -#: ../../build/docs/basic/graphs.rst:50 +#: ../../build/docs/basic/graphs.rst:56 msgid "Pedestrians:" msgstr "" -#: ../../build/docs/basic/graphs.rst:52 +#: ../../build/docs/basic/graphs.rst:58 msgid "Walk on the whole Auckland area." msgstr "" -#: ../../build/docs/basic/graphs.rst:53 -msgid "Can not walk on exclusive vehicle ways" +#: ../../build/docs/basic/graphs.rst:59 +msgid "Can only use pedestrian only ways:" msgstr "" -#: ../../build/docs/basic/graphs.rst:55 -msgid "`motorways` and on `primary` segments." +#: ../../build/docs/basic/graphs.rst:61 +msgid "`pedestrian`, `steps`, `footway`, `path`, `cycleway`" msgstr "" -#: ../../build/docs/basic/graphs.rst:57 ../../build/docs/basic/graphs.rst:487 -msgid "The speed is ``2 mts/sec``." +#: ../../build/docs/basic/graphs.rst:63 +msgid "The walking speed is ``2 mts/sec``." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:66 +msgid "Configuration from osm2pgrouting" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:68 +msgid "" +"When dealing with data, being aware of what kind of data is being used can " +"improve results." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:71 +msgid "Vehicles can not circulate on pedestrian ways" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:78 +msgid "" +"Penalizing or removal of pedestrian ways will make the results closer to " +"reality." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:80 +msgid "" +"When converting data from OSM format using the `osm2pgrouting` tool, there " +"is an additional table: ``configuration``." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:84 +msgid "" +"The ``configuration`` table structure can be obtained with the following " +"command." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:93 +msgid "tag_id values" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:99 +msgid "In the image above there is a detail of the ``tag_id`` of the roads." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:103 +msgid "" +"The `OSM highway `__ types:" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:113 +msgid "" +"Also, on the ``ways`` table there is a column that can be used to ``JOIN`` " +"with the ``configuration`` table." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:116 +msgid "The configuration types in the Auckland data" msgstr "" -#: ../../build/docs/basic/graphs.rst:60 +#: ../../build/docs/basic/graphs.rst:126 msgid "pgr_extractVertices" msgstr "" -#: ../../build/docs/basic/graphs.rst:62 +#: ../../build/docs/basic/graphs.rst:128 msgid "" -"``pgr_extractVertices`` extracts the vertices (nodes) from an edge table and " -"reports per-vertex attributes such as degree" +"``pgr_extractVertices`` extracting the vertex information of the set of " +"edges of a graph." msgstr "" -#: ../../build/docs/basic/graphs.rst:66 ../../build/docs/basic/graphs.rst:213 +#: ../../build/docs/basic/graphs.rst:132 ../../build/docs/basic/graphs.rst:296 +#: ../../build/docs/basic/graphs.rst:626 msgid "Signature summary" msgstr "" -#: ../../build/docs/basic/graphs.rst:74 +#: ../../build/docs/basic/graphs.rst:140 msgid "" "Description of the function can be found in `pgr_extractVertices `__" msgstr "" -#: ../../build/docs/basic/graphs.rst:78 +#: ../../build/docs/basic/graphs.rst:144 msgid "Exercise 1: Create a vertices table" msgstr "" -#: ../../build/docs/basic/graphs.rst:81 ../../build/docs/basic/graphs.rst:129 -#: ../../build/docs/basic/graphs.rst:229 ../../build/docs/basic/graphs.rst:277 -#: ../../build/docs/basic/graphs.rst:354 ../../build/docs/basic/graphs.rst:425 -#: ../../build/docs/basic/graphs.rst:483 ../../build/docs/basic/graphs.rst:547 +#: ../../build/docs/basic/graphs.rst:147 ../../build/docs/basic/graphs.rst:196 +#: ../../build/docs/basic/graphs.rst:312 ../../build/docs/basic/graphs.rst:358 +#: ../../build/docs/basic/graphs.rst:433 ../../build/docs/basic/graphs.rst:504 +#: ../../build/docs/basic/graphs.rst:562 ../../build/docs/basic/graphs.rst:644 msgid "Problem" msgstr "" -#: ../../build/docs/basic/graphs.rst:82 +#: ../../build/docs/basic/graphs.rst:148 msgid "Create the vertices table corresponding to the edges in ``ways``." msgstr "" -#: ../../build/docs/basic/graphs.rst:85 ../../build/docs/basic/graphs.rst:133 -#: ../../build/docs/basic/graphs.rst:233 ../../build/docs/basic/graphs.rst:286 -#: ../../build/docs/basic/graphs.rst:368 ../../build/docs/basic/graphs.rst:434 -#: ../../build/docs/basic/graphs.rst:498 ../../build/docs/basic/graphs.rst:566 +#: ../../build/docs/basic/graphs.rst:151 ../../build/docs/basic/graphs.rst:200 +#: ../../build/docs/basic/graphs.rst:316 ../../build/docs/basic/graphs.rst:367 +#: ../../build/docs/basic/graphs.rst:447 ../../build/docs/basic/graphs.rst:513 +#: ../../build/docs/basic/graphs.rst:579 ../../build/docs/basic/graphs.rst:657 msgid "Solution" msgstr "" -#: ../../build/docs/basic/graphs.rst:86 +#: ../../build/docs/basic/graphs.rst:152 msgid "A graph consists of a set of vertices and a set of edges." msgstr "" -#: ../../build/docs/basic/graphs.rst:87 +#: ../../build/docs/basic/graphs.rst:153 msgid "In this case, the ``ways`` table is a set of edges." msgstr "" -#: ../../build/docs/basic/graphs.rst:88 +#: ../../build/docs/basic/graphs.rst:154 msgid "" "In order to make use of all the graph functions from pgRouting, it is " "required have the set of vertices defined." msgstr "" -#: ../../build/docs/basic/graphs.rst:90 +#: ../../build/docs/basic/graphs.rst:156 msgid "" -"From the requirements, the graph is going to be based on OSM identifiers." +"From the requirements, a fully connected graph is needed, therefore adding a " +"``component`` column." msgstr "" -#: ../../build/docs/basic/graphs.rst:103 +#: ../../build/docs/basic/graphs.rst:170 msgid "Reviewing the description of the vertices table" msgstr "" -#: ../../build/docs/basic/graphs.rst:113 +#: ../../build/docs/basic/graphs.rst:180 msgid "Inspecting the information on the vertices table" msgstr "" -#: ../../build/docs/basic/graphs.rst:126 +#: ../../build/docs/basic/graphs.rst:193 msgid "Exercise 2: Fill up other columns in the vertices table" msgstr "" -#: ../../build/docs/basic/graphs.rst:130 +#: ../../build/docs/basic/graphs.rst:197 msgid "Fill up geometry information on the vertices table." msgstr "" -#: ../../build/docs/basic/graphs.rst:134 +#: ../../build/docs/basic/graphs.rst:201 msgid "Count the number of rows that need to be filled up." msgstr "" -#: ../../build/docs/basic/graphs.rst:144 +#: ../../build/docs/basic/graphs.rst:212 +msgid "Update the ``geom`` and ``osm_id`` columns" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:213 msgid "" -"Update the ``geom`` columns based on the ``source_osm`` column from ``ways`` " -"table." +"The update based on the ``source`` column from ``ways`` table and the ``id`` " +"column of the vertices table." msgstr "" -#: ../../build/docs/basic/graphs.rst:146 -msgid "Use the start point of the geometry." +#: ../../build/docs/basic/graphs.rst:215 +msgid "" +"To update ``geom`` column, use the start point of the geometry on the " +"``ways`` table." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:217 +msgid "Use the ``source_osm`` value to fill up ``osm_id`` column." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:225 ../../build/docs/basic/graphs.rst:255 +#: ../../build/docs/basic/graphs.rst:282 ../../build/docs/basic/graphs.rst:474 +msgid "Verification" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:230 +msgid "" +"Not expecting to be done due to the fact that some vertices are dead ends." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:242 +msgid "Continue update the ``geom`` and ``osm_id`` columns" msgstr "" -#: ../../build/docs/basic/graphs.rst:157 +#: ../../build/docs/basic/graphs.rst:243 msgid "" -"Not expecting to be done due to the fact that some vertices are only dead " -"ends." +"The update based on the ``target`` column from ``ways`` table and the ``id`` " +"column of the vertices table." msgstr "" -#: ../../build/docs/basic/graphs.rst:168 +#: ../../build/docs/basic/graphs.rst:245 msgid "" -"Update the ``geom`` columns based on the ``target_osm`` column from ``ways`` " +"To update ``geom`` column, use the end point of the geometry on the ``ways`` " "table." msgstr "" -#: ../../build/docs/basic/graphs.rst:170 -msgid "Use the end point of the geometry." +#: ../../build/docs/basic/graphs.rst:247 +msgid "Use the ``target_osm`` value to fill up ``osm_id`` column." msgstr "" -#: ../../build/docs/basic/graphs.rst:181 +#: ../../build/docs/basic/graphs.rst:260 msgid "" "Expecting to be done, that is the geometry column should not have a ``NULL`` " "value." msgstr "" -#: ../../build/docs/basic/graphs.rst:193 +#: ../../build/docs/basic/graphs.rst:273 +msgid "Update the ``x`` and ``y`` columns" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:274 msgid "Update the ``x`` and ``y`` columns based on the ``geom`` column." msgstr "" -#: ../../build/docs/basic/graphs.rst:206 +#: ../../build/docs/basic/graphs.rst:289 msgid "pgr_connectedComponents" msgstr "" -#: ../../build/docs/basic/graphs.rst:208 +#: ../../build/docs/basic/graphs.rst:291 msgid "" "``pgr_connectedComponents`` compute the connected components of an " "undirected graph using a Depth First Search approach. A connected component " @@ -232,407 +333,413 @@ msgid "" "other." msgstr "" -#: ../../build/docs/basic/graphs.rst:221 +#: ../../build/docs/basic/graphs.rst:304 msgid "" "Description of the function can be found in `pgr_connectedComponents " "`__" msgstr "" -#: ../../build/docs/basic/graphs.rst:226 +#: ../../build/docs/basic/graphs.rst:309 msgid "Exercise 3: Set components on edges and vertices tables" msgstr "" -#: ../../build/docs/basic/graphs.rst:230 +#: ../../build/docs/basic/graphs.rst:313 msgid "Get the information about the graph components." msgstr "" -#: ../../build/docs/basic/graphs.rst:234 -msgid "Create additional columns on the edges and vertices tables." +#: ../../build/docs/basic/graphs.rst:317 +msgid "Create additional columns on the edges tables." msgstr "" -#: ../../build/docs/basic/graphs.rst:245 +#: ../../build/docs/basic/graphs.rst:329 msgid "Use the ``pgr_connectedComponents`` to fill up the vertices table." msgstr "" -#: ../../build/docs/basic/graphs.rst:247 -msgid "" -"Use the results to store the component numbers on the vertices table. " -"(**line 1**)" -msgstr "" - -#: ../../build/docs/basic/graphs.rst:249 -msgid "Use the OSM identifiers of the vertices. (**lines 4-5**)" +#: ../../build/docs/basic/graphs.rst:330 +msgid "Use the results to store the component numbers on the vertices table." msgstr "" -#: ../../build/docs/basic/graphs.rst:261 +#: ../../build/docs/basic/graphs.rst:343 msgid "Update the edges table with based on the component number of the vertex" msgstr "" -#: ../../build/docs/basic/graphs.rst:274 +#: ../../build/docs/basic/graphs.rst:355 msgid "Exercise 4: Inspect the components" msgstr "" -#: ../../build/docs/basic/graphs.rst:278 +#: ../../build/docs/basic/graphs.rst:359 msgid "Answer the following questions:" msgstr "" -#: ../../build/docs/basic/graphs.rst:280 ../../build/docs/basic/graphs.rst:287 +#: ../../build/docs/basic/graphs.rst:361 msgid "How many components are in the vertices table?" msgstr "" -#: ../../build/docs/basic/graphs.rst:281 ../../build/docs/basic/graphs.rst:300 +#: ../../build/docs/basic/graphs.rst:362 msgid "How many components are in the edges table?" msgstr "" -#: ../../build/docs/basic/graphs.rst:282 ../../build/docs/basic/graphs.rst:313 +#: ../../build/docs/basic/graphs.rst:363 msgid "List the 10 components with more edges." msgstr "" -#: ../../build/docs/basic/graphs.rst:283 ../../build/docs/basic/graphs.rst:327 +#: ../../build/docs/basic/graphs.rst:364 msgid "Get the component with the maximum number of edges." msgstr "" -#: ../../build/docs/basic/graphs.rst:289 ../../build/docs/basic/graphs.rst:302 +#: ../../build/docs/basic/graphs.rst:369 +msgid "1. How many components are in the vertices table?" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:370 ../../build/docs/basic/graphs.rst:383 msgid "Count the distinct components." msgstr "" -#: ../../build/docs/basic/graphs.rst:315 +#: ../../build/docs/basic/graphs.rst:382 +msgid "2. How many components are in the edges table?" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:395 +msgid "3. List the 10 components with more edges." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:396 msgid "Count number of rows grouped by component. (**line 1**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:316 +#: ../../build/docs/basic/graphs.rst:397 msgid "Inverse order to display the top 10. (**line 2**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:329 +#: ../../build/docs/basic/graphs.rst:409 +msgid "4. Get the component with the maximum number of edges." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:410 msgid "Use the query from last question to get the maximum count" msgstr "" -#: ../../build/docs/basic/graphs.rst:330 +#: ../../build/docs/basic/graphs.rst:411 msgid "Get the component that matches the maximum value." msgstr "" -#: ../../build/docs/basic/graphs.rst:344 +#: ../../build/docs/basic/graphs.rst:423 msgid "Preparing the graphs" msgstr "" -#: ../../build/docs/basic/graphs.rst:347 +#: ../../build/docs/basic/graphs.rst:426 msgid "Exercise 5: Creating a view for routing" msgstr "" -#: ../../build/docs/basic/graphs.rst:349 +#: ../../build/docs/basic/graphs.rst:428 msgid "View of roads for vehicles" msgstr "" -#: ../../build/docs/basic/graphs.rst:355 +#: ../../build/docs/basic/graphs.rst:434 msgid "" "Create a view with minimal amount of information for processing the " "particular vehicles." msgstr "" -#: ../../build/docs/basic/graphs.rst:356 -msgid "Use the OSM identifiers on the vertices." -msgstr "" - -#: ../../build/docs/basic/graphs.rst:357 +#: ../../build/docs/basic/graphs.rst:435 msgid "" "Routing `cost` and `reverse_cost` in terms of seconds for routing " "calculations." msgstr "" -#: ../../build/docs/basic/graphs.rst:358 +#: ../../build/docs/basic/graphs.rst:436 msgid "Exclude `steps`, `footway`, `path`, `cycleway` segments." msgstr "" -#: ../../build/docs/basic/graphs.rst:359 ../../build/docs/basic/graphs.rst:490 +#: ../../build/docs/basic/graphs.rst:437 ../../build/docs/basic/graphs.rst:571 msgid "Data needed in the view for further processing." msgstr "" -#: ../../build/docs/basic/graphs.rst:361 -msgid "`name` The name of the segment." +#: ../../build/docs/basic/graphs.rst:439 +msgid "``name`` The name of the segment." msgstr "" -#: ../../build/docs/basic/graphs.rst:362 -msgid "`length_m` The length in meters rename to ``length``." +#: ../../build/docs/basic/graphs.rst:440 +msgid "``length_m`` The length in meters rename to ``length``." msgstr "" -#: ../../build/docs/basic/graphs.rst:363 -msgid "`the_geom` The geometry rename to ``geom``." +#: ../../build/docs/basic/graphs.rst:441 +msgid "``the_geom`` The geometry rename to ``geom``." msgstr "" -#: ../../build/docs/basic/graphs.rst:365 ../../build/docs/basic/graphs.rst:495 +#: ../../build/docs/basic/graphs.rst:442 +msgid "``tag_id`` Keep as is." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:444 ../../build/docs/basic/graphs.rst:576 msgid "Verify the number of edges was reduced." msgstr "" -#: ../../build/docs/basic/graphs.rst:369 ../../build/docs/basic/graphs.rst:435 -#: ../../build/docs/basic/graphs.rst:499 +#: ../../build/docs/basic/graphs.rst:448 ../../build/docs/basic/graphs.rst:514 +#: ../../build/docs/basic/graphs.rst:580 msgid "Creating the view:" msgstr "" -#: ../../build/docs/basic/graphs.rst:371 +#: ../../build/docs/basic/graphs.rst:450 msgid "" "If you need to reconstruct the view, first drop it using the command on " "**line 1**." msgstr "" -#: ../../build/docs/basic/graphs.rst:373 +#: ../../build/docs/basic/graphs.rst:452 msgid "Get the component with maximum number of edges (**lines 6-10**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:374 +#: ../../build/docs/basic/graphs.rst:453 msgid "" "The `source` and `target` requirements for the function are to be with OSM " "identifiers. (line **14**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:376 +#: ../../build/docs/basic/graphs.rst:455 msgid "" "The ``cost`` and ``reverse_cost`` are in terms of seconds. (line **15**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:377 +#: ../../build/docs/basic/graphs.rst:456 msgid "" "The additional parameters ``length_m`` and ``the_geom`` are renamed, " "``name`` is also included. (line **16**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:379 +#: ../../build/docs/basic/graphs.rst:458 msgid "``JOIN`` with the `configuration`:" msgstr "" -#: ../../build/docs/basic/graphs.rst:381 +#: ../../build/docs/basic/graphs.rst:460 msgid "Exclude `steps`, `footway`, `path`, `cycleway`. (line **18**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:394 -msgid "Verification:" -msgstr "" - -#: ../../build/docs/basic/graphs.rst:396 +#: ../../build/docs/basic/graphs.rst:475 msgid "Count the rows on the original ``ways`` and on ``vehicle_net``." msgstr "" -#: ../../build/docs/basic/graphs.rst:406 +#: ../../build/docs/basic/graphs.rst:485 msgid "Get the description of the view" msgstr "" -#: ../../build/docs/basic/graphs.rst:418 +#: ../../build/docs/basic/graphs.rst:497 msgid "Exercise 6: Limiting the road network within an area" msgstr "" -#: ../../build/docs/basic/graphs.rst:420 +#: ../../build/docs/basic/graphs.rst:499 msgid "View of smaller set of roads for vehicles" msgstr "" -#: ../../build/docs/basic/graphs.rst:426 +#: ../../build/docs/basic/graphs.rst:505 msgid "Create a view ``taxi_net`` for the `taxi`:" msgstr "" -#: ../../build/docs/basic/graphs.rst:428 +#: ../../build/docs/basic/graphs.rst:507 msgid "" "The taxi can only circulate inside this Bounding Box: " "``(174.775,-36.855,174.76,-36.84)``" msgstr "" -#: ../../build/docs/basic/graphs.rst:429 +#: ../../build/docs/basic/graphs.rst:508 #, python-format msgid "The taxi speed is 10% slower than the particular vehicle." msgstr "" -#: ../../build/docs/basic/graphs.rst:431 +#: ../../build/docs/basic/graphs.rst:510 msgid "Verify the reduced number of road segments." msgstr "" -#: ../../build/docs/basic/graphs.rst:437 +#: ../../build/docs/basic/graphs.rst:516 #, python-format msgid "" "Adjust the taxi's ``cost`` and ``reverse_cost`` to be 10% slower than of the " "particular vehicle. (line **7**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:439 +#: ../../build/docs/basic/graphs.rst:518 msgid "" "The graph for the taxi is a subset of the ``vehicle_net`` graph. (line **9**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:440 +#: ../../build/docs/basic/graphs.rst:519 msgid "" "Can only circulate inside the bounding box: " "``(174.775,-36.855,174.76,-36.84)``. (line **10**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:454 +#: ../../build/docs/basic/graphs.rst:533 msgid "Count the rows on ``taxi_net``." msgstr "" -#: ../../build/docs/basic/graphs.rst:465 ../../build/docs/basic/graphs.rst:528 +#: ../../build/docs/basic/graphs.rst:544 ../../build/docs/basic/graphs.rst:610 msgid "Get the description." msgstr "" -#: ../../build/docs/basic/graphs.rst:476 +#: ../../build/docs/basic/graphs.rst:555 msgid "Exercise 7: Creating a materialized view for routing pedestrians" msgstr "" -#: ../../build/docs/basic/graphs.rst:478 +#: ../../build/docs/basic/graphs.rst:557 msgid "View of roads for pedestrians" msgstr "" -#: ../../build/docs/basic/graphs.rst:484 +#: ../../build/docs/basic/graphs.rst:563 msgid "" "Create a materialized view with minimal amount of information for processing " "pedestrians." msgstr "" -#: ../../build/docs/basic/graphs.rst:485 +#: ../../build/docs/basic/graphs.rst:565 msgid "" "Routing `cost` and `reverse_cost` will be on seconds for routing " "calculations." msgstr "" -#: ../../build/docs/basic/graphs.rst:489 -msgid "Exclude `motorway` , `primary` and `secondary` segments." +#: ../../build/docs/basic/graphs.rst:567 +msgid "The speed is ``2 mts/sec``." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:569 +msgid "" +"Only include the pedestrian only roads: ``pedestrian``, ``steps``, " +"``footway``, ``path``, ``cycleway``" msgstr "" -#: ../../build/docs/basic/graphs.rst:492 -msgid "`length_m` The length in meters." +#: ../../build/docs/basic/graphs.rst:573 +msgid "``length_m`` The length in meters." msgstr "" -#: ../../build/docs/basic/graphs.rst:493 -msgid "`the_geom` The geometry." +#: ../../build/docs/basic/graphs.rst:574 +msgid "``the_geom`` The geometry." msgstr "" -#: ../../build/docs/basic/graphs.rst:501 +#: ../../build/docs/basic/graphs.rst:582 msgid "Similar to `Exercise 5: Creating a view for routing`_:" msgstr "" -#: ../../build/docs/basic/graphs.rst:503 +#: ../../build/docs/basic/graphs.rst:584 msgid "" "The ``cost`` and ``reverse_cost`` are in terms of seconds with speed of ``2 " "mts/sec``. (line **7**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:504 -msgid "Exclude `motorway`, `primary` and `secondary` . (line **11**)" +#: ../../build/docs/basic/graphs.rst:586 +msgid "Exclude ``motorway``, ``primary`` and ``secondary`` . (line **11**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:517 +#: ../../build/docs/basic/graphs.rst:599 msgid "Count the rows on the view ``walk_net``." msgstr "" -#: ../../build/docs/basic/graphs.rst:540 -msgid "Exercise 8: Testing the views for routing" +#: ../../build/docs/basic/graphs.rst:621 +msgid "pgr_dijkstraCostMatrix" msgstr "" -#: ../../build/docs/basic/graphs.rst:542 -msgid "From the |ch7_place_1| to the |ch7_place_2|" +#: ../../build/docs/basic/graphs.rst:623 +msgid "" +"``pgr_dijkstraCostMatrix`` Calculates a cost matrix using Dijkstra algorithm." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:634 +msgid "" +"Description of the function can be found in `pgr_dijkstraCostMatrix `__" msgstr "" -#: ../../build/docs/basic/graphs.rst:548 +#: ../../build/docs/basic/graphs.rst:638 +msgid "Exercise 8: Testing the views" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:645 msgid "Test the created views" msgstr "" -#: ../../build/docs/basic/graphs.rst:550 +#: ../../build/docs/basic/graphs.rst:647 msgid "In particular:" msgstr "" -#: ../../build/docs/basic/graphs.rst:552 -msgid "From the |ch7_place_1| to the \"|ch7_place_2| using the OSM identifier" +#: ../../build/docs/basic/graphs.rst:649 +msgid "" +"Get a traveling cost matrix in seconds from all locations to all locations." msgstr "" -#: ../../build/docs/basic/graphs.rst:553 +#: ../../build/docs/basic/graphs.rst:650 msgid "the views to be tested are:" msgstr "" -#: ../../build/docs/basic/graphs.rst:555 +#: ../../build/docs/basic/graphs.rst:652 msgid "``vehicle_net``" msgstr "" -#: ../../build/docs/basic/graphs.rst:556 +#: ../../build/docs/basic/graphs.rst:653 msgid "``taxi_net``" msgstr "" -#: ../../build/docs/basic/graphs.rst:557 +#: ../../build/docs/basic/graphs.rst:654 msgid "``walk_net``" msgstr "" -#: ../../build/docs/basic/graphs.rst:559 -msgid "" -"Only show the following results, as the other columns are to be ignored on " -"the function." +#: ../../build/docs/basic/graphs.rst:658 +msgid "The locations are:" msgstr "" -#: ../../build/docs/basic/graphs.rst:561 -msgid "``seq``" +#: ../../build/docs/basic/graphs.rst:660 +msgid "|id_1|, |id_2|, |id_3|, |id_4| and |id_5|." msgstr "" -#: ../../build/docs/basic/graphs.rst:562 -msgid "``edge`` with the name ``id``" +#: ../../build/docs/basic/graphs.rst:661 +msgid "Passed as an array to the function." msgstr "" -#: ../../build/docs/basic/graphs.rst:563 -msgid "``cost`` with the name: ``seconds``" -msgstr "" - -#: ../../build/docs/basic/graphs.rst:567 -msgid "In general" -msgstr "" - -#: ../../build/docs/basic/graphs.rst:569 -msgid "The departure is |ch7_place_1| with OSM identifier |ch7_osmid_1|." -msgstr "" - -#: ../../build/docs/basic/graphs.rst:570 -msgid "The destination is |ch7_place_2| with OSM identifier |ch7_osmid_2|." -msgstr "" - -#: ../../build/docs/basic/graphs.rst:572 +#: ../../build/docs/basic/graphs.rst:663 msgid "For ``vehicle_net``:" msgstr "" -#: ../../build/docs/basic/graphs.rst:574 +#: ../../build/docs/basic/graphs.rst:665 msgid "``vehicle_net`` is used." msgstr "" -#: ../../build/docs/basic/graphs.rst:575 +#: ../../build/docs/basic/graphs.rst:666 msgid "" "Selection of the columns with the corresponding names are on line **1**." msgstr "" -#: ../../build/docs/basic/graphs.rst:576 +#: ../../build/docs/basic/graphs.rst:667 msgid "The view is prepared with the column names that pgRouting use." msgstr "" -#: ../../build/docs/basic/graphs.rst:578 +#: ../../build/docs/basic/graphs.rst:669 msgid "There is no need to rename columns. (line **3**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:580 +#: ../../build/docs/basic/graphs.rst:671 msgid "" "The OSM identifiers of the departure and destination are used. (line **4**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:593 +#: ../../build/docs/basic/graphs.rst:684 msgid "For ``taxi_net``:" msgstr "" -#: ../../build/docs/basic/graphs.rst:595 +#: ../../build/docs/basic/graphs.rst:686 msgid "Similar as the previous one but with ``taxi_net``. (line **3**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:596 +#: ../../build/docs/basic/graphs.rst:687 msgid "" "The results give the same route as with ``vehicle_net`` but ``cost`` is " "higher." msgstr "" -#: ../../build/docs/basic/graphs.rst:609 +#: ../../build/docs/basic/graphs.rst:700 msgid "For ``walk_net``:" msgstr "" -#: ../../build/docs/basic/graphs.rst:611 +#: ../../build/docs/basic/graphs.rst:702 msgid "Similar as the previous one but with ``walk_net``. (line **3**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:612 +#: ../../build/docs/basic/graphs.rst:703 msgid "The results give a different route than of the vehicles." msgstr "" diff --git a/locale/pot/basic/graphs.pot b/locale/pot/basic/graphs.pot index feeb9722c..5f1f68d9c 100644 --- a/locale/pot/basic/graphs.pot +++ b/locale/pot/basic/graphs.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 18:35+0000\n" +"POT-Creation-Date: 2025-10-03 17:35+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: ../../build/docs/basic/graphs.rst:12 -msgid "Graph views" +msgid "Graphs" msgstr "" #: ../../build/docs/basic/graphs.rst:18 @@ -28,565 +28,652 @@ msgstr "" msgid "Different application require different graphs. This chapter covers how to discard disconnected segments and different approaches to create graphs." msgstr "" -#: ../../build/docs/basic/graphs.rst:24 -msgid "The graph requirements" +#: ../../build/docs/basic/graphs.rst:23 +msgid "pgRouting functions in this chapter" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:25 +msgid "`pgr_extractVertices`_" msgstr "" #: ../../build/docs/basic/graphs.rst:26 -msgid "In this chapter there are three graph requirements. It consists on three graphs based on a **fully connected** graph derived from ``ways``: two for different types of vehicles and one for pedestrian, the source and the target in all of them are based on the ``source_osm`` and ``target_osm``." +msgid "`pgr_connectedComponents`_" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:27 +msgid "`pgr_dijkstraCostMatrix`_" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:30 +msgid "The graph requirements" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:32 +msgid "In this chapter there are three graph requirements. It consists on three graphs based on a **fully connected** graph derived from ``ways``: two for different types of vehicles and one for pedestrian, the source and the target in all of them are based on the ``source`` and ``target``." msgstr "" -#: ../../build/docs/basic/graphs.rst:31 +#: ../../build/docs/basic/graphs.rst:37 msgid "The description of the graphs:" msgstr "" -#: ../../build/docs/basic/graphs.rst:33 +#: ../../build/docs/basic/graphs.rst:39 msgid "Particular vehicle:" msgstr "" -#: ../../build/docs/basic/graphs.rst:35 +#: ../../build/docs/basic/graphs.rst:41 msgid "Circulate on the whole Auckland area." msgstr "" -#: ../../build/docs/basic/graphs.rst:37 -#: ../../build/docs/basic/graphs.rst:46 -msgid "Do not use `steps`, `footway`, `path`, `cycleway`." +#: ../../build/docs/basic/graphs.rst:43 +#: ../../build/docs/basic/graphs.rst:52 +msgid "Do not use `pedestrian`, `steps`, `footway`, `path`, `cycleway`" msgstr "" -#: ../../build/docs/basic/graphs.rst:39 +#: ../../build/docs/basic/graphs.rst:45 msgid "Speed is the default speed from OSM information." msgstr "" -#: ../../build/docs/basic/graphs.rst:41 +#: ../../build/docs/basic/graphs.rst:47 msgid "Taxi vehicle:" msgstr "" -#: ../../build/docs/basic/graphs.rst:43 +#: ../../build/docs/basic/graphs.rst:49 msgid "Circulate on a smaller area:" msgstr "" -#: ../../build/docs/basic/graphs.rst:45 +#: ../../build/docs/basic/graphs.rst:51 msgid "Bounding box: ``(174.775,-36.855,174.76,-36.84)``" msgstr "" -#: ../../build/docs/basic/graphs.rst:48 +#: ../../build/docs/basic/graphs.rst:54 msgid "Speed is 10% slower than that of the particular vehicles." msgstr "" -#: ../../build/docs/basic/graphs.rst:50 +#: ../../build/docs/basic/graphs.rst:56 msgid "Pedestrians:" msgstr "" -#: ../../build/docs/basic/graphs.rst:52 +#: ../../build/docs/basic/graphs.rst:58 msgid "Walk on the whole Auckland area." msgstr "" -#: ../../build/docs/basic/graphs.rst:53 -msgid "Can not walk on exclusive vehicle ways" +#: ../../build/docs/basic/graphs.rst:59 +msgid "Can only use pedestrian only ways:" msgstr "" -#: ../../build/docs/basic/graphs.rst:55 -msgid "`motorways` and on `primary` segments." +#: ../../build/docs/basic/graphs.rst:61 +msgid "`pedestrian`, `steps`, `footway`, `path`, `cycleway`" msgstr "" -#: ../../build/docs/basic/graphs.rst:57 -#: ../../build/docs/basic/graphs.rst:487 -msgid "The speed is ``2 mts/sec``." +#: ../../build/docs/basic/graphs.rst:63 +msgid "The walking speed is ``2 mts/sec``." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:66 +msgid "Configuration from osm2pgrouting" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:68 +msgid "When dealing with data, being aware of what kind of data is being used can improve results." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:71 +msgid "Vehicles can not circulate on pedestrian ways" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:78 +msgid "Penalizing or removal of pedestrian ways will make the results closer to reality." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:80 +msgid "When converting data from OSM format using the `osm2pgrouting` tool, there is an additional table: ``configuration``." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:84 +msgid "The ``configuration`` table structure can be obtained with the following command." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:93 +msgid "tag_id values" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:99 +msgid "In the image above there is a detail of the ``tag_id`` of the roads." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:103 +msgid "The `OSM highway `__ types:" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:113 +msgid "Also, on the ``ways`` table there is a column that can be used to ``JOIN`` with the ``configuration`` table." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:116 +msgid "The configuration types in the Auckland data" msgstr "" -#: ../../build/docs/basic/graphs.rst:60 +#: ../../build/docs/basic/graphs.rst:126 msgid "pgr_extractVertices" msgstr "" -#: ../../build/docs/basic/graphs.rst:62 -msgid "``pgr_extractVertices`` extracts the vertices (nodes) from an edge table and reports per-vertex attributes such as degree" +#: ../../build/docs/basic/graphs.rst:128 +msgid "``pgr_extractVertices`` extracting the vertex information of the set of edges of a graph." msgstr "" -#: ../../build/docs/basic/graphs.rst:66 -#: ../../build/docs/basic/graphs.rst:213 +#: ../../build/docs/basic/graphs.rst:132 +#: ../../build/docs/basic/graphs.rst:296 +#: ../../build/docs/basic/graphs.rst:626 msgid "Signature summary" msgstr "" -#: ../../build/docs/basic/graphs.rst:74 +#: ../../build/docs/basic/graphs.rst:140 msgid "Description of the function can be found in `pgr_extractVertices `__" msgstr "" -#: ../../build/docs/basic/graphs.rst:78 +#: ../../build/docs/basic/graphs.rst:144 msgid "Exercise 1: Create a vertices table" msgstr "" -#: ../../build/docs/basic/graphs.rst:81 -#: ../../build/docs/basic/graphs.rst:129 -#: ../../build/docs/basic/graphs.rst:229 -#: ../../build/docs/basic/graphs.rst:277 -#: ../../build/docs/basic/graphs.rst:354 -#: ../../build/docs/basic/graphs.rst:425 -#: ../../build/docs/basic/graphs.rst:483 -#: ../../build/docs/basic/graphs.rst:547 +#: ../../build/docs/basic/graphs.rst:147 +#: ../../build/docs/basic/graphs.rst:196 +#: ../../build/docs/basic/graphs.rst:312 +#: ../../build/docs/basic/graphs.rst:358 +#: ../../build/docs/basic/graphs.rst:433 +#: ../../build/docs/basic/graphs.rst:504 +#: ../../build/docs/basic/graphs.rst:562 +#: ../../build/docs/basic/graphs.rst:644 msgid "Problem" msgstr "" -#: ../../build/docs/basic/graphs.rst:82 +#: ../../build/docs/basic/graphs.rst:148 msgid "Create the vertices table corresponding to the edges in ``ways``." msgstr "" -#: ../../build/docs/basic/graphs.rst:85 -#: ../../build/docs/basic/graphs.rst:133 -#: ../../build/docs/basic/graphs.rst:233 -#: ../../build/docs/basic/graphs.rst:286 -#: ../../build/docs/basic/graphs.rst:368 -#: ../../build/docs/basic/graphs.rst:434 -#: ../../build/docs/basic/graphs.rst:498 -#: ../../build/docs/basic/graphs.rst:566 +#: ../../build/docs/basic/graphs.rst:151 +#: ../../build/docs/basic/graphs.rst:200 +#: ../../build/docs/basic/graphs.rst:316 +#: ../../build/docs/basic/graphs.rst:367 +#: ../../build/docs/basic/graphs.rst:447 +#: ../../build/docs/basic/graphs.rst:513 +#: ../../build/docs/basic/graphs.rst:579 +#: ../../build/docs/basic/graphs.rst:657 msgid "Solution" msgstr "" -#: ../../build/docs/basic/graphs.rst:86 +#: ../../build/docs/basic/graphs.rst:152 msgid "A graph consists of a set of vertices and a set of edges." msgstr "" -#: ../../build/docs/basic/graphs.rst:87 +#: ../../build/docs/basic/graphs.rst:153 msgid "In this case, the ``ways`` table is a set of edges." msgstr "" -#: ../../build/docs/basic/graphs.rst:88 +#: ../../build/docs/basic/graphs.rst:154 msgid "In order to make use of all the graph functions from pgRouting, it is required have the set of vertices defined." msgstr "" -#: ../../build/docs/basic/graphs.rst:90 -msgid "From the requirements, the graph is going to be based on OSM identifiers." +#: ../../build/docs/basic/graphs.rst:156 +msgid "From the requirements, a fully connected graph is needed, therefore adding a ``component`` column." msgstr "" -#: ../../build/docs/basic/graphs.rst:103 +#: ../../build/docs/basic/graphs.rst:170 msgid "Reviewing the description of the vertices table" msgstr "" -#: ../../build/docs/basic/graphs.rst:113 +#: ../../build/docs/basic/graphs.rst:180 msgid "Inspecting the information on the vertices table" msgstr "" -#: ../../build/docs/basic/graphs.rst:126 +#: ../../build/docs/basic/graphs.rst:193 msgid "Exercise 2: Fill up other columns in the vertices table" msgstr "" -#: ../../build/docs/basic/graphs.rst:130 +#: ../../build/docs/basic/graphs.rst:197 msgid "Fill up geometry information on the vertices table." msgstr "" -#: ../../build/docs/basic/graphs.rst:134 +#: ../../build/docs/basic/graphs.rst:201 msgid "Count the number of rows that need to be filled up." msgstr "" -#: ../../build/docs/basic/graphs.rst:144 -msgid "Update the ``geom`` columns based on the ``source_osm`` column from ``ways`` table." +#: ../../build/docs/basic/graphs.rst:212 +msgid "Update the ``geom`` and ``osm_id`` columns" msgstr "" -#: ../../build/docs/basic/graphs.rst:146 -msgid "Use the start point of the geometry." +#: ../../build/docs/basic/graphs.rst:213 +msgid "The update based on the ``source`` column from ``ways`` table and the ``id`` column of the vertices table." msgstr "" -#: ../../build/docs/basic/graphs.rst:157 -msgid "Not expecting to be done due to the fact that some vertices are only dead ends." +#: ../../build/docs/basic/graphs.rst:215 +msgid "To update ``geom`` column, use the start point of the geometry on the ``ways`` table." msgstr "" -#: ../../build/docs/basic/graphs.rst:168 -msgid "Update the ``geom`` columns based on the ``target_osm`` column from ``ways`` table." +#: ../../build/docs/basic/graphs.rst:217 +msgid "Use the ``source_osm`` value to fill up ``osm_id`` column." msgstr "" -#: ../../build/docs/basic/graphs.rst:170 -msgid "Use the end point of the geometry." +#: ../../build/docs/basic/graphs.rst:225 +#: ../../build/docs/basic/graphs.rst:255 +#: ../../build/docs/basic/graphs.rst:282 +#: ../../build/docs/basic/graphs.rst:474 +msgid "Verification" msgstr "" -#: ../../build/docs/basic/graphs.rst:181 +#: ../../build/docs/basic/graphs.rst:230 +msgid "Not expecting to be done due to the fact that some vertices are dead ends." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:242 +msgid "Continue update the ``geom`` and ``osm_id`` columns" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:243 +msgid "The update based on the ``target`` column from ``ways`` table and the ``id`` column of the vertices table." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:245 +msgid "To update ``geom`` column, use the end point of the geometry on the ``ways`` table." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:247 +msgid "Use the ``target_osm`` value to fill up ``osm_id`` column." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:260 msgid "Expecting to be done, that is the geometry column should not have a ``NULL`` value." msgstr "" -#: ../../build/docs/basic/graphs.rst:193 +#: ../../build/docs/basic/graphs.rst:273 +msgid "Update the ``x`` and ``y`` columns" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:274 msgid "Update the ``x`` and ``y`` columns based on the ``geom`` column." msgstr "" -#: ../../build/docs/basic/graphs.rst:206 +#: ../../build/docs/basic/graphs.rst:289 msgid "pgr_connectedComponents" msgstr "" -#: ../../build/docs/basic/graphs.rst:208 +#: ../../build/docs/basic/graphs.rst:291 msgid "``pgr_connectedComponents`` compute the connected components of an undirected graph using a Depth First Search approach. A connected component of an undirected graph is a set of vertices that are all reachable from each other." msgstr "" -#: ../../build/docs/basic/graphs.rst:221 +#: ../../build/docs/basic/graphs.rst:304 msgid "Description of the function can be found in `pgr_connectedComponents `__" msgstr "" -#: ../../build/docs/basic/graphs.rst:226 +#: ../../build/docs/basic/graphs.rst:309 msgid "Exercise 3: Set components on edges and vertices tables" msgstr "" -#: ../../build/docs/basic/graphs.rst:230 +#: ../../build/docs/basic/graphs.rst:313 msgid "Get the information about the graph components." msgstr "" -#: ../../build/docs/basic/graphs.rst:234 -msgid "Create additional columns on the edges and vertices tables." +#: ../../build/docs/basic/graphs.rst:317 +msgid "Create additional columns on the edges tables." msgstr "" -#: ../../build/docs/basic/graphs.rst:245 +#: ../../build/docs/basic/graphs.rst:329 msgid "Use the ``pgr_connectedComponents`` to fill up the vertices table." msgstr "" -#: ../../build/docs/basic/graphs.rst:247 -msgid "Use the results to store the component numbers on the vertices table. (**line 1**)" -msgstr "" - -#: ../../build/docs/basic/graphs.rst:249 -msgid "Use the OSM identifiers of the vertices. (**lines 4-5**)" +#: ../../build/docs/basic/graphs.rst:330 +msgid "Use the results to store the component numbers on the vertices table." msgstr "" -#: ../../build/docs/basic/graphs.rst:261 +#: ../../build/docs/basic/graphs.rst:343 msgid "Update the edges table with based on the component number of the vertex" msgstr "" -#: ../../build/docs/basic/graphs.rst:274 +#: ../../build/docs/basic/graphs.rst:355 msgid "Exercise 4: Inspect the components" msgstr "" -#: ../../build/docs/basic/graphs.rst:278 +#: ../../build/docs/basic/graphs.rst:359 msgid "Answer the following questions:" msgstr "" -#: ../../build/docs/basic/graphs.rst:280 -#: ../../build/docs/basic/graphs.rst:287 +#: ../../build/docs/basic/graphs.rst:361 msgid "How many components are in the vertices table?" msgstr "" -#: ../../build/docs/basic/graphs.rst:281 -#: ../../build/docs/basic/graphs.rst:300 +#: ../../build/docs/basic/graphs.rst:362 msgid "How many components are in the edges table?" msgstr "" -#: ../../build/docs/basic/graphs.rst:282 -#: ../../build/docs/basic/graphs.rst:313 +#: ../../build/docs/basic/graphs.rst:363 msgid "List the 10 components with more edges." msgstr "" -#: ../../build/docs/basic/graphs.rst:283 -#: ../../build/docs/basic/graphs.rst:327 +#: ../../build/docs/basic/graphs.rst:364 msgid "Get the component with the maximum number of edges." msgstr "" -#: ../../build/docs/basic/graphs.rst:289 -#: ../../build/docs/basic/graphs.rst:302 +#: ../../build/docs/basic/graphs.rst:369 +msgid "1. How many components are in the vertices table?" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:370 +#: ../../build/docs/basic/graphs.rst:383 msgid "Count the distinct components." msgstr "" -#: ../../build/docs/basic/graphs.rst:315 +#: ../../build/docs/basic/graphs.rst:382 +msgid "2. How many components are in the edges table?" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:395 +msgid "3. List the 10 components with more edges." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:396 msgid "Count number of rows grouped by component. (**line 1**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:316 +#: ../../build/docs/basic/graphs.rst:397 msgid "Inverse order to display the top 10. (**line 2**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:329 +#: ../../build/docs/basic/graphs.rst:409 +msgid "4. Get the component with the maximum number of edges." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:410 msgid "Use the query from last question to get the maximum count" msgstr "" -#: ../../build/docs/basic/graphs.rst:330 +#: ../../build/docs/basic/graphs.rst:411 msgid "Get the component that matches the maximum value." msgstr "" -#: ../../build/docs/basic/graphs.rst:344 +#: ../../build/docs/basic/graphs.rst:423 msgid "Preparing the graphs" msgstr "" -#: ../../build/docs/basic/graphs.rst:347 +#: ../../build/docs/basic/graphs.rst:426 msgid "Exercise 5: Creating a view for routing" msgstr "" -#: ../../build/docs/basic/graphs.rst:349 +#: ../../build/docs/basic/graphs.rst:428 msgid "View of roads for vehicles" msgstr "" -#: ../../build/docs/basic/graphs.rst:355 +#: ../../build/docs/basic/graphs.rst:434 msgid "Create a view with minimal amount of information for processing the particular vehicles." msgstr "" -#: ../../build/docs/basic/graphs.rst:356 -msgid "Use the OSM identifiers on the vertices." -msgstr "" - -#: ../../build/docs/basic/graphs.rst:357 +#: ../../build/docs/basic/graphs.rst:435 msgid "Routing `cost` and `reverse_cost` in terms of seconds for routing calculations." msgstr "" -#: ../../build/docs/basic/graphs.rst:358 +#: ../../build/docs/basic/graphs.rst:436 msgid "Exclude `steps`, `footway`, `path`, `cycleway` segments." msgstr "" -#: ../../build/docs/basic/graphs.rst:359 -#: ../../build/docs/basic/graphs.rst:490 +#: ../../build/docs/basic/graphs.rst:437 +#: ../../build/docs/basic/graphs.rst:571 msgid "Data needed in the view for further processing." msgstr "" -#: ../../build/docs/basic/graphs.rst:361 -msgid "`name` The name of the segment." +#: ../../build/docs/basic/graphs.rst:439 +msgid "``name`` The name of the segment." msgstr "" -#: ../../build/docs/basic/graphs.rst:362 -msgid "`length_m` The length in meters rename to ``length``." +#: ../../build/docs/basic/graphs.rst:440 +msgid "``length_m`` The length in meters rename to ``length``." msgstr "" -#: ../../build/docs/basic/graphs.rst:363 -msgid "`the_geom` The geometry rename to ``geom``." +#: ../../build/docs/basic/graphs.rst:441 +msgid "``the_geom`` The geometry rename to ``geom``." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:442 +msgid "``tag_id`` Keep as is." msgstr "" -#: ../../build/docs/basic/graphs.rst:365 -#: ../../build/docs/basic/graphs.rst:495 +#: ../../build/docs/basic/graphs.rst:444 +#: ../../build/docs/basic/graphs.rst:576 msgid "Verify the number of edges was reduced." msgstr "" -#: ../../build/docs/basic/graphs.rst:369 -#: ../../build/docs/basic/graphs.rst:435 -#: ../../build/docs/basic/graphs.rst:499 +#: ../../build/docs/basic/graphs.rst:448 +#: ../../build/docs/basic/graphs.rst:514 +#: ../../build/docs/basic/graphs.rst:580 msgid "Creating the view:" msgstr "" -#: ../../build/docs/basic/graphs.rst:371 +#: ../../build/docs/basic/graphs.rst:450 msgid "If you need to reconstruct the view, first drop it using the command on **line 1**." msgstr "" -#: ../../build/docs/basic/graphs.rst:373 +#: ../../build/docs/basic/graphs.rst:452 msgid "Get the component with maximum number of edges (**lines 6-10**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:374 +#: ../../build/docs/basic/graphs.rst:453 msgid "The `source` and `target` requirements for the function are to be with OSM identifiers. (line **14**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:376 +#: ../../build/docs/basic/graphs.rst:455 msgid "The ``cost`` and ``reverse_cost`` are in terms of seconds. (line **15**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:377 +#: ../../build/docs/basic/graphs.rst:456 msgid "The additional parameters ``length_m`` and ``the_geom`` are renamed, ``name`` is also included. (line **16**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:379 +#: ../../build/docs/basic/graphs.rst:458 msgid "``JOIN`` with the `configuration`:" msgstr "" -#: ../../build/docs/basic/graphs.rst:381 +#: ../../build/docs/basic/graphs.rst:460 msgid "Exclude `steps`, `footway`, `path`, `cycleway`. (line **18**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:394 -msgid "Verification:" -msgstr "" - -#: ../../build/docs/basic/graphs.rst:396 +#: ../../build/docs/basic/graphs.rst:475 msgid "Count the rows on the original ``ways`` and on ``vehicle_net``." msgstr "" -#: ../../build/docs/basic/graphs.rst:406 +#: ../../build/docs/basic/graphs.rst:485 msgid "Get the description of the view" msgstr "" -#: ../../build/docs/basic/graphs.rst:418 +#: ../../build/docs/basic/graphs.rst:497 msgid "Exercise 6: Limiting the road network within an area" msgstr "" -#: ../../build/docs/basic/graphs.rst:420 +#: ../../build/docs/basic/graphs.rst:499 msgid "View of smaller set of roads for vehicles" msgstr "" -#: ../../build/docs/basic/graphs.rst:426 +#: ../../build/docs/basic/graphs.rst:505 msgid "Create a view ``taxi_net`` for the `taxi`:" msgstr "" -#: ../../build/docs/basic/graphs.rst:428 +#: ../../build/docs/basic/graphs.rst:507 msgid "The taxi can only circulate inside this Bounding Box: ``(174.775,-36.855,174.76,-36.84)``" msgstr "" -#: ../../build/docs/basic/graphs.rst:429 +#: ../../build/docs/basic/graphs.rst:508 msgid "The taxi speed is 10% slower than the particular vehicle." msgstr "" -#: ../../build/docs/basic/graphs.rst:431 +#: ../../build/docs/basic/graphs.rst:510 msgid "Verify the reduced number of road segments." msgstr "" -#: ../../build/docs/basic/graphs.rst:437 +#: ../../build/docs/basic/graphs.rst:516 msgid "Adjust the taxi's ``cost`` and ``reverse_cost`` to be 10% slower than of the particular vehicle. (line **7**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:439 +#: ../../build/docs/basic/graphs.rst:518 msgid "The graph for the taxi is a subset of the ``vehicle_net`` graph. (line **9**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:440 +#: ../../build/docs/basic/graphs.rst:519 msgid "Can only circulate inside the bounding box: ``(174.775,-36.855,174.76,-36.84)``. (line **10**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:454 +#: ../../build/docs/basic/graphs.rst:533 msgid "Count the rows on ``taxi_net``." msgstr "" -#: ../../build/docs/basic/graphs.rst:465 -#: ../../build/docs/basic/graphs.rst:528 +#: ../../build/docs/basic/graphs.rst:544 +#: ../../build/docs/basic/graphs.rst:610 msgid "Get the description." msgstr "" -#: ../../build/docs/basic/graphs.rst:476 +#: ../../build/docs/basic/graphs.rst:555 msgid "Exercise 7: Creating a materialized view for routing pedestrians" msgstr "" -#: ../../build/docs/basic/graphs.rst:478 +#: ../../build/docs/basic/graphs.rst:557 msgid "View of roads for pedestrians" msgstr "" -#: ../../build/docs/basic/graphs.rst:484 +#: ../../build/docs/basic/graphs.rst:563 msgid "Create a materialized view with minimal amount of information for processing pedestrians." msgstr "" -#: ../../build/docs/basic/graphs.rst:485 +#: ../../build/docs/basic/graphs.rst:565 msgid "Routing `cost` and `reverse_cost` will be on seconds for routing calculations." msgstr "" -#: ../../build/docs/basic/graphs.rst:489 -msgid "Exclude `motorway` , `primary` and `secondary` segments." +#: ../../build/docs/basic/graphs.rst:567 +msgid "The speed is ``2 mts/sec``." msgstr "" -#: ../../build/docs/basic/graphs.rst:492 -msgid "`length_m` The length in meters." +#: ../../build/docs/basic/graphs.rst:569 +msgid "Only include the pedestrian only roads: ``pedestrian``, ``steps``, ``footway``, ``path``, ``cycleway``" msgstr "" -#: ../../build/docs/basic/graphs.rst:493 -msgid "`the_geom` The geometry." +#: ../../build/docs/basic/graphs.rst:573 +msgid "``length_m`` The length in meters." +msgstr "" + +#: ../../build/docs/basic/graphs.rst:574 +msgid "``the_geom`` The geometry." msgstr "" -#: ../../build/docs/basic/graphs.rst:501 +#: ../../build/docs/basic/graphs.rst:582 msgid "Similar to `Exercise 5: Creating a view for routing`_:" msgstr "" -#: ../../build/docs/basic/graphs.rst:503 +#: ../../build/docs/basic/graphs.rst:584 msgid "The ``cost`` and ``reverse_cost`` are in terms of seconds with speed of ``2 mts/sec``. (line **7**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:504 -msgid "Exclude `motorway`, `primary` and `secondary` . (line **11**)" +#: ../../build/docs/basic/graphs.rst:586 +msgid "Exclude ``motorway``, ``primary`` and ``secondary`` . (line **11**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:517 +#: ../../build/docs/basic/graphs.rst:599 msgid "Count the rows on the view ``walk_net``." msgstr "" -#: ../../build/docs/basic/graphs.rst:540 -msgid "Exercise 8: Testing the views for routing" +#: ../../build/docs/basic/graphs.rst:621 +msgid "pgr_dijkstraCostMatrix" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:623 +msgid "``pgr_dijkstraCostMatrix`` Calculates a cost matrix using Dijkstra algorithm." msgstr "" -#: ../../build/docs/basic/graphs.rst:542 -msgid "From the |ch7_place_1| to the |ch7_place_2|" +#: ../../build/docs/basic/graphs.rst:634 +msgid "Description of the function can be found in `pgr_dijkstraCostMatrix `__" msgstr "" -#: ../../build/docs/basic/graphs.rst:548 +#: ../../build/docs/basic/graphs.rst:638 +msgid "Exercise 8: Testing the views" +msgstr "" + +#: ../../build/docs/basic/graphs.rst:645 msgid "Test the created views" msgstr "" -#: ../../build/docs/basic/graphs.rst:550 +#: ../../build/docs/basic/graphs.rst:647 msgid "In particular:" msgstr "" -#: ../../build/docs/basic/graphs.rst:552 -msgid "From the |ch7_place_1| to the \"|ch7_place_2| using the OSM identifier" +#: ../../build/docs/basic/graphs.rst:649 +msgid "Get a traveling cost matrix in seconds from all locations to all locations." msgstr "" -#: ../../build/docs/basic/graphs.rst:553 +#: ../../build/docs/basic/graphs.rst:650 msgid "the views to be tested are:" msgstr "" -#: ../../build/docs/basic/graphs.rst:555 +#: ../../build/docs/basic/graphs.rst:652 msgid "``vehicle_net``" msgstr "" -#: ../../build/docs/basic/graphs.rst:556 +#: ../../build/docs/basic/graphs.rst:653 msgid "``taxi_net``" msgstr "" -#: ../../build/docs/basic/graphs.rst:557 +#: ../../build/docs/basic/graphs.rst:654 msgid "``walk_net``" msgstr "" -#: ../../build/docs/basic/graphs.rst:559 -msgid "Only show the following results, as the other columns are to be ignored on the function." -msgstr "" - -#: ../../build/docs/basic/graphs.rst:561 -msgid "``seq``" -msgstr "" - -#: ../../build/docs/basic/graphs.rst:562 -msgid "``edge`` with the name ``id``" -msgstr "" - -#: ../../build/docs/basic/graphs.rst:563 -msgid "``cost`` with the name: ``seconds``" +#: ../../build/docs/basic/graphs.rst:658 +msgid "The locations are:" msgstr "" -#: ../../build/docs/basic/graphs.rst:567 -msgid "In general" +#: ../../build/docs/basic/graphs.rst:660 +msgid "|id_1|, |id_2|, |id_3|, |id_4| and |id_5|." msgstr "" -#: ../../build/docs/basic/graphs.rst:569 -msgid "The departure is |ch7_place_1| with OSM identifier |ch7_osmid_1|." +#: ../../build/docs/basic/graphs.rst:661 +msgid "Passed as an array to the function." msgstr "" -#: ../../build/docs/basic/graphs.rst:570 -msgid "The destination is |ch7_place_2| with OSM identifier |ch7_osmid_2|." -msgstr "" - -#: ../../build/docs/basic/graphs.rst:572 +#: ../../build/docs/basic/graphs.rst:663 msgid "For ``vehicle_net``:" msgstr "" -#: ../../build/docs/basic/graphs.rst:574 +#: ../../build/docs/basic/graphs.rst:665 msgid "``vehicle_net`` is used." msgstr "" -#: ../../build/docs/basic/graphs.rst:575 +#: ../../build/docs/basic/graphs.rst:666 msgid "Selection of the columns with the corresponding names are on line **1**." msgstr "" -#: ../../build/docs/basic/graphs.rst:576 +#: ../../build/docs/basic/graphs.rst:667 msgid "The view is prepared with the column names that pgRouting use." msgstr "" -#: ../../build/docs/basic/graphs.rst:578 +#: ../../build/docs/basic/graphs.rst:669 msgid "There is no need to rename columns. (line **3**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:580 +#: ../../build/docs/basic/graphs.rst:671 msgid "The OSM identifiers of the departure and destination are used. (line **4**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:593 +#: ../../build/docs/basic/graphs.rst:684 msgid "For ``taxi_net``:" msgstr "" -#: ../../build/docs/basic/graphs.rst:595 +#: ../../build/docs/basic/graphs.rst:686 msgid "Similar as the previous one but with ``taxi_net``. (line **3**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:596 +#: ../../build/docs/basic/graphs.rst:687 msgid "The results give the same route as with ``vehicle_net`` but ``cost`` is higher." msgstr "" -#: ../../build/docs/basic/graphs.rst:609 +#: ../../build/docs/basic/graphs.rst:700 msgid "For ``walk_net``:" msgstr "" -#: ../../build/docs/basic/graphs.rst:611 +#: ../../build/docs/basic/graphs.rst:702 msgid "Similar as the previous one but with ``walk_net``. (line **3**)" msgstr "" -#: ../../build/docs/basic/graphs.rst:612 +#: ../../build/docs/basic/graphs.rst:703 msgid "The results give a different route than of the vehicles." msgstr ""