Skip to content

Commit 8de687b

Browse files
authored
Merge pull request #235 from cvvergara/refining-un-chapters
Refining UN chapters
2 parents 2f6b438 + 8878899 commit 8de687b

File tree

16 files changed

+982
-1119
lines changed

16 files changed

+982
-1119
lines changed

Readme.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,26 @@
2121
### Build the workshop:
2222

2323
```bash
24-
cd docs
24+
dropdb city_routing
25+
mkdir build
26+
cd build
27+
cmake ..
2528
make html
29+
cd ..
2630
```
31+
2732
### Building PDF
2833

2934
Install prerequisite:
3035
```bash
3136
sudo apt-get install texlive-latex-extra
3237
```
3338

34-
To build the documentation as PDF:
35-
36-
```bash
37-
cd docs
38-
make latexpdf
39-
cd _build/latex/
40-
pdflatex -interaction=nonstopmode pgRoutingWorkshop.tex
41-
```
42-
4339
## License
4440

4541
This workshop is licensed under a [Creative Commons Attribution-Share Alike 3.0 License](http://creativecommons.org/licenses/by-sa/3.0/).
4642

4743
## Supported by
4844

49-
* [Georepublic](https://georepublic.info)
50-
* [iMaptools](http://imaptools.com)
5145
* [Paragon Corporation](https://www.paragoncorporation.com)
46+
* [erosion](https://www.erosion.dev)

docs/basic/graph_views.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ discard disconnected segments and different approaches to create graphs.
2323
The graph requirements
2424
===============================================================================
2525

26-
In this chapter there are three graph requirements. It consists on three **fully
27-
connected** graphs: two for different types of vehicles and one for pedestrian,
28-
the source and the target in all of them are based on the ``source_osm`` and
29-
``target_osm``.
26+
In this chapter there are three graph requirements. It consists on three graphs
27+
based on a **fully connected** graph derived from ways: two for different types
28+
of vehicles and one for pedestrian, the source and the target in all of them are
29+
based on the ``source_osm`` and ``target_osm``.
3030

3131
The description of the graphs:
3232

@@ -142,7 +142,7 @@ Count the number of rows that need to be filled up.
142142

143143
.. literalinclude:: ../scripts/basic/chapter_7/fill_columns_1.txt
144144

145-
* Update the ``geom`` columns based on the ``sourse_osm`` column
145+
* Update the ``geom`` columns based on the ``source_osm`` column
146146
from ``ways`` table.
147147
* Use the start point of the geometry.
148148

@@ -542,7 +542,7 @@ Exercise 8: Testing the views for routing
542542

543543
.. image:: images/chapter7/ch7-e3.png
544544
:scale: 25%
545-
:alt: From the Venue to the hotel using the osm_id.
545+
:alt: From the "|ch7_place_1|" to the "|ch7_place_2|"
546546

547547
.. rubric:: Problem
548548

@@ -594,7 +594,7 @@ For ``vehicle_net``:
594594
For ``taxi_net``:
595595

596596
* Similar as the previous one but with ``taxi_net``. (line **3**)
597-
* The results give the same route as with ``vehicle_net`` but ``cost`` is lower
597+
* The results give the same route as with ``vehicle_net`` but ``cost`` is higher
598598

599599
.. literalinclude:: ../scripts/basic/chapter_7/all_sections.sql
600600
:language: sql

docs/basic/plpgsql_function.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pl/pgsql function
1515
:align: center
1616

1717
Other kind of functions are `pl/pgsql
18-
<https://www.postgresql.org/docs/current/plpgsql.html>`__. As the applications
18+
<https://www.postgresql.org/docs/current/plpgsql.html>`__. As the applications
1919
requirements become more complex, using wrappers of previously defined functions
2020
becomes necessary for clarity.
2121

@@ -155,7 +155,7 @@ For ways_vertices:
155155

156156
For ``vehicle_net_vertices``:
157157

158-
Modify the previous query
158+
Modify the previous query.
159159

160160
.. literalinclude:: ../scripts/basic/chapter_8/all-sections-8.sql
161161
:language: sql
@@ -245,7 +245,7 @@ Exercise 5: Test nearest vertex function
245245

246246
.. image:: images/chapter8/ch8-taxinet.png
247247
:scale: 15%
248-
:alt: Nearest Vertex in taki network
248+
:alt: Nearest Vertex in taxi network
249249

250250
.. image:: images/chapter8/ch8-walknet.png
251251
:scale: 15%
@@ -335,7 +335,7 @@ Exercise 6: Creating the main function
335335
* It receives the point in natural language format.
336336
* Obtains the OSM identifier needed by ``wrk_dijkstra``.
337337

338-
* ``wrk_dijkstra`` created on :ref:`basic/sql_function:Exercise 6: Function for an application`.
338+
* ``wrk_dijkstra`` created in :doc:`sql_function`
339339

340340
.. rubric:: Solution
341341

@@ -371,7 +371,7 @@ Call to the function ``wrk_dijkstra``
371371
* The vertices table name is formed with ``%1$I_vertices``.
372372

373373
* ``lat1``, ``lon1`` values will replace ``%2$s, %3$s`` respectively.
374-
* ``lat2``, ``lon2`` values will replace ``%2$s, %3$s`` respectively.
374+
* ``lat2``, ``lon2`` values will replace ``%4$s, %5$s`` respectively.
375375

376376
* To get the constructed query in form of a warning:
377377

docs/basic/sql_function.rst

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ The application requirements
3030
===============================================================================
3131

3232
A front end needs the following routing information:
33-
- seq - A unique identifier of the rows
34-
- id - The segment's identifier
35-
- name - The segment's name
36-
- length - The segment's length
37-
- seconds - Number of seconds to traverse the segment
38-
- azimuth - The azimuth of the segment
39-
- route_geom - The routing geometry
40-
- route_readable - The geometry in human readable form.
33+
- ``seq`` - A unique identifier of the rows
34+
- ``id`` - The segment's identifier
35+
- ``name`` - The segment's name
36+
- ``length`` - The segment's length
37+
- ``seconds`` - Number of seconds to traverse the segment
38+
- ``azimuth`` - The azimuth of the segment
39+
- ``route_geom`` - The routing geometry
40+
- ``route_readable`` - The geometry in human readable form.
4141

4242
.. rubric:: Design of the function
4343

@@ -46,28 +46,28 @@ output columns:
4646

4747
.. rubric:: Input parameters
4848

49-
============= ========= =================
50-
Name Type Description
51-
============= ========= =================
52-
edges_subset REGCLASS The table/view that is going to be used for processing
53-
source_osm BIGINT The OSM identifier of the `departure` location.
54-
target_osm BIGINT The OSM identifier of the `destination` location.
55-
============= ========= =================
49+
================= ========= =================
50+
Name Type Description
51+
================= ========= =================
52+
``edges_subset`` REGCLASS The table/view that is going to be used for processing
53+
``source_osm`` BIGINT The OSM identifier of the `departure` location.
54+
``target_osm`` BIGINT The OSM identifier of the `destination` location.
55+
================= ========= =================
5656

5757
.. rubric:: output columns
5858

59-
=============== ========= =================
60-
Name Type Description
61-
=============== ========= =================
62-
seq INTEGER A unique number for each result row.
63-
id BIGINT The edge identifier.
64-
name TEXT The name of the segment.
65-
seconds FLOAT The number of seconds it takes to traverse the segment.
66-
azimuth FLOAT The azimuth of the segment.
67-
length FLOAT The leng in meters of the segment.
68-
route_readable TEXT The geometry in human readable form.
69-
route_geom geometry The geometry of the segment in the correct direction.
70-
=============== ========= =================
59+
================== ========= =================
60+
Name Type Description
61+
================== ========= =================
62+
``seq`` INTEGER A unique number for each result row.
63+
``id`` BIGINT The edge identifier.
64+
``name`` TEXT The name of the segment.
65+
``seconds`` FLOAT The number of seconds it takes to traverse the segment.
66+
``azimuth`` FLOAT The azimuth of the segment.
67+
``length`` FLOAT The leng in meters of the segment.
68+
``route_readable`` TEXT The geometry in human readable form.
69+
``route_geom`` geometry The geometry of the segment in the correct direction.
70+
================== ========= =================
7171

7272

7373
.. note:: For the following exercises only ``vehicle_net`` will be used, but
@@ -122,9 +122,9 @@ Geometry handling
122122
===============================================================================
123123

124124
From pgRouting point of view, the geometry is part of the additional
125-
information, needed on the results for an application. Therefore ``JOIN`` the
126-
results with other tables that contain the geometry, but for further processing
127-
use PostGIS functions.
125+
information, needed on the results for an application. Therefore ``JOIN`` the
126+
results with other tables that contain the geometry and for further processing
127+
with PostGIS functions.
128128

129129
Exercise 2: Route geometry (human readable)
130130
-------------------------------------------------------------------------------
@@ -157,7 +157,7 @@ Route from the |ch7_place_1| to |ch7_place_2|
157157
* The ``geom`` processed with ``ST_AsText`` to get the human readable form.
158158
(line **12**)
159159

160-
* Renaming the result to ``route_readable``
160+
* Renaming the result to ``route_readable``
161161

162162
* The ``LEFT JOIN`` with ``vehicle_net``. (line **14**)
163163

@@ -246,8 +246,8 @@ Route from the |ch7_place_1| to |ch7_place_2|
246246

247247
* Fix the directionality of the geometries of the previous exercise
248248

249-
* ``geom`` in human readable form named as ``route_readable``
250-
* ``geom`` in binary format with the name ``route_geom``
249+
* ``geom`` in human readable form named as ``route_readable``
250+
* ``geom`` in binary format with the name ``route_geom``
251251
* Both columns must have the geometry fixed for directionality.
252252

253253
.. rubric:: Solution

docs/basic/vehicle.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ Exercise 2: Vehicle routing - returning
121121

122122
.. rubric:: Solution:
123123

124-
* Use ``cost`` (line **6**) and ``reverse_cost`` (line **7**) columns, in units ``seconds``.
124+
* Use ``cost_s`` (line **6**) and ``reverse_cost_s`` (line **7**) columns, in
125+
units ``seconds``.
125126
* The vehicle is going from vertex |id_3| (line **10**) to |id_1| (line **11**).
126127

127128
.. literalinclude:: ../scripts/basic/chapter_6/all_exercises.sql
@@ -163,7 +164,7 @@ Exercise 3: Vehicle routing when time is money
163164
:start-after: section-6.1.3
164165
:end-before: section-6.2-1
165166
:language: sql
166-
:emphasize-lines: 6-11
167+
:emphasize-lines: 6-7,10-11
167168

168169
.. collapse:: Query results
169170

docs/conf.py

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,49 @@
104104

105105
# -- Options for HTML output ---------------------------------------------------
106106

107-
# The theme to use for HTML and HTML Help pages. Major themes that come with
108-
# Sphinx are currently 'default' and 'sphinxdoc'.
109-
#html_theme = 'default'
110-
#html_theme = 'workshop-theme'
111-
#html_theme_path = ['.'] # make sphinx search for themes in current dir
112107

113108
################## bootstrap
114109
# Activate the theme.
115110
html_theme = 'bootstrap'
116111
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
117112

118-
# Theme options are theme-specific and customize the look and feel of a theme
119-
# further. For a list of options available for each theme, see the
120-
# documentation.
113+
114+
# Theme options are theme-specific and customize the look and feel of a
115+
# theme further.
116+
# https://github.com/ryan-roemer/sphinx-bootstrap-theme/blob/master/demo/source/conf.py#L105
121117
html_theme_options = {
122-
'navbar_site_name': "Chapters",
123-
'globaltoc_depth': 2,
124-
'navbar_fixed_top': "true",
125-
'bootstrap_version': "3",
118+
# Navigation bar title. (Default: ``project`` value)
119+
#'navbar_title': "Demo",
120+
121+
# Tab name for entire site. (Default: "Site")
122+
'navbar_site_name': "Chapters",
123+
124+
'navbar_links': [
125+
("Documentation", "https://docs.pgrouting.org/latest/en/index.html", True),
126+
],
127+
128+
# Render the next and previous page links in navbar. (Default: true)
129+
'navbar_sidebarrel': True,
130+
131+
'navbar_pagenav': True,
132+
'navbar_pagenav_name': "Page",
133+
'globaltoc_depth': 1,
134+
'globaltoc_includehidden': "true",
135+
'navbar_class': "navbar",
136+
'navbar_fixed_top': "true",
137+
#'source_link_position': "nav",
138+
139+
# Currently, the supported themes are:
140+
# - Bootstrap 2: https://bootswatch.com/2
141+
# - Bootstrap 3: https://bootswatch.com/3
142+
#'bootswatch_theme': "united",
143+
144+
# Choose Bootstrap version.
145+
# Values: "3" (default) or "2" (in quotes)
146+
'bootstrap_version': "2",
126147
}
127148

128-
# Add any paths that contain custom themes here, relative to this directory.
129-
#html_theme_path = []
149+
html_logo = "my_logo.png"
130150

131151
# The name for this set of Sphinx documents. If None, it defaults to
132152
# "<project> v<release> documentation".
@@ -203,7 +223,7 @@ def setup(app):
203223
# (source start file, target name, title, author, documentclass [howto/manual]).
204224
latex_documents = [
205225
('latex', 'pgRoutingWorkshop.tex', u'Workshop - FOSS4G routing with pgRouting',
206-
u'Daniel Kastl, Vicky Vergara', 'manual', False),
226+
u'Vicky Vergara', 'workshop', False),
207227
]
208228

209229
# The name of an image file (relative to this directory) to place at the top of
@@ -233,8 +253,7 @@ def setup(app):
233253
r'http://localhost:\d+/', r'http://localhost:\d+', r'http://localhost/', r'http://127.0.0.1:\d+/',
234254
r'https://localhost:\d+/', r'https://localhost:\d+', r'https://localhost/', r'https://127.0.0.1:\d+/',
235255

236-
# TODO remove when 15 is located
237-
'https://sourceforge.net/projects/osgeo-live/files/15.0/',
256+
r'https://sourceforge.net/projects/osgeo-live/files',
238257
]
239258
linkcheck_anchors = False
240259

@@ -259,8 +278,8 @@ def setup(app):
259278
.. |osm2pgrouting-web| replace:: https://pgrouting.org/docs/tools/osm2pgrouting.html
260279
.. |osm2pgrouting-wiki| replace:: https://github.com/pgRouting/osm2pgrouting/wiki/Documentation-for-osm2pgrouting-v2.2
261280
.. |osm2pgrouting-ver| replace:: 2.3
262-
.. |georepublic| replace:: `GeoRepublic <https://georepublic.info/>`__
263281
.. |paragon| replace:: `Paragon Corporation <https://www.paragoncorporation.com/>`__
282+
.. |erosion| replace:: `Erosion <https://www.erosion.dev/>`__
264283
.. |osgeo| replace:: `OSGeo <https://www.osgeo.org/>`__
265284
.. |id_1| replace:: ``@ID_1@``
266285
.. |id_2| replace:: ``@ID_2@``

docs/general-intro/introduction.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ Aknowledments
5858

5959
.. image:: /images/logos/paragon.png
6060
:alt: Paragon Corporation
61-
:target: https://www.paragoncorporation.com/
61+
:width: 200
62+
:target: |paragon|
63+
64+
.. image:: /images/logos/erosion.png
65+
:alt: Paragon Corporation
66+
:width: 200
67+
:target: |erosion|
6268

6369
.. rubric:: Developers & presenters of @WORKSHOP_AREA@ workshop:
6470

0 commit comments

Comments
 (0)