An interactive metro map and journey planner that helps you explore the Namma Metro network and plan your journey with ease: https://metro.bengawalk.com
Built with SvelteKit, MapLibre and Valhalla. Deployed on Cloudflare Pages.
- Install dependencies with
pnpm install(ornpm install) - Start local dev server with
pnpm run dev(ornpm run dev) - Build site deployment assets with
pnpm run build(ornpm run build)
The codebase follows a SvelteKit project structure:
src/- Main source coderoutes/- SvelteKit route components and API endpointslib/- Shared libraries and componentscomponents/- Reusable Svelte componentsutils/- Utility functions including journey calculation logicconfig/- Configuration files and constantsstores/- Svelte stores for state managementtypes/- TypeScript type definitions
app.html- Main HTML templateapp.css- Global CSS styles
static/- Static assets served as-isstations/- Station floor plan SVGs and related assetsicons/- UI and station details icons*.geojson- GeoJSON data files for the map and journey planning
The application uses several data sources:
-
Metro Network Data
bmrcl.geojson- Contains the Namma Metro network lines and station locationspoints.geojson- Exit gate points, platform points and other internal station pointsvoronoi.geojson- Voronoi polygons for spatial indexing and nearest-station lookup
-
Station Floor Plans
- SVG floor plans for each station stored in
static/stations/ - Each station has multiple floors (Concourse, Platform, etc.)
- SVG floor plans for each station stored in
-
Journey Planning
- Uses Valhalla routing engine for walking directions
- Custom algorithm for calculating metro journeys including transfers
- Journey details include walking time, metro time, platform numbers, and exit information
Components of this repository, including code and documentation, were written with assistance from Claude AI.