{"id":16150832,"url":"https://github.com/denysvitali/optitravel","last_synced_at":"2025-03-18T19:30:33.815Z","repository":{"id":39643708,"uuid":"123592378","full_name":"denysvitali/optitravel","owner":"denysvitali","description":"Optimized Travels","archived":false,"fork":false,"pushed_at":"2018-06-12T20:37:29.000Z","size":6380,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T00:52:11.408Z","etag":null,"topics":["bus","car","gtfs","java","maps","optimized","planner","route","route-planner","route-planning","train","transport","travel","walking"],"latest_commit_sha":null,"homepage":"https://git.ded1.denv.it/shrug/optitravel","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denysvitali.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-02T14:57:20.000Z","updated_at":"2024-08-06T11:42:33.000Z","dependencies_parsed_at":"2022-09-16T13:51:04.275Z","dependency_job_id":null,"html_url":"https://github.com/denysvitali/optitravel","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denysvitali%2Foptitravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denysvitali%2Foptitravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denysvitali%2Foptitravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denysvitali%2Foptitravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denysvitali","download_url":"https://codeload.github.com/denysvitali/optitravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221716032,"owners_count":16868652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bus","car","gtfs","java","maps","optimized","planner","route","route-planner","route-planning","train","transport","travel","walking"],"created_at":"2024-10-10T00:52:44.400Z","updated_at":"2024-10-27T18:16:29.653Z","avatar_url":"https://github.com/denysvitali.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Opti Travel\n\n\u003ch1 align=center\u003e\n\u003cimg src=\"logo/horizontal.png\" width=50%\u003e\n\u003c/h1\u003e\n\nA journey planner which takes into consideration public transport systems,\nbike sharing services and car sharing / car pooling services to find\nthe best route between a starting and ending point.\n\n![Application Screenshot](screenshots/1.png)\n\n## Introduction\nThis project was developed as a requirement for the course [Software Engineering and Development (C02047)](http://www.supsi.ch/dti/bachelor/ingegneria-informatica/piano-studio-offerta-formativa/offerta-formativa/dettaglio-offerta-formativa/dettaglio-modulo/dettaglio-corso.7052.backLink.5b9811e5-e5e0-4e02-8170-229cb6a7fdcd\u0026m=134464\u0026ps=-1\u0026of=532.html) at [University Of Applied Sciences of Souther Switzerland (SUPSI)](http://supsi.ch/).\n\n### Teacher\n- Giambattista Ravano\n\n### Lab Supervisors\n- Giancarlo Corti\n- Alessandro Trivilini\n\n## Project Requirements\nThese are the requirements set by our teacher, therefore most of our choices were made to meet the following requirements\n\n- Insert and connect data of carpooling services such as BlaBlaCar, Carticipate, Cariva\n- View car sharing options in a certain area / timespan\n- Insert or connect data from public transportation services for a certain area\n- Insert data for a transport from one point to another, in a certain area\n- Compute the travel proposals, including public transportation systems and carpooling.\n- ... other requirements to be decided during the lab activities.\n\n### Tools\n- StarUML\n- IntelliJ\n- Java and Java FX\n\n---\n\nSince Java FX is a requirement, we were denied the request of making a web-based application - therefore many of our choices (like the client side routing) were made because of the requirements colliding w/ eachother.\n\n## System Requirements\n- Java 8+\n- JavaFX\n- Gradle\n\n## Preparation\n\nSince the project needs to get some public transportation data and route them locally (because it's part of the requirements) and TransitLand doesn't have updated feeds for the Switzerland area (see [transitland/transitland#296](https://github.com/transitland/transitland/issues/296) for more info about the issue), we had to create and host our own [GTFS Server](https://github.com/denysvitali/gtfs-server) (written in Rust) on [gtfs.ded1.denv.it](https://gtfs.ded1.denv.it/api).\n\nThe API wrapper for this service is available [here](https://github.com/denysvitali/optitravel/blob/dev/src/main/ch/supsi/dti/i2b/shrug/optitravel/api/GTFS_rs/GTFSrsWrapper.java).\n\n### Using a remote GTFS server\nIn order to use a remote GTFS server (default option) the parameter `USE_GTFS_REMOTE` has to be set to `true` in `src/main/ch/supsi/dti/i2b/shrug/optitravel/config/BuildConfig.java`.  \nThe endpoint is hardcoded [in the wrapper](https://github.com/denysvitali/optitravel/blob/dev/src/main/ch/supsi/dti/i2b/shrug/optitravel/api/GTFS_rs/GTFSrsWrapper.java#L27) and is set by default to `127.0.0.1:8000` for local, and `gtfs.ded1.denv.it:443` for remote, with HTTPS enabled for remote and disabled for local.\n\n### Using a local GTFS server\n#### Requirements\n- Docker\n- Rust (Nightly)\n\n##### Preparation\n###### Clone the repository\n```\ngit clone https://github.com/denysvitali/gtfs-server\ncd gtfs-server\n```\n\n###### Build for release\nRunning it in development mode (without the `--release` flag) won't add some useful optimizations, the import process for the feeds will be much slower!\n\n```\ncargo build --release\n```\n\n###### Run the PostGIS Database\n```\ndocker run --name gtfs-server-db --net gtfs-server-net --ip 172.18.0.2 -e POSTGRES_PASSWORD=mysecretpassword -d mdillon/postgis\n```\n\n###### Run the server\n```\n./target/release/gtfs-server\n```\n\nIf the server starts succesfully, you'll see something similar to the following:\n![GTFS Server Screenshot](screenshots/2.png)\n\n\n###### Import the required feeds\nOnce the server is started, you can visit http://127.0.0.1:8000/api, if everything works you'll be greeted with a similar page:\n![GTFS Server Screenshot](screenshots/3.png)\n\nYou can now head to http://127.0.0.1:8000/import and import the following feeds:\n- Switzerland (SBB) feed: https://opentransportdata.swiss/en/dataset/timetable-2018-gtfs/permalink\n- London, UK (TfL) feed: https://denv.it/tfl.zip\n\nIf you want more feeds, you can get them from http://transitfeeds.com/.\n\nThe import process may take a while, and the PostGIS database may grew to more than 4GB, depending on how many feeds you add, and what's the dataset size.  \nIn our tests, importing the SBB and TfL feeds resulted in the following:\n![DB size](screenshots/4.png)  \nbasically, a DB of around 4 GB, with 25M of `stop`s, 2M of `calendar_date`s and 1M of `trip`s. You may now understand why the import process may take this long.  \n  \nThis is why querying for routes in a certain Boudingbox, in a certain timeframe is an intense operation:\n![DB View](screenshots/5.png)\n![DB View 1](screenshots/6.png)\n\nwe're querying and intersecting 11M + 1M + 5k rows. That's a lot of data. \n\n---\n\nWhen the server is up and running, the API is served through the endpoints mentioned in the [server documentation](https://denysvitali.github.io/gtfs-server/), specifically in the [`routes/api` section](https://denysvitali.github.io/gtfs-server/gtfs_server/routes/api/index.html) of the docs.\n\n![Server response for a query](screenshots/7.png)\n\n\n## Running\nThe project can be started w/\n```\ngradle run\n```\n\nIf you want to avoid querying the remote services and just have a mocked view, you can\nchange that in `src/main/ch/supsi/dti/i2b/shrug/optitravel/ui/MainController.java` by\nsetting `mockedPlanner` to `true` and choosing an appropriate pre-calculated trip by setting the\n\n```\nFile f = new File(getClass().getClassLoader()\n         .getResource(\"classdata/path-9.classdata\").getFile());\n```\nto the appropriate `classdata` file.\n\n## Jenkins builds\nSome prebuilt binaries are available on [Jenkins](https://jenkins.ded1.denv.it/job/optitravel/). For example, the development builds are available [here](https://jenkins.ded1.denv.it/job/optitravel/job/dev/).\nDownload the `optitravel-*-all.jar` and run it with:  \n```\njava -jar optitravel-*-all.jar\n```\n\n\n## Presentations\nThese are the project presentations - part of the course grade.\n\n- [Sprint 1](https://docs.google.com/presentation/d/1M1SdM85sgi_bDBK5ziLAEtti44WOVQeW3vpU2qhl_YQ/edit?usp=sharing)\n- [Sprint 2](https://docs.google.com/presentation/d/1mot7wuE7-pekUUojp9WQT9Ei2rYCXRxvaFwItSWf8CQ/edit?usp=sharing)\n- [Sprint 3](https://docs.google.com/presentation/d/1koeCpqC4YOyagwjAEElK49IW7oFdwXxEcggUxyvvaws/edit?usp=sharing)\n\n## Contributors\n- Denys Vitali (GTFS Integration, Routing, Planner)\n- Alessandro Ferrari (UI)\n- Filippo Pura (TransitLand + Routing)\n- Zul Arizal (Logo Design)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenysvitali%2Foptitravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenysvitali%2Foptitravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenysvitali%2Foptitravel/lists"}