Code Monkey home page Code Monkey logo

odh-mentor-otp's Introduction

Mentor

This project contains a Docker images for stable OpenTripPlanner releases and tools to auto download Openstreetmap data related to a certain gtfs file.

CI

Table of contents

journey web app

Getting started

Prerequisites

To build the project, the following prerequisites must be met:

  • Docker
  • Docker-compose

If you want to run the application using Docker, the environment is already set up with all dependencies for you. You only have to install Docker and Docker Compose

Source code

Get a copy of the repository:

git clone https://github.com/noi-techpark/odh-mentor-otp.git

Change directory:

cd odh-mentor-otp

Scripts and sub folders

docker-entrypoint.sh download and build data graph

otp.sh a script to run otp by command line

otp-unofficial.sh a script to run otp unofficial version by command line

router-config.json define OTP updaters(GTFS-RT) and router settings from environment vars

build-config.json default OTP build config from environment vars

osm.url a pregenerated urls list of downloadable Openstreetmap data for SouthTyrol area.

journey/ static javascript client side react/redux UI component to interact with Opentriplanner instance.

gbfs/ service that fetch bikesharing data from ODH and provide them as GBFS for otp.

gtfs2bbox/ nodejs tool to calculate bounding boxes of Openstreetmap intersects GTFS data for downloading, create a list of overpass downloadable urls

geocoder/ nodejs simplified implementation of Pelias Geocoder

Docker Environment

In each service directory the file .env.example list the default env vars by service. Below is a list of env variables for each container:

otp

JAVA_MX the amount of heap space available to OpenTripPlanner. (The otp.sh script adds -Xmx$JAVA_MX to the java command.) Default: 2G

OTP_OFFICIAL if True will use the OpenTripPlanner Official Version, otherwise the IBI-Group Version (see Compatibility)

build

in addition to those of otp vars

BUILD_GRAPH if True force the re/construction of the roads graph starting from the data: osm, gtfs, srtm. Generate a new Graph.obj file in the path /opt/odh-mentor-otp/openmove/Graph.obj

DOWNLOAD_DATA if True download openstreetmap and terrain model data around the gtfs file

BACKUP_GRAPH if True create also a backup copy for each new graph in path /opt/odh-mentor-otp/Graph.obj.%y-%m-%d.tgz

UPDATERS if True create the router-config.json with GBFS/GTFS-RT updaters

GBFS_HOST host path to GBFS service

GBFS_VERSION gbfs version 1 or 2.1 (rebuild graph is required)

GTFS_URL gtfs source ftp uri of gtfs .zip file to download

GTFS_URL_UPDATETIME gtfs source time interval in cronjob style (i.e. */30 * * * * for every 30 minutes)

GTFS_URL_UPDATEHOOK url hook to restart build service

GTFS_FILE the name of gtfs zip file to auto download Openstreetmap data

GTFS_RT_URL gtfs-realtime url with trip updates (rebuild graph is required)

GTFS_FEED_ID gtfs feed id which the gtfs-rt refers to. This is the defined by the 'feed_id' value (unofficial) inside feed_info.txt, if not defined this should be "1" (rebuild graph is required)

OTP_OFFICIAL if True will use the OpenTripPlanner Official Version, otherwise the IBI-Group Version (see Compatibility)

CARSHARING_HOST host path to Carsharing service

PARKING_HOST host path to parking service

CHARGER_HOST host path to charger service

geocoder

API_HOST deployed hostname of OpenTripPlanner api default: localhost (name of deployed)

API_PATH aboslute url path /otp/routers/openmove

API_PORT port default 8080 (port of internal service otp)

HERE_APPID here geocoder api appId params

HERE_APPCODE here geocoder api appCode params

Building Arguments

Below is a list of Docker args variables for each container:

otp, builder

OTP_VERSION version of OpenTripPlanner binary downloaded from official repos, default is 1.4.0

journey

API_HOST deployed hostname of OpenTripPlanner api default: localhost (name of deployed)

API_PATH aboslute url path /otp/routers/openmove

API_PORT port default 8080 (port of internal service otp)

GEOCODER_BASEURL default pelias geoder instance http://localhost/geocoder/v1

PARKING_BASEURL host path to Parking to show in map

CHARGER_BASEURL host path to Charger stationsto show in map

GOOGLE_ANALYTICS_ID google analytics tracking code UA-XXXXX-Y

Then you can start the application using the following command:

First build Graph and Cache

docker-compose up build

Compatibility

In OpenTripPlanner is not allowed running a graph built with a different version. In case you change the OpenTripPlanner version or switch from/to Ufficial/IBI-Group Version you have to rebuild the graph.

Execute OTP instance

docker-compose up otp

After the graph has been built, the planner is available at port 8080.

Services

defined in docker-compose.yml, both of these services are defined by the same docker image which behaves differently according to the defined environment parameters.

build build a new OTP graph by gtfs file in /opt/odh-mentor-otp/ directory, automatically stopped on finish, docker logs notice if the building was successful.

otp run a new instance of OTP by /opt/odh-mentor-otp/, distribute API rest and default UI on port 8080, need restart: "always"

Volumes

/opt/odh-mentor-otp/:/data/ the path used in reading and writing in which the Osm, Altimetric data are downloaded. It must contains the GTFS zip file before building the graph. Here where the graph generated will be written by OTP, in path: /opt/odh-mentor-otp/openmove/Graph.obj

Information

Guidelines

Find here guidelines for developers.

Support

ToDo: For support, please contact [email protected].

Contributing

If you'd like to contribute, please follow the following instructions:

  • Fork the repository.

  • Checkout a topic branch from the development branch.

  • Make sure the tests are passing.

  • Create a pull request against the development branch.

A more detailed description can be found here: https://github.com/noi-techpark/documentation/blob/master/contributors.md.

Documentation

More documentation can be found at https://opendatahub.readthedocs.io/en/latest/index.html.

Boilerplate

The project uses this boilerplate: https://github.com/noi-techpark/java-boilerplate.

odh-mentor-otp's People

Contributors

stefanocudini avatar valerio-fornace avatar ghoster981 avatar rudithoeni avatar zabutnt avatar rajaopenmove avatar bertolla avatar rcavaliere avatar clezag avatar alexlanz avatar dulvui avatar henri-egger avatar cloud78 avatar

Stargazers

Wojciech Kulesza avatar

Watchers

 avatar James Cloos avatar  avatar

odh-mentor-otp's Issues

Frontend: configuration

configure /otp-app/config.yml

  • brand / title
  • subfolder (need it?)
  • otp url / port
  • other settings

Stop Id in frontend

The split : in case of GlobalID used by STA return only the element 1 of the array: "it" and not the real stopId

1:it:22021:2268:0:742 --> it (expected: it:22021:2268:0:742)

https://journey.opendatahub.testingmachine.eu/it/#/stop/1:it:22021:2268:0:742

configure CORS in otp

  • investigate to add cors headers in otp response to able access from other domains

  • espose it trought ENV var

add rental_apps urls

add urls for the app(s) in the stores and website(s) for rent the bikes.

See "rental_uris" and "rental_apps" in:

  • free_bike_status.json
  • station_information.json
  • system_information.json

autofixing srtm bug

FIX DATI ALIMETRICI
issue aperto del building graph a causa dell'elevation file in TIFF.

opentripplanner/OpenTripPlanner#2792

rileggendo mi sono anche ricordato ed è un problema di trasparenze, ad ogni modo con il comando:
gdal_edit.py -unsetnodata elevation_file.tif

check osm data download, graph valid,size,bounding box after building

check these two corrupted files:
osmconvert Warning: unexpected end of input file: 11_947482783637987_47_025259608908875_12_464295067275971_47_38498775439869.osm
osmconvert Warning: unexpected end of input file: 11_947482783637987_46_30580331792924_12_464295067275971_46_66553146341906.osm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.