Skip to content

Latest commit

 

History

History
 
 

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

This folder contains an example configuration file, as well as necessary files to run a demo of Transition. This demo corresponds to the territory of the Réseau de transport de Longueuil area.

Running the demo

  1. Make sure all the pre-requisites are installed. For complete installation instructions of all dependencies, see the instructions for Ubuntu.

  2. Update the .env file and set the PROJECT_CONFIG to point to the config file in this directory

PROJECT_CONFIG=</path/to/this/repo>/examples/transition/config.js
  1. Follow the installation instructions at the root of this repo to setup the database and create users

  2. Follow the build and start instructions at the root of this repo to compile and build the code, but do not start the nodejs server yet.

  3. Get and prepare the road network for osrm to route. This step is optional, but required to create new lines that properly follow the road network. The first line will download the Open Street Map network data from the overpass API. The second line will prepare the data for the osrm servers. Data is prepared differently for different modes of transportation. Selecting driving and walking are mandatory modes, as driving is the default mode for vehicles and walking is required to calculate access, transfer and egress times from transit.

yarn node --max-old-space-size=4096 packages/chaire-lib-backend/lib/scripts/osrm/downloadOsmNetworkData.task.js --polygon-file examples/polygon_rtl_area.geojson

yarn node --max-old-space-size=4096 packages/chaire-lib-backend/lib/scripts/osrm/prepareOsmNetworkData.task.js
  1. Start the Node.js server with yarn start:demo.

  2. Navigate to http://localhost:8080 and log into the application.

  3. Import transit data for the Réseau de Transport de Longueuil, that will work for the area of this demo. Lines and paths can be edited and added within this territory.

Running the application for another territory

Copy or edit the config.js file and update for the area. The projectDirectory (where the road network will be stored) and mapDefaultCenter are the main fields to update. Be sure to point the PROJECT_CONFIG environment variable to this new file.

Download and prepare the road network data for another area. Simply save a geojson polygon feature to a file, similar to the polygon_rtl_area.geojson file. To easily create a polygon, geojson.io can be used.