Skip to content

An offline, free app inspired by Moovit for planning bus routes in Israel.

License

Notifications You must be signed in to change notification settings

Dor-sketch/MooveFree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MooveFree ๐ŸšŒ

License: MIT Python GTFS Status

MooveFree is an open-source public transportation route planner for Israel, built with Python and modern web technologies. It provides an intuitive interface for finding optimal bus routes between any two stops in the Israeli public transportation network.

The application uses GTFS (General Transit Feed Specification) data to build a graph representation of the transportation network, allowing for route planning and visualization. The project aims to provide a free and accessible alternative to commercial route planning services, with a focus on user-friendly design and performance.

Stops map demo available at https://dorpascal.com/MooveFree/

Navigation demo available at https://dorpascal.com/MooveFree/map

Note that the application is still under development and some features may not be fully functional.

๐ŸŒŸ Features

  • Interactive map-based interface
  • Real-time route planning
  • Support for the complete Israeli public transportation network
  • Stop search with auto-suggestions
  • Visualization of routes and stops
  • Multiple route alternatives
  • RTL support for Hebrew

๐Ÿ–ฅ๏ธ Screenshots

Map Interface

Map Interface

Route Planning

Route Planning

Stop Visualization

Stop Visualization

Route Visualization

Route Visualization

โš ๏ธ Project Status

Currently in development with some features under construction:

  • Graph building optimization
  • Path finding between routes and destinations
  • Basic map visualization
  • Stop search functionality
  • Route display

Update Log

Click to expand

(2024-12-26) Implemented basic path finding algorithm (WIP)

The GTFS Trip Planner calculates optimal journeys between public transit stops. Here's a summary of how it works:

  1. Data Loading:

    • Loads GTFS datasets (stops, routes, trips, stop_times) and caches them.
    • Builds a graph where nodes are stops and edges are transit or walking connections.
  2. Network Construction:

    • Creates connections between stops using transit schedules.
    • Adds walking connections based on proximity (calculated using the Haversine formula).
  3. Journey Planning:

    • Finds shortest paths between start and destination stops using networkx.
    • For each path, selects the best trips (transit or walking) based on departure and arrival times.
  4. Trip Optimization:

    • Prioritizes trips with minimal travel and wait times.
    • Supports walking trips when transit options are unavailable.
  5. Output:

    • Returns a list of optimized journeys with details on total travel time and walking distance.

The current implemntation is not yet functional and requires further testing and optimization. Future updates will focus on improving path finding performance and accuracy.

Visualization of sample of the cached network:

Network Visualization

Visualization of the network on a map:

Network Map

Output from the current implementation:

Click to expand
Starting GTFS Processing Example...
Loading GTFS data...
No cached network found, building network...

Building transit network...
Creating route catalog lookup...
Creating trip-route lookup...
Processing stop_times...
100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 24222018/24222018 [01:02<00:00, 387942.48it/s]

Adding walking connections...

Analyzing walking connections...
Added 1235484 walking connections

Network statistics:
- Nodes (stops): 34,405
- Edges (connections): 629,479
- Routes: 7,061
- Direct connections: 1,258,943

Caching network for future use...
โœ“ Network cached successfully

Finding frequently served stops...

Busiest stops:
Stop 13103 (ืงื ื™ื•ืŸ ืขื–ืจื™ืืœื™/ื“ืจืš ืžื ื—ื ื‘ื’ื™ืŸ): served by 372 routes
Stop 13322 (ื”ืžืกื’ืจ/ื”ืžืœืื›ื”): served by 309 routes
Stop 13358 (ืกืžื™ื ืจ ื”ืงื™ื‘ื•ืฆื™ื/ื“ืจืš ื ืžื™ืจ): served by 269 routes
Stop 12898 (ืช.ืจืง''ืœ ืื”ืจื•ื ื•ื‘ื™ืฅ'/ื“ืจืš ื–'ื‘ื•ื˜ื™ื ืกืงื™): served by 259 routes
Stop 13120 (ื“ืจืš ื–ืื‘ ื–'ื‘ื•ื˜ื™ื ืกืงื™/ืžื›ื•ืŸ ืžื•ืจ): served by 249 routes
Stop 14045 (ื—ื–ื•ืŸ ืื™''ืฉ/ืจื‘ื ื• ืชื): served by 240 routes
Stop 13345 (ื—ื–ื•ืŸ ืื™''ืฉ/ืจื‘ื™ ืขืงื™ื‘ื): served by 239 routes
Stop 12910 (ื“ืจืš ื ืžื™ืจ/ื™ื”ื•ื“ื” ื”ืžื›ื‘ื™): served by 231 routes
Stop 29432 (ืจื‘ื™ ืขืงื™ื‘ื/ื’ืŸ ื•ืจืฉื”): served by 231 routes
Stop 14043 (ื—ื–ื•ืŸ ืื™''ืฉ/ื”ืื“ืžื•''ืจ ืžื’ื•ืจ): served by 230 routes

Searching for journeys...

Finding paths from 14043 to 13103 starting at 08:00:00
From: ื—ื–ื•ืŸ ืื™''ืฉ/ื”ืื“ืžื•''ืจ ืžื’ื•ืจ to ืงื ื™ื•ืŸ ืขื–ืจื™ืืœื™/ื“ืจืš ืžื ื—ื ื‘ื’ื™ืŸ
Found 31 possible paths

Analyzing path 1/31:
Stops: 14043 (ื—ื–ื•ืŸ ืื™''ืฉ/ื”ืื“ืžื•''ืจ ืžื’ื•ืจ) -> 13338 (ื—ื–ื•ืŸ ืื™''ืฉ/ื”ืจื‘ ื™ืขืงื‘ ืœื ื“ื) -> 15989 (ืฆื•ืžืช ื ื™ืจ ื’ืœื™ื) -> 15988 (ืฆื•ืžืช ื ื•ื•ื” ื”ืจืฆื•ื’) -> 38936 (ืงื ื™ื•ืŸ ืขื–ืจื™ืืœื™/ื›ื‘ื™ืฉ 20) -> 13103 (ืงื ื™ื•ืŸ ืขื–ืจื™ืืœื™/ื“ืจืš ืžื ื—ื ื‘ื’ื™ืŸ)

  Finding connection from ื—ื–ื•ืŸ ืื™''ืฉ/ื”ืื“ืžื•''ืจ ืžื’ื•ืจ to ื—ื–ื•ืŸ ืื™''ืฉ/ื”ืจื‘ ื™ืขืงื‘ ืœื ื“ื after 08:00:00
  Found 54 possible routes: 16072, 35812, 2429, 33267, 35995, 10549, 6616, 10531, 10535, 17011, 35707, 17845, 33268, 10526, 16907, 11597, 19577, 8657, 8656, 35708, 2428, 11625, 16203, 6642, 11623, 16073, 15521, 8663, walking, 6588, 11598, 17007, 37655, 35822, 17226, 6610, 17155, 10525, 10532, 6601, 17154, 16909, 28403, 33269, 13668, 35693, 10536, 28402, 16908, 15035, 35696, 8665, 16204, 15522
  Walking option available: 08:00:00 -> 08:04:00

Searching for trips from 14043 to 13338 after 08:00:00
Looking at routes: {'16072', '35812', '2429', '33267', '35995', '10549', '6616', '10531', '10535', '17011', '35707', '17845', '33268', '10526', '16907', '11597', '19577', '8657', '8656', '35708', '2428', '11625', '16203', '6642', '11623', '16073', '15521', '8663', '6588', '11598', '17007', '37655', '35822', '17226', '6610', '17155', '10525', '10532', '28403', '17154', '16909', '33269', '6601', '13668', '35693', '10536', '28402', '16908', '15035', '35696', '8665', '16204', '15522'}
Found 8594 departures and 5967 arrivals
Found 4292 common trips between these stops
Found 1893 trips on requested routes
Trip 3016104_231224: Departs at 09:09:13, time diff from 08:00:00 is 69 minutes
Found better trip: Route 2428, 09:09:13 -> 09:10:08
...

๐Ÿ› ๏ธ Technology Stack

  • Python 3.8+
  • Pandas & GeoPandas
  • Leaflet.js
  • HTML5/CSS3
  • GTFS (General Transit Feed Specification)

๐Ÿ“ฆ Installation

  1. Clone the repository

    git clone https://github.com/Dor-sketch/MooveFree.git
    cd MooveFree
  2. Create and activate virtual environment (optional but recommended)

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Download GTFS data

    # Create directory for GTFS data
    mkdir israel-public-transportation
    # Download and extract GTFS files into the directory

    You can find GTFS data for download at the Israeli Ministry of Transportation website.

  5. Run the application

    python -m http.server 8000

    Visit http://localhost:8000 in your web browser.

๐Ÿ—บ๏ธ Usage

  1. Enter your starting point in the "ืชื—ื ืช ืžื•ืฆื" field
  2. Enter your destination in the "ืชื—ื ืช ื™ืขื“" field
  3. Click "ื—ืคืฉ ืžืกืœื•ืœ" to find available routes
  4. View the suggested routes on the map and in the results panel

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Israeli Ministry of Transportation for providing GTFS data
  • OpenStreetMap contributors
  • The GTFS community

๐Ÿ“ง Contact

Dor Pascal - @Dor-sketch | LinkedIn | dorpascal.com

Project Link: https://github.com/Dor-sketch/MooveFree