OpenStreetMap logo OpenStreetMap

ChrisPark's Diary

Recent diary entries

Project Abstract

The primary aim of this Google Summer of Code project is to re-introduce transit support in Valhalla, the OpenStreetMap based Routing Engine. Initially, Valhalla supported a mode to route transit, but due to a bottleneck from a third-party library, it became unviable to continue support transit routing. Therefore, the aim of the project is to directly parse raw General Transit Feed Specification (GTFS) data and remove the dependency.

The high level overview of the project is visible here:

GitHub Project

Specific details of each pull request will be described below.

What has been done

The first stage of the project was importing GTFS and ensuring that we can parse the data. GTFS is a set of text files, and rather than iterating through them manually, I decided to use a third party library to automize the read-write process. Just_gtfs allows us to read and store transit data in variables rather than manually trying to parse text. Moreover, I can create sample test data without being concerned about creating invalid data.

After parsing GTFS data, the next step was to pre-process them so that they could fit into Valhalla’s existing data format. Firstly, since the map is divided into tiles – square regions of equal area – I sorted the data according to which tile it belongs to. Tiles are beneficial to save computing power because only the information that belong inside the tile need to be processed when routing through small regions.

Parsing GTFS Pull Request

The sorted data then needed to be built into protobufs, which are used as intermediary data storage before they are converted to tiles. Protobufs are much more condense and versatile than raw GTFS data, so we extract the relevant information from GTFS into protobufs and gather the data. This is further useful because instead of iterating through each stop or trip of a tile, the tile could be read as one whole entity, streamlining the reading process.

Creating Protobufs Pull Request

See full entry

Location: University, University—Rosedale, Toronto, Golden Horseshoe, Ontario, Canada

Google Summer of Code Midterm Update: Reintroducing Transit to Valhalla

Posted by ChrisPark on 26 July 2022 in English. Last updated on 27 July 2022.

GitHub Project

The project indicates the milestones and progress required for project completion, although currently it is still under development as issues may be fine-tuned later with more documentation and tests.

https://github.com/orgs/valhalla/projects/1

Abstract

We are on track for the goal to re-introduce transit to Valhalla, the open-source routing engine. So far, we have the ability to convert raw GTFS data into Valhalla’s transit tiles. The transit tiles must now be connected to rest of Valhalla’s graph for routing, which are the next steps.

Updates

I have pushed updates to Valhalla, such that it no longer relies on the Transitland API to get transit data. Instead, it now reads from locally placed raw GTFS data. To achieve this, the following was done:

1) I needed an ability to read and write GTFS data. GTFS comes in a collection of text files that must be parsed into a structure below:

GTFS Connections

See full entry

Introductions to my GSoC'22 Project

Posted by ChrisPark on 13 June 2022 in English.

Hello World!

Hi everyone, I’m Chris Park, a Computer Engineering student studying at the University of Toronto! I’ll be working on Valhalla, the multi-modal routing software based on OpenStreetMap, on my project for the Google Summer of Code.

I’m an active explorer, and I love searching for new experiences. I enjoy playing the viola, trekking, and traveling in my free time.

I first ran across OSM on a pathfinding GIS project to map cities around the world, leading me to dig deeper into how the mapping tool was built and eventually apply to contribute through GSoC.

Project Goals

The aim of the project is to re-enable transit pathfinding support to Valhalla. The routing app no longer supports transit pathfinding because of updates to a dependent API, although it originally had the functionality. Therefore, the goal is to import raw GTFS (General Transit Feed Specification) and format it so it functions with the existing code, so that transit support can be re-introduced without third-party dependencies.

Since Valhalla previously had transit functionality some of the code can be re-formatted to match the new data form rather than writing fresh code. This will allow for transit data to connect easier to the rest of Valhalla and help complete the project in a timely manner.

To achieve this, there are four broad milestones to meet:

  1. Importing GTFS data and ensuring it is readable in Valhalla

  2. Converting the data into tiles to match the format of roads and features.

  3. Connecting the tiles into the road tiles such that transit tiles are integrated with the rest of Valhalla

  4. Testing the connected network with Valhalla’s gurka tests to ensure functionality

By the GSoC midterm evaluation period at the end of July, I hope to have completed creating the transit tiles so that the latter two months can be used to connecting and debugging the data.

See full entry