summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-12-22 11:36:23 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2025-12-22 11:36:23 +0100
commit03998adf013b95ba3b4959cf643fa470537ef097 (patch)
tree331c4275f92842fd43d35076151dd149c3b6d82c
parent2cfebde7ac892a6c984fe9318204f5f421af6407 (diff)
Add Git submodule for Renfe feeds and update configuration files
- Introduced a Git submodule for automatic downloading and patching of Renfe feeds. - Updated README.md to include instructions for initializing submodules. - Modified Taskfile.yml to streamline Renfe data downloading process. - Adjusted build-config.json to reference new Santiago feed. - Created otp-config.json to configure OTP features.
-rw-r--r--.gitmodules3
-rw-r--r--README.md15
-rw-r--r--Taskfile.yml43
-rw-r--r--build-config.json4
m---------build_renfe0
-rw-r--r--otp-config.json8
6 files changed, 47 insertions, 26 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..df931f8
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "build_renfe"]
+ path = build_renfe
+ url = https://github.com/tpgalicia/gtfs-renfe-galicia.git \ No newline at end of file
diff --git a/README.md b/README.md
index 6f0ed61..889bb7d 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,7 @@ Este repositorio incluye:
- GTFS: Urbano de A Coruña
- GTFS: Urbano de Ourense
- GTFS: Urbano de Vigo
+- Submódulo Git para descargar y parchear los feeds de Renfe automáticamente
- Proxy del GTFS RealTime de Renfe para integración con OTP
- Configuración de OpenTripPlanner para cargar los datos descargados y el tiempo real de Renfe
- Tareas para ejecutar OTP directamente
@@ -30,6 +31,7 @@ Para descargar los datos y ejecutar OTP, se pueden utilizar las siguientes tarea
```bash
git clone https://github.com/tpgalicia/opentripplanner-galicia.git
cd opentripplanner-galicia
+git submodule update --init --recursive
```
Descargar OpenTripPlanner, datos de OpenStreetMap y feeds:
@@ -63,6 +65,19 @@ Para solucionar esto, se incluye un proxy simple implementado en Python utilizan
El proxy aún es muy básico, no maneja todos los trip updates y no gestiona otro tipo de entidades de actualización de estado (por ejemplo, `VehiclePosition` o `Alert`). Sin embargo, es suficiente para que OTP pueda utilizar los datos de tiempo real de Renfe en las rutas planificadas.
+## Submódulos Git
+
+Este repositorio utiliza submódulos de Git para incluir el script de descarga y parcheo de los feeds de Renfe. Al clonar el repositorio, es importante inicializar y actualizar los submódulos para asegurarse de que se descarguen correctamente.
+
+### Desarrollo: actualizar submódulos
+
+Para actualizar los submódulos a la última versión disponible en sus respectivos repositorios, se puede utilizar el siguiente comando:
+
+```bash
+git submodule foreach git pull origin main
+git commit -am "Update submodules"
+```
+
## Licencia
Este proyecto está cedido como software libre bajo licencia EUPL v1.2 o superior. Más información en el archivo [`LICENCE`](./LICENCE) o en [Interoperable Europe](https://interoperable-europe.ec.europa.eu/collection/eupl).
diff --git a/Taskfile.yml b/Taskfile.yml
index 9f0c501..962d466 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -1,3 +1,5 @@
+$schema: https://taskfile.dev/schema.json
+
version: '3'
vars:
@@ -22,27 +24,10 @@ tasks:
download-renfe:
desc: "Download Renfe GTFS data (NAP MITRAMS)"
- silent: true
- cmds:
- - "curl -H \"ApiKey: {{.NAP_API_KEY}}\" -sLo feeds/renfe.zip https://nap.transportes.gob.es/api/Fichero/download/1098"
-
- download-feve:
- desc: "Download Renfe FEVE GTFS data (NAP MITRAMS)"
- silent: true
- cmds:
- - "curl -H \"ApiKey: {{.NAP_API_KEY}}\" -sLo feeds/feve.zip https://nap.transportes.gob.es/api/Fichero/download/1131"
-
- download-cercanias:
- desc: "Download Renfe Cercanías GTFS data (NAP MITRAMS)"
- silent: true
cmds:
- - "curl -H \"ApiKey: {{.NAP_API_KEY}}\" -sLo feeds/cercanias.zip https://nap.transportes.gob.es/api/Fichero/download/1130"
-
- download-ourense:
- desc: "Download Ourense city GTFS data (NAP MITRAMS)"
- silent: true
- cmds:
- - "curl -H \"ApiKey: {{.NAP_API_KEY}}\" -sLo feeds/ourense.zip https://nap.transportes.gob.es/api/Fichero/download/1586"
+ - uv --directory build_renfe run ./build_static_feed.py {{.NAP_API_KEY}}
+ - cp build_renfe/gtfs_renfe_galicia_general*.zip feeds/renfe.zip
+ - cp build_renfe/gtfs_renfe_galicia_feve*.zip feeds/feve.zip
download-coruna:
desc: "Download A Coruña city GTFS data (NAP MITRAMS)"
@@ -61,16 +46,26 @@ tasks:
deps:
- download-xunta
- download-renfe
- - download-feve
- - download-cercanias
- - download-ourense
- download-coruna
- download-vitrasa
+ build-osm:
+ desc: "Build OSM data for OpenTripPlanner"
+ sources:
+ - galicia-latest.osm.pbf
+ cmds:
+ - java -Xmx4G -jar {{.OTP_JAR}} --buildStreet .
+
+ build-transit:
+ desc: "Build transit data for OpenTripPlanner"
+ cmds:
+ - java -Xmx4G -jar {{.OTP_JAR}} --loadStreet --save .
+
build:
desc: "Build OpenTripPlanner and save the graph for future runs"
cmds:
- - java -Xmx4G -jar {{.OTP_JAR}} --build . --save
+ - task: build-osm
+ - task: build-transit
run:
desc: "Run the OpenTripPlanner server using the saved graph from the build task"
diff --git a/build-config.json b/build-config.json
index 01d7856..d215e4a 100644
--- a/build-config.json
+++ b/build-config.json
@@ -21,9 +21,9 @@
"source": "./feeds/cercanias.zip"
},
{
- "feedId": "ourense",
+ "feedId": "santiago",
"type": "gtfs",
- "source": "./feeds/ourense.zip"
+ "source": "./feeds/ibi_santiago.zip"
},
{
"feedId": "coruna",
diff --git a/build_renfe b/build_renfe
new file mode 160000
+Subproject df68ee9059f21fe25e19b8ed65f7da387a92461
diff --git a/otp-config.json b/otp-config.json
new file mode 100644
index 0000000..d44170f
--- /dev/null
+++ b/otp-config.json
@@ -0,0 +1,8 @@
+{
+ "otpFeatures": {
+ "SandboxAPIGeocoder": true,
+ "APIUpdaterStatus": false,
+ "APIServerInfo": false,
+ "ParallelRouting": true
+ }
+} \ No newline at end of file