@htag/node-red-contrib-hypertegrity-urbanmobility 0.3.2
Hypertegrity NodeRED Urban Mobility Nodes.
Hypertegrity Node-RED Urban Mobility Nodes
A collection of Node-RED nodes for public transport data.
📝 Introduction
This package provides nodes for fetching and processing static and real-time public transport data, specifically from GTFS (General Transit Feed Specification) feeds.
Included Nodes
| Node | Description |
|---|---|
gtfs-data |
Fetches static public transport data from GTFS feeds and converts it into NGSI-LD entities |
gtfs-realtime |
Fetches real-time public transport data from GTFS Realtime Protocol Buffer feeds, filtered by the stops, routes and trips of a gtfs-data node |
Requirements
gtfs-data uses the command line tools unzip, awk, sort, head and tail and therefore runs on Linux/Unix only (not on Windows). In container images make sure unzip is installed. The processed data is cached in the temporary directory; another location can be configured in settings.js:
hypertegrity: { gtfsCacheDir: "/data/gtfs-cache" }
Configuration by message
Every node accepts an optional msg.config object on its input. Its properties use the same names as the node settings in the editor and override them for this message only; the stored configuration stays unchanged. Existing message properties of earlier versions (msg.action, msg.payload = "update", msg.stopIds) keep working. Invalid values raise an error that can be handled with a Catch node. The help text of each node lists the supported properties.
msg.config = { tripsBatchSize: 10000 };
Notes on upgrading to 0.3.2
- gtfs-data: the configured cache duration (“refresh interval”) now takes effect; earlier versions always used 24 hours. Changing the GTFS URL now invalidates the cache.
operatedByof routes points to the ID of the agency entity that is actually emitted (for feeds withoutagency_idthis is…:GtfsAgency:unknowninstead of the dangling…:default). Stops withlocation_type3/4 are typedGenericNode/BoardingArea. Starting a node no longer deletes the caches of other gtfs-data nodes. A failed update with an existing cache now passes the error to the Catch node together with the triggering message (the previous data is still output); every failed update is reported once. The warning before a download names the actual reason (no usable cache, cache expired, changed URL or areas) instead of always "Cache expired". - gtfs-realtime: small feeds (answer in one chunk) were not evaluated because of a race condition; they now deliver their entities. Filters from
msg.partssequences (trips) are collected completely. The new option “Fields missing in the feed as null” is off by default. - gtfs-realtime:
stopTimeUpdate[].scheduleRelationshipnow uses the values of the specification (SKIPPED,NO_DATA,UNSCHEDULED); earlier versions reported them wrongly asADDED,UNSCHEDULEDandCANCELED. With “Fields missing in the feed as null” a missingcurrentStatusisnullinstead ofUNKNOWN. An answer that is not a complete GTFS-RT feed (HTML page, empty or truncated answer) now raises an error instead of an empty or partial result. - msg.config is checked strictly: numbers must be numbers or numeric strings (
true,null,""or arrays raise an error),missingAsNullmust betrue/falseor"true"/"false". - gtfs-data: closing the node (deploy, stop) during an update terminates all processes of the pre-filter (awk, sort, …), not only the shell.
- gtfs-data: trips that also stop outside the configured areas are marked
isPartial: true; as before,totalDuration,startStopNameandendStopNamedescribe the part inside the areas.servedByRoutes[].shortNameof stops is escaped like all other names (e.g.Ue2instead ofÜ2). - gtfs-data: if an update fails and no cache exists, the error for the Catch node names the cause (
No data available. Download failed: Status 404instead of onlyNo data available.). A feed withoutstops.txt,routes.txt,trips.txtorstop_times.txtraises an error naming the file instead of an empty result. Areas in the node configuration that are not an array of GeoJSON (Multi)Polygon features cause a warning at start and an error without download. The downloadedgtfs.zipis deleted after a failed update. - gtfs-data: feeds with CRLF line endings whose
stop_id/trip_idis the last column, and feeds that quote only some trip IDs, are now filtered completely (stop times and trip times were lost before). - gtfs-realtime: an empty array as
msg.payloadno longer triggers a fetch: the empty final part of a gtfs-data trips sequence completes the trip filter, an empty stops/routes output is ignored. A trigger right after a finished fetch is processed (it was rejected with “Already fetching” before). After a proto schema load failure every trigger ends with the error at once and the worker is restarted with back-off.
Installation
Install via the Node-RED Palette Manager or using npm:
npm install @htag/node-red-contrib-hypertegrity-urbanmobility
🌍 About the Project / Über das Projekt
📍 Über dieses Projekt / About this Project
DE: Dieses Open Source Projekt ist im Rahmen der Förderung Modellprojekte Smart Cities entstanden und wurde durch die Initiative des Projekts Südwestcluster ermöglicht.
EN: This open source project was created as part of the Smart City Pilot Projects (Modellprojekte Smart Cities) funding and was made possible by the initiative of the Südwestcluster project.
💡 Hintergrund / Background
DE: Die Entwicklung wurde durch öffentliche Gelder im Kontext der Förderung Modellprojekte Smart Cities unterstützt. Dadurch können wir diese Lösung der gesamten Community als Open Source zur Verfügung stellen.
EN: The development was supported by public funds in the context of the Smart City Pilot Projects (Modellprojekte Smart Cities) funding. This allows us to make this solution available to the entire community as open source.
🌐 Open Source Philosophie / Open Source Philosophy
DE: Wir unterstützen aktiv die OSS-Community und fördern kollaborative Entwicklung. Durch die Veröffentlichung als Open Source profitieren alle Beteiligten:
- Community: Freier Zugang zu moderner Smart City Technologie
- Transparenz: Nachvollziehbare und überprüfbare Lösungen
- Innovation: Gemeinsame Weiterentwicklung durch verschiedene Akteure
- Nachhaltigkeit: Langfristige Verfügbarkeit und Wartbarkeit
EN: We actively support the OSS community and promote collaborative development. Releasing it as open source benefits everyone involved:
- Community: Free access to modern Smart City technology
- Transparency: Traceable and verifiable solutions
- Innovation: Collaborative development by various actors
- Sustainability: Long-term availability and maintainability
🙏 Danksagung / Acknowledgements
DE: Ein besonderer Dank gilt der Förderung Modellprojekte Smart Cities für die finanzielle Unterstützung sowie dem Projekt Südwestcluster für die Initiative und Koordination:
- Eifelkreis Bitburg-Prüm
- Stadt Kaiserslautern
- Landkreis Kusel
- Stadt und Verbandsgemeinde Linz am Rhein
- Landkreis Mayen-Koblenz
- Landkreis St. Wendel
EN: Special thanks goes to the Smart City Pilot Projects (Modellprojekte Smart Cities) funding for financial support and the Südwestcluster project for the initiative and coordination:
- Eifelkreis Bitburg-Prüm
- City of Kaiserslautern
- District of Kusel
- City and Collective Municipality of Linz am Rhein
- District of Mayen-Koblenz
- District of St. Wendel
📜 License & Contact / Lizenz & Kontakt
© 2026 HYPERTEGRITY AG. Alle Rechte vorbehalten. / All rights reserved.
⚖️ License Compatibility / Lizenz-Kompatibilität
DE: Details zur Lizenzierung und zu den Nutzungsrechten finden Sie in der beigefügten LICENSE Datei.
EN: Details on licensing and usage rights can be found in the attached LICENSE file.
📧 Contact / Kontakt: [email protected] 🌐 Website: www.hypertegrity.de