Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6964f21
sql_functions up to azimuth
cvvergara Jun 26, 2026
838416d
Looks like it is clean
cvvergara Jun 26, 2026
0e5c9a8
sql_function CMakeLists: fix BYPRODUCTS list and add DEPENDS
cvvergara Jun 26, 2026
89b09e6
Removing unused images of sql_function chapter
cvvergara Jun 28, 2026
fa4e3cd
sql_function chapter: updating content and images
cvvergara Jun 28, 2026
ad24bd1
withPoints CMakeLists: convert to PRE_BUILD/BYPRODUCTS pattern
cvvergara Jun 28, 2026
f34dd80
withPoints chapter is done
cvvergara Jun 28, 2026
75a95e9
Removing unused script
cvvergara Jun 28, 2026
9b27a0e
basic CMakeLists: clean up dependencies; vehicles: fix BYPRODUCTS list
cvvergara Jun 28, 2026
9d3460c
get_data: moved scripts to setup the databases
cvvergara Jun 30, 2026
97ac20b
get data: adding scripts to fix compatablity with osm2pgrouting
cvvergara Jun 30, 2026
c198b45
Renaming file to standard prefix setup_
cvvergara Jun 30, 2026
7dd48e0
setup_city_routing.sh Adding missing shebang
cvvergara Jun 30, 2026
0da979e
Adjusting build and files becuase of setup_ standard
cvvergara Jul 1, 2026
84970ed
Renaming all_exercises_<name> -> <name>
cvvergara Jul 1, 2026
3204bb5
Adjusting build and files becuase of filenames change
cvvergara Jul 1, 2026
9c389a8
sdg3: Removing unused files
cvvergara Jul 1, 2026
87c243e
Adjusting build and files becuase of removed files
cvvergara Jul 1, 2026
71bcd08
sdg11 Removing unused files
cvvergara Jul 1, 2026
3563805
Adjusting build and docs becuase of removal
cvvergara Jul 1, 2026
a7bae31
Build includes patch for old versions of osm2pgrouting
cvvergara Jul 1, 2026
dc80003
Standardizing build files on un_sdg
cvvergara Jul 1, 2026
db30963
mumbai: Removing prefix
cvvergara Jul 1, 2026
4f51138
sdg3: simplify the code
cvvergara Jul 1, 2026
841d3b6
sdg3: updating worshop based on the code rewrite
cvvergara Jul 1, 2026
9b3f5cb
sdg7: adjusting code to tables without prefix
cvvergara Jul 1, 2026
39aeb88
sdg7 adjusting wworkshop based on changes
cvvergara Jul 1, 2026
94e231f
basic/data.rst: adding howto fix compatability with osm2pgrouting
cvvergara Jul 1, 2026
ed5a5a8
un_sdg: data is the last chapter
cvvergara Jul 1, 2026
c9687af
sdg11: Removing prefix waterways
cvvergara Jul 1, 2026
386c888
sdg11: adjusting code without prefix
cvvergara Jul 1, 2026
548ed68
un_sdg: Reorganizing data chapter
cvvergara Jul 1, 2026
1988852
Adjusting text based on no waterways prefix
cvvergara Jul 1, 2026
861b4d0
build: Updating the BYPRODUCTS
cvvergara Jul 1, 2026
b3eac30
sh files to be executable
cvvergara Jul 1, 2026
3ed2b56
sh files adding missing shebang
cvvergara Jul 1, 2026
b40168b
Fixing letter casing on reserved words
cvvergara Jul 1, 2026
3c50589
Update locale: commit b40168b8
github-actions[bot] Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:

strategy:
fail-fast: false
matrix:
osm2pgrouting: [apt, source]

steps:
- uses: actions/checkout@v6
Expand All @@ -35,17 +37,28 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libpq-dev libpqxx-dev libexpat1-dev \
libboost-program-options-dev \
sudo apt-get install -y \
postgresql-${PGVER}-postgis-${PGIS} \
postgresql-${PGVER}-postgis-${PGIS}-scripts \
postgresql-${PGVER}-pgrouting

if [ "${{ matrix.osm2pgrouting }}" = "apt" ]; then
sudo apt-get install -y osm2pgrouting
fi

python -m pip install --upgrade pip
pip install -r REQUIREMENTS.txt
pip list

- name: Install build dependencies
if: matrix.osm2pgrouting == 'source'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libpq-dev libpqxx-dev libexpat1-dev \
libboost-program-options-dev

- name: Build osm2pgrouting from source
if: matrix.osm2pgrouting == 'source'
run: |
wget -q https://github.com/pgRouting/osm2pgrouting/archive/refs/tags/v3.0.0.tar.gz
tar xzf v3.0.0.tar.gz
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libpq-dev libpqxx-dev libexpat1-dev \
libboost-program-options-dev \
sudo apt-get install -y osm2pgrouting \
postgresql-${PGVER}-postgis-${PGIS} \
postgresql-${PGVER}-postgis-${PGIS}-scripts \
postgresql-${PGVER}-pgrouting
Expand All @@ -61,16 +60,6 @@ jobs:
pip install -r REQUIREMENTS.txt
pip list

- name: Build osm2pgrouting from source
run: |
wget -q https://github.com/pgRouting/osm2pgrouting/archive/refs/tags/v3.0.0.tar.gz
tar xzf v3.0.0.tar.gz
python3 -c "import re; c=open('osm2pgrouting-3.0.0/CMakeLists.txt').read(); c=c.replace('if (PQXX_VERSION VERSION_GREATER_EQUAL \"7.0.0\")','if (PQXX_VERSION VERSION_GREATER_EQUAL \"8.0.0\")'); c=c.replace(' set(CMAKE_CXX_STANDARD 17)',' set(CMAKE_CXX_STANDARD 20)\nelseif (PQXX_VERSION VERSION_GREATER_EQUAL \"7.0.0\")\n set(CMAKE_CXX_STANDARD 17)',1); open('osm2pgrouting-3.0.0/CMakeLists.txt','w').write(c)"
cmake -S osm2pgrouting-3.0.0 -B osm2pgrouting-3.0.0/build \
-DCMAKE_BUILD_TYPE=Release
sudo cmake --build osm2pgrouting-3.0.0/build --target install
sudo ldconfig

- name: Configure
run: |
service postgresql status
Expand Down
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ set(PLACE_4 "Grand Prince Hotel Hiroshima")
set(PLACE_5 "RCC Bunka Center")


set(CH7_PLACE_1 ${PLACE_5})
set(CH7_ID_1 ${OSMID_5})
set(CH7_PLACE_1 ${PLACE_2})
set(CH7_ID_1 ${OSMID_2})
set(CH7_PLACE_2 ${PLACE_1})
set(CH7_ID_2 ${OSMID_1})

set(POINT1_LAT "-36.850329")
set(POINT1_LON "174.763094")
set(POINT1_LAT "34.399086")
set(POINT1_LON "132.453875")

set(POINT2_LAT "-36.853675")
set(POINT2_LON "174.764448")
set(POINT2_LAT "34.391111")
set(POINT2_LON "132.451490")

#---------------------------------------------
# minimum versions
#---------------------------------------------
set(SPHINX_MINIMUM_VERSION "4.0.0")
set(Osm2pgrouting_FIND_VERSION "3.0.0")
set(Osm2pgrouting_FIND_VERSION "2.3.1")


#---------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions cmake/FindOsm2pgrouting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ execute_process(
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" Osm2pgrouting_V ${Osm2pgrouting_V})
set(Osm2pgrouting_VERSION ${Osm2pgrouting_V} CACHE STRING "Osm2pgrouting VERSION")

if (false)
if (Osm2pgrouting_FIND_VERSION)
# Check if version found is >= required version
if ("${Osm2pgrouting_VERSION}" VERSION_LESS "${Osm2pgrouting_FIND_VERSION}")
message(FATAL_ERROR "Found osm2pgrouting version ${Osm2pgrouting_VERSION} which is less than requested version ${Osm2pgrouting_FIND_VERSION}")
endif()
endif()
endif()

if(Osm2pgrouting_FIND_COMPONENTS)
foreach(comp ${Osm2pgrouting_FIND_COMPONENTS})
Expand Down
30 changes: 26 additions & 4 deletions docs/basic/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Create a pgRouting compatible database

Create ``city_routing`` database that will be used on the workshop.

.. literalinclude:: ../scripts/get_data/process_osgeolive_data.sh
.. literalinclude:: ../scripts/get_data/setup_city_routing.sh
:start-after: create city_routing
:end-before: connect city_routing
:language: bash
Expand All @@ -48,7 +48,7 @@ Connect to the database
Install pgRouting and its requirements. (otpionally check the version that is
being used)

.. literalinclude:: ../scripts/get_data/process_osgeolive_data.sh
.. literalinclude:: ../scripts/get_data/setup_city_routing.sh
:start-after: << EOF
:end-before: EOF
:language: bash
Expand Down Expand Up @@ -115,7 +115,7 @@ From a terminal window :code:`ctrl-alt-t`.
Run the osm2pgrouting converter
-------------------------------------------------------------------------------

.. literalinclude:: ../scripts/get_data/process_osgeolive_data.sh
.. literalinclude:: ../scripts/get_data/setup_city_routing.sh
:start-after: import city from-here
:end-before: import city to-here
:language: bash
Expand All @@ -124,10 +124,32 @@ Run the osm2pgrouting converter

.. collapse:: Output:

.. literalinclude:: ../scripts/get_data/process_osgeolive_data.txt
.. literalinclude:: ../scripts/get_data/setup_city_routing.txt
:start-after: import city from-here
:end-before: import city to-here

Compatibility with older osm2pgrouting versions
-------------------------------------------------------------------------------

Check the installed version:

.. code-block:: bash

osm2pgrouting --version

If you are using version 2.x, the column names differ from those used in this
workshop:

- ``gid`` instead of ``id``
- ``the_geom`` instead of ``geom``

Run the following script to rename them:

.. collapse:: Script

.. literalinclude:: ../scripts/get_data/osm2pgrouting_compat.sql
:language: postgresql

Tables on the database
-------------------------------------------------------------------------------

Expand Down
12 changes: 6 additions & 6 deletions docs/basic/images/sql_function/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# Files
#---------------------
set(PGR_WORKSHOP_IMG_FILES
sql_azimuth_fixed.png
sql_route_geom.png
sql_route_names.png
sql_route_readable.png
sql_route_geom_detail.png
route_azimuth.png
route_names.png
route_readable.png
route_final.png
good_directionality.png
wrong_directionality.png
)


foreach (f ${PGR_WORKSHOP_IMG_FILES})
if (PGR_WORKSHOP_VERBOSE_DEBUG)
message(STATUS " -> ${f}")
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/basic/images/sql_function/route_azimuth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/basic/images/sql_function/route_final.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/basic/images/sql_function/route_names.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file removed docs/basic/images/sql_function/sql_route_geom.png
Binary file not shown.
Binary file not shown.
Binary file removed docs/basic/images/sql_function/sql_route_names.png
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/basic/images/withPoints/points_on_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/basic/images/withPoints/points_routing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading