Skip to main content
#BuiltWithHERE 6 min read

High school students use HERE APIs to build Uber for city buses

High school students use HERE APIs to build Uber for city buses

In this blog, we showcase the work of three high school students from Calgary, AB, Canada who participated in, and won, Calgary Hacks 2022 - Alberta’s largest 24-hour Hackathon. Allan Kong, Ana DuCristea and Jim Geng developed a proof of concept for a sustainable, in-city transportation solution using HERE location technology.

"Built with HERE" is a series that showcases how developers are using the HERE platform to solve location related business problems. Each post highlights developer solutions and apps that are timely, innovative and transformative.

Ana started programming when she was 10 years old, and is passionate about coding and robotics. 

Jim got his start through programming in scratch, and is passionate about UI/UX designs.

Allan started programming when he was 12 years old, and enjoys building games.

 

Ana, Allan and Jim are 12th graders from John G. Diefenbaker High School and Sir Winston Churchill High School. We spoke to them about why they chose to focus on sustainable transportation, and why they selected HERE Technology.

Inspiration

Allan and Ana live 25 mins away by car, but it takes 90 mins to travel this distance using Calgary public transit. They observed that there are many long routes just to get from one place to another in town. Most times, especially now in COVID, the buses are running empty. Ubers and taxis are expensive, so, they decided to develop a solution to this problem – DynaTransit, “the better way to transit”.

DynaTransit is a service that allows users to enter their trip information ahead of time and generates a custom bus route to accommodate all the requested destinations. It is like Uber, but for city buses. It helps reduce travel time for passengers, and at the same time, helps the city be more efficient with the resources – save gas and money! 

Why HERE?

Given the team chose to develop a solution for sustainable transportation, they knew they’d need a routing API. “We started with Google Maps API, but soon found it to be convoluted. The wealth of information made it challenging to find the exact information we needed to get started with. And it needed payment information.” said Allan.

Ana’s family uses the HERE WeGo app for offline navigation, and as they did not make much progress with the Google Maps API, the team decided to experiment with HERE APIs.

Ana sent Allan a blog and said, “Hey, try HERE.” They were able to make an API key in 2 minutes. Allan was able to follow a blog tutorial - displaying an interactive map with Python and Flask - which was exactly what they were doing. 

“We got a map working in 20 minutes, and the base plan was pretty clear saying no credit card was needed.” - Allan Kong, front-end developer, DynaTransit

Architecture

When the DynaTransit app loads, a map of Calgary is displayed using the HERE JavaScript API. Next to it is a Trip Planner that allows users to enter their trip information.  

The City of Calgary API is used to query the existing bus stops. They used machine learning to find the optimal bus stop based on the density of riders in a certain area. “We settled on using the DBSCAN (density-based spatial clustering of applications with noise) algorithm. Other algorithms needed the number of clusters as input, and with DynaTransit, the clusters/number of stops would be dynamic" said Ana. Thus, DBSCAN was the best fit with its unsupervised learning model.

When users submit a request, it is added to a SQLite database. “For the Hackathon purposes, we process the request immediately to calculate the best route. In the future, we will enhance this to capture all requests, say till midnight, then process them. As we have user emails from their login, we will notify them when the route is ready. Also, send the route to the city and bus drivers.”

“I started with the HERE Routing API. Looking at the documentation for routing, I wondered how I could route this through multiple points. Then I figured out there was an API to find the best order of the way points. That's how I found out about the WayPoints API.” - Ana DuCristea, back-end developer, DynaTransit

On the backend, Python is used to call the REST endpoint with HERE WayPoints API to determine the best order of stops. They had to manually find two farthest stops, then everything in-between is handled by the API. Once the route is calculated by HERE Routing API, it is sent to the JavaScript front-end to display the lines.

Custom bus route generated by DynaTransit

As the UI/UX designer for the project, Jim used Figma to create layouts for front-end, and implemented the CSS with Allan. 

What's next?

The team is headed to compete in a robotics competition next! They plan to enhance DynaTransit after the competition to calculate multiple routes automatically, accommodate the algorithm for different time ranges, and give users estimated arrival times using the HERE Traffic API. Once these features are added, they may pitch the app to the City of Calgary. 

Try out their solution on GitHub! Also checkout their demo from Hackathon.

Mohini Todkari

Mohini Todkari

Sr. Developer Evangelist

Have your say

Sign up for our newsletter

Why sign up:

  • Latest offers and discounts
  • Tailored content delivered weekly
  • Exclusive events
  • One click to unsubscribe