Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,16 @@ jobs:

- name: Configure
run: |
service postgresql status
sudo service postgresql start
echo "here 1"
service postgresql status
sudo -u postgres createdb -p ${POSTGRES_PORT} setup
sudo -u postgres psql -c 'CREATE ROLE "runner" SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN PASSWORD $$runner$$;' -d setup
echo :5432:*:runner:runner >> .pgpass
sudo -u postgres psql -c 'CREATE ROLE "user" SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN PASSWORD $$user$$;' -d setup
echo :5432:*:user:user >> .pgpass
echo "here 5"
mkdir -p ~/Desktop/workshop-2019
mkdir build
cd build
cmake -DPGR_WORKSHOP_DEBUG=ON -DES=ON -DSV=ON ..
cmake -DPGR_WORKSHOP_DEBUG=ON ..
psql -l
env:
POSTGRES_HOST: localhost
Expand Down
181 changes: 68 additions & 113 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@

cmake_minimum_required(VERSION 2.8...3.22)
cmake_minimum_required(VERSION 3.12)
if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
message(FATAL_ERROR "In-source builds not allowed.
Please make a new directory (called a build directory) and run CMake from there.
You may need to remove CMakeCache.txt." )
endif()

#---------------------------------------------
#---------------------------------------------
#---------------------------------------------

project(PGR_WORKSHOP LANGUAGES NONE)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

#---------------------------------------------
#---------------------------------------------
#---------------------------------------------

#---------------------------------------------
Expand All @@ -25,7 +21,7 @@ set(WORKSHOP_AREA "FOSS4G ${PGR_WORKSHOP_CITY}")
set(COPYRIGHT "2010-2024 pgRouting Developers")
set(PGR_WORKSHOP_VERSION_MAJOR "3")
set(PGR_WORKSHOP_VERSION_MINOR "0")
set(PGR_WORKSHOP_VERSION_PATCH "0")
set(PGR_WORKSHOP_VERSION_PATCH "1")
set(PGR_WORKSHOP_VERSION_DEV "")
set(PGR_WORKSHOP_VERSION "${PGR_WORKSHOP_VERSION_MAJOR}.${PGR_WORKSHOP_VERSION_MINOR}")
set(PGR_WORKSHOP_RELEASE "${PGR_WORKSHOP_VERSION_MAJOR}.${PGR_WORKSHOP_VERSION_MINOR}.${PGR_WORKSHOP_VERSION_PATCH}${PGR_WORKSHOP_VERSION_DEV}")
Expand Down Expand Up @@ -62,6 +58,10 @@ set(PGR_WORKSHOP_LITTLE_NET_BBOX "-48.52,-1.46,-48.45,-1.41")
set(PGR_WORKSHOP_DOWNLOAD_DIR "workshop-2024")
set(DATE_OF_DATA "Sep 2024")

if (WORKSHOP_DEBUG)
message(STATUS "WORKSHOP_CITY_FILE=${WORKSHOP_CITY_FILE}")
endif()
Comment on lines +61 to +63
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Variable name inconsistency: Missing PGR_ prefix.

The conditional check uses WORKSHOP_DEBUG but the option is defined as PGR_WORKSHOP_DEBUG in Lines 37-38. This will cause the debug message to never execute.

Apply this diff to fix the variable name:

-if (WORKSHOP_DEBUG)
-  message(STATUS "WORKSHOP_CITY_FILE=${WORKSHOP_CITY_FILE}")
+if (PGR_WORKSHOP_DEBUG)
+  message(STATUS "PGR_WORKSHOP_CITY_FILE=${PGR_WORKSHOP_CITY_FILE}")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (WORKSHOP_DEBUG)
message(STATUS "WORKSHOP_CITY_FILE=${WORKSHOP_CITY_FILE}")
endif()
if (PGR_WORKSHOP_DEBUG)
message(STATUS "PGR_WORKSHOP_CITY_FILE=${PGR_WORKSHOP_CITY_FILE}")
endif()
🤖 Prompt for AI Agents
In CMakeLists.txt around lines 61 to 63, the conditional uses WORKSHOP_DEBUG
while the option is defined as PGR_WORKSHOP_DEBUG; update the conditional to
check PGR_WORKSHOP_DEBUG instead so the debug message executes correctly (i.e.,
replace WORKSHOP_DEBUG with PGR_WORKSHOP_DEBUG in the if statement).


set(OSMID_1 "10982869752")
set(OSMID_2 "11818739588")
set(OSMID_3 "491465035")
Expand Down Expand Up @@ -91,26 +91,46 @@ set(CH7_PLACE_2 ${PLACE_1})
set(CH7_OSMID_1 ${OSMID_5})
set(CH7_OSMID_2 ${OSMID_1})



#---------------------------------------------
# minimum versions
#---------------------------------------------
set(SPHINX_MINIMUM_VERSION "2.3")
set(SPHINX_MINIMUM_VERSION "4.0.0")
set(Osm2pgrouting_FIND_VERSION "2.3")


#---------------------------------------------
# Finding sphinx
#---------------------------------------------
find_package(Sphinx REQUIRED)
if (NOT SPHINX_FOUND)

find_program(SPHINX_EXECUTABLE
REQUIRED
NAMES sphinx-build
DOC "Sphinx Documentation Builder (sphinx-doc.org)"
)

# Getting sphinx version
execute_process(COMMAND "${SPHINX_EXECUTABLE}" --version
OUTPUT_VARIABLE SPHINX_EXECUTABLE_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE "sphinx-build" "" SPHINX_EXECUTABLE_VERSION "${SPHINX_EXECUTABLE_VERSION}")
string(STRIP "${SPHINX_EXECUTABLE_VERSION}" SPHINX_EXECUTABLE_VERSION)

if ("${SPHINX_EXECUTABLE_VERSION}" VERSION_LESS "${SPHINX_MINIMUM_VERSION}")
message(FATAL_ERROR "Sphinx required version is ${SPHINX_MINIMUM_VERSION}")
endif()

message(STATUS "Found ${SPHINX_EXECUTABLE} version '${SPHINX_EXECUTABLE_VERSION}'")

if (NOT SPHINX_EXECUTABLE)
message(FATAL_ERROR "Sphinx not found")
#elseif (SPHINX_VERSION VERSION_LESS SPHINX_MINIMUM_VERSION)
# message(WARNING "Your Sphinx version is too old!
# This project requires Sphinx v1.0 or above to produce
# proper documentation (you have v${SPHINX_VERSION}).
# You will get output but it will have errors.")
return()
endif()

set(SPHINX_FLAGS "" CACHE STRING "Flags to pass to sphinx-build")
separate_arguments(sphinx_flags UNIX_COMMAND "${SPHINX_FLAGS}")

#---------------------------------------------
# Finding osm2pgRouting
#---------------------------------------------
Expand All @@ -131,138 +151,79 @@ message(STATUS "Found dropdb ${DROPDB_EXECUTABLE}")
#---------------------------------------------
# Perl
#---------------------------------------------
#---------------------------------------------
include(FindPerl)
if(NOT PERL_EXECUTABLE)
message(FATAL_ERROR " Please check your Perl installation.")
endif(NOT PERL_EXECUTABLE)

execute_process(
COMMAND ${PERL_EXECUTABLE} -MDateTime -e ""
ERROR_QUIET RESULT_VARIABLE DATETIME_STAUS
)
find_package(Perl REQUIRED)


#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------

# Kind of output
# http://www.sphinx-doc.org/en/stable/builders.html

#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
option(ALL_DOC
"Set ON|OFF (default=OFF) to build all documentation styles (exept LOCALE)" OFF)

option(HTML
"Set ON|OFF (default=OFF) to build Documentation library tree as HTML" ON)

option(DIRHTML
"Set ON|OFF (default=OFF) to build Documentation library tree as DIRHTML
STATUS: the navigation does not work " OFF
)

option(SINGLEHTML
"Set ON|OFF (default=OFF) to build Documentation library tree as a single HTML file" OFF
)

option(PICKLE
"Set ON|OFF (default=OFF) to build Documentation library tree as PICKLE" OFF)

option(JSON
"Set ON|OFF (default=OFF) to build Documentation library tree as JSON page" OFF)
option(BUILD_HTML "Set ON|OFF (default=OFF) to build Documentation library tree as HTML" ON)
option(BUILD_PDF "Set ON|OFF (default=OFF) to build Documentation library tree as PDF" OFF)
option(BUILD_LOCALE "Set ON|OFF (default=OFF) to build the locale files" OFF)
option(BUILD_LINKCHECK "Set ON|OFF (default=OFF) to build Documentation library tree as LINKCHECK page" OFF)

option(HTMLHELP
"Set ON|OFF (default=OFF) to build Documentation library tree as HTMLHELP page" OFF)

option(DUMMY
"Set ON|OFF (default=OFF) to build Documentation library tree as DUMMY page" OFF)

option(LATEX
"Set ON|OFF (default=OFF) to build Documentation library tree as LATEX page" OFF)

option(LINKCHECK
"Set ON|OFF (default=OFF) to build Documentation library tree as LINKCHECK page" OFF)

option(LOCALE
"Set ON|OFF (default=OFF) to build the locale files of all languages." OFF
)

foreach(opt HTML DIRHTML SINGLEHTML PICKLE JSON HTMLHELP LATEX LINKCHECK)
if (${${opt}} OR ALL_DOC)
foreach(opt BUILD_HTML BUILD_PDF BUILD_LOCALE BUILD_LINKCHECK)
if (${${opt}} OR WITH_ALL_DOC)
string(TOLOWER ${opt} val)
string(REPLACE "build_" "" val ${val})
list(APPEND PGR_WORKSHOP_DOC_TARGETS ${val})
endif()
endforeach()

message(STATUS "PGR_WORKSHOP_DOC_TARGETS = ${PGR_WORKSHOP_DOC_TARGETS}")


#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
if("${PGR_WORKSHOP_DOC_TARGETS}" STREQUAL "")
message(FATAL_ERROR "No documentation targets found")
endif()

# LANGUAGES SETINGS
message(STATUS "PGR_WORKSHOP_DOC_TARGETS=${PGR_WORKSHOP_DOC_TARGETS}")

#---------------------------------------------
#---------------------------------------------
#---------------------------------------------

#---------------------------------------------
# Avaliable Languages
# English is allways built

# list of sphinx languges support
# http://www.sphinx-doc.org/en/stable/config.html#confval-language
# TODO: figure out how to support this
# "el" "hu" "id" "zh")
# LANGUAGES SETTINGS
#---------------------------------------------
set(PGR_WORKSHOP_SUPPORTED_LANGUAGES "es" "ja" "sv")
set(PGR_WORKSHOP_ENGLISH "en")
list(APPEND WORKSHOP_LANGUAGES_TRANSLATED "EN" "ES" "SV")
list(APPEND WORKSHOP_LANGUAGES "en" "es" "ja" "sv")
message(STATUS "WORKSHOP_LANGUAGES=${WORKSHOP_LANGUAGES}")

#---------------------------------------------
# Language options
#---------------------------------------------
option(ALL_LANG
"Set ON|OFF (default=OFF) to build all documentation supported languages
${PGR_WORKSHOP_SUPPORTED_LANGUAGES}" OFF)

foreach(lang ${PGR_WORKSHOP_SUPPORTED_LANGUAGES})
foreach(lang ${WORKSHOP_LANGUAGES})
string(TOUPPER ${lang} val)
option(${val}
"Set ON|OFF (default=OFF) build ${lang} Documentation" OFF)
if ("${val}" IN_LIST WORKSHOP_LANGUAGES_TRANSLATED)
option(${val} "Set ON|OFF (default=ON) build ${lang} Documentation" ON)
else()
option(${val} "Set ON|OFF (default=OFF) build ${lang} Documentation" OFF)
endif()
endforeach()

#---------------------------------------------
# Catching the language options to be build
#---------------------------------------------
list(APPEND PGR_WORKSHOP_BUILD_LANGUAGES ${PGR_WORKSHOP_ENGLISH})
foreach(lang ${PGR_WORKSHOP_SUPPORTED_LANGUAGES})
foreach(lang ${WORKSHOP_LANGUAGES})
string(TOUPPER ${lang} opt)
if (${opt} OR ALL_LANG)
if (${opt})
list(APPEND PGR_WORKSHOP_BUILD_LANGUAGES ${lang})
endif()
endforeach()

if("${PGR_WORKSHOP_BUILD_LANGUAGES}" STREQUAL "")
message(FATAL_ERROR "No documentation languages found")
endif()

message(STATUS "PGR_WORKSHOP_BUILD_LANGUAGES=${PGR_WORKSHOP_BUILD_LANGUAGES}")



#---------------------------------------------
# All languages po files are to be generated
#---------------------------------------------
set (SPHINXINTL_LANGUAGE ${PGR_WORKSHOP_ENGLISH})
if(LOCALE)
foreach(lang ${PGR_WORKSHOP_SUPPORTED_LANGUAGES})
foreach(lang ${WORKSHOP_LANGUAGES})
set(SPHINXINTL_LANGUAGE "${SPHINXINTL_LANGUAGE},${lang}")
endforeach()
set(PGR_WORKSHOP_LANGUAGES ${PGR_WORKSHOP_ENGLISH})
message(STATUS "SPHINXINTL_LANGUAGE=${SPHINXINTL_LANGUAGE}")
endif()
Comment on lines 219 to 224
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix LOCALE guard and avoid leading comma in SPHINXINTL_LANGUAGE.
The new option is BUILD_LOCALE, and current accumulation yields a leading comma.

Apply this diff:

-if(LOCALE)
-  foreach(lang ${WORKSHOP_LANGUAGES})
-    set(SPHINXINTL_LANGUAGE "${SPHINXINTL_LANGUAGE},${lang}")
-  endforeach()
-  message(STATUS "SPHINXINTL_LANGUAGE=${SPHINXINTL_LANGUAGE}")
+if(BUILD_LOCALE)
+  # Build PO files for all workshop languages
+  set(_ALL_LANGS "${WORKSHOP_LANGUAGES}")
+  string(REPLACE ";" "," SPHINXINTL_LANGUAGE "${_ALL_LANGS}")
+  unset(_ALL_LANGS)
+  message(STATUS "SPHINXINTL_LANGUAGE=${SPHINXINTL_LANGUAGE}")
 endif()
🤖 Prompt for AI Agents
In CMakeLists.txt around lines 219-224, the guard should check BUILD_LOCALE (not
LOCALE) and building SPHINXINTL_LANGUAGE currently prepends a leading comma when
SPHINXINTL_LANGUAGE is empty; update the if to use BUILD_LOCALE and change the
accumulation to set SPHINXINTL_LANGUAGE to the first lang when empty and
otherwise append ",<lang>" so you avoid a leading comma, then keep the
message(STATUS ...) as-is.



message(STATUS "SPHINXINTL_LANGUAGE ${SPHINXINTL_LANGUAGE}")


#------------------------------------------
# Used to generate the languages bar
Expand Down Expand Up @@ -294,13 +255,7 @@ message(STATUS "PGR_WORKSHOP_BUILD_LANGUAGES = ${PGR_WORKSHOP_BUILD_LANGUAGES}")
message(STATUS "SPHINXINTL_LANGUAGE = ${SPHINXINTL_LANGUAGE}")

#---------------------------------------------
#---------------------------------------------
#---------------------------------------------

# The list of projects to be documented

#---------------------------------------------
#---------------------------------------------
# The documentation
#---------------------------------------------

add_subdirectory(docs)
15 changes: 1 addition & 14 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#---------------------
set(PGR_WORKSHOP_FILES
"index.rst"
)
)

add_custom_target(doc COMMENT "Building documentation with Sphinx")

Expand Down Expand Up @@ -44,18 +44,6 @@ set(SPHINX_DOCUMENTATION_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(SPHINX_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")


# Internal variables.
option(LATEX_PAPER_SIZE
"Set a4|letter (default=letter) paper size" "letter")

option(SPHINX_OPTS
"Set Sphinx options (default are sphinx defaults)")

message(STATUS "SPHINX_OPTS=${SPHINX_OPTS}")

set(LATEX_PAPER_SIZE " -D latex_paper_size=${LATEX_PAPER_SIZE}")


# build the locale files
if (LOCALE)
add_custom_target(locale ALL
Expand Down Expand Up @@ -120,4 +108,3 @@ foreach (target ${PGR_WORKSHOP_DOC_TARGETS})
endforeach()
add_dependencies(doc "${target}")
endforeach()

2 changes: 1 addition & 1 deletion locale/es/LC_MESSAGES/advanced/chapter-12.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
# Translators:
# Vicky Vergara <vicky@georepublic.de>, 2022
# Vicky Vergara <vicky@erosion.dev>, 2022
msgid ""
msgstr ""
"Project-Id-Version: Workshop FOSS4G Belém 3.0\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/es/LC_MESSAGES/appendix/appendix-2.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
# Translators:
# Vicky Vergara <vicky@georepublic.de>, 2022
# Vicky Vergara <vicky@erosion.dev>, 2022
msgid ""
msgstr ""
"Project-Id-Version: Workshop FOSS4G Belém 3.0\n"
Expand Down
2 changes: 1 addition & 1 deletion locale/es/LC_MESSAGES/appendix/appendix-3.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
# Translators:
# Vicky Vergara <vicky@georepublic.de>, 2021
# Vicky Vergara <vicky@erosion.dev>, 2021
# MarPetra <mvergaratrejo@gmail.com>, 2021
msgid ""
msgstr ""
Expand Down
6 changes: 3 additions & 3 deletions locale/es/LC_MESSAGES/basic/data.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Translators:
# Manuel Retamozo <manuel.retamozo@gmail.com>, 2021
# MarPetra <mvergaratrejo@gmail.com>, 2021
# Vicky Vergara <vicky@georepublic.de>, 2022
# Vicky Vergara <vicky@erosion.dev>, 2022
msgid ""
msgstr ""
"Project-Id-Version: Workshop FOSS4G Belém 3.0\n"
Expand Down Expand Up @@ -174,10 +174,10 @@ msgid ""
"with pgRouting. Additional information about ``osm2pgrouting`` can be "
"found at the :doc:`../appendix/appendix-3`"
msgstr ""
"El siguiente paso es ejecutar el convertidor ``osm2pgrouting'', que es una "
"El siguiente paso es ejecutar el convertidor ``osm2pgrouting`` que es una "
"herramienta de línea de comandos que inserta los datos en la base de datos, "
"\"listo\" para ser utilizado con pgRouting. Puede encontrar información "
"adicional sobre ``osm2pgrouting :doc:`../appendix/appendix-3`"
"adicional sobre ``osm2pgrouting`` :doc:`../appendix/appendix-3`"
Comment on lines 176 to +180
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Re-add missing preposition in localized sentence.

Line 177 drops the preposition “en”, so the sentence now reads incorrectly (“…información adicional… :doc”). Please restore it for proper Spanish grammar.

-"adicional sobre ``osm2pgrouting`` :doc:`../appendix/appendix-3`"
+"adicional sobre ``osm2pgrouting`` en :doc:`../appendix/appendix-3`"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
msgstr ""
"El siguiente paso es ejecutar el convertidor ``osm2pgrouting'', que es una "
"El siguiente paso es ejecutar el convertidor ``osm2pgrouting`` que es una "
"herramienta de línea de comandos que inserta los datos en la base de datos, "
"\"listo\" para ser utilizado con pgRouting. Puede encontrar información "
"adicional sobre ``osm2pgrouting :doc:`../appendix/appendix-3`"
"adicional sobre ``osm2pgrouting`` :doc:`../appendix/appendix-3`"
msgstr ""
"El siguiente paso es ejecutar el convertidor ``osm2pgrouting`` que es una "
"herramienta de línea de comandos que inserta los datos en la base de datos, "
"\"listo\" para ser utilizado con pgRouting. Puede encontrar información "
"adicional sobre ``osm2pgrouting`` en :doc:`../appendix/appendix-3`"
🤖 Prompt for AI Agents
In locale/es/LC_MESSAGES/basic/data.po around lines 176 to 180, the Spanish
translation is missing the preposition "en" before the :doc reference; update
the msgstr to restore proper grammar by inserting " en " before ":doc" so the
sentence reads "...información adicional sobre ``osm2pgrouting`` en
:doc:`../appendix/appendix-3`".


#: ../../build/docs/basic/data.rst:112
msgid "For this step:"
Expand Down
2 changes: 1 addition & 1 deletion locale/es/LC_MESSAGES/basic/pedestrian.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# Translators:
# MarPetra <mvergaratrejo@gmail.com>, 2021
# Vicky Vergara <vicky@georepublic.de>, 2022
# Vicky Vergara <vicky@erosion.dev>, 2022
msgid ""
msgstr ""
"Project-Id-Version: Workshop FOSS4G Belém 3.0\n"
Expand Down
Loading