Inspiration

Personally, I'm a very visual learner and enjoy everything and anything that deals with graphics. When I saw that the INRIX API had an endpoint to receive Traffic Tiles, I decided to mess around with it and see what I could do and how I could possibly use that visual data and turn it into an application. 24 hours and 300mg of caffeine later, Traffic Visualizer was built.

What it does

Traffic Visualizer is an innovative way of looking at pixel data by fetching a series of 256x256px images within the given quadkey region from the INRIX API. These images are then stitched together to form a larger and more detailed region, which is then processed using OpenCV to extract a vector of points that define the contours of the map. Using the extracted vector of contours, we can display a scale-invariant replica of the map, alongside the original traffic hotspot colors.

How we built it

I initially started off by building a Node wrapper for the INRIX Dev API to test out the Tiles Endpoint and understand the different parameters that the endpoint took. From there, I set up an environment in Visual Studio to begin working on the GUI, alongside the API calls. Most of our project (if not all of it) is written in C++. The following libraries were used OpenCV (Map Contour Extraction), ImGui (GUI), CryptoPP (Decoding the image), nlhomann JSON Parser (Parsing HTTP Responses). All HTTP calls were made using native WinInet calls.

Challenges we ran into

Many of the challenges in this project were math-related. For example, figuring out the scaling relationship when displaying a two-dimensional map of vectors in the correct direction and size that the user is scrolling in/zoomed-in--I actually didn't even figure it out, I just resorted to WASD and arrow key movement.

Another challenge was being able to model the relationship with quadkey grids and stitching the images together properly. I had never heard of quadkeys before so it just took some time to wrap my head around the concept. It was very rewarding once I'd finally gotten it right, it was like solving a puzzle--just had to get the pieces in the right spot. Finally!

Accomplishments that we're proud of

I'm pretty proud that I was able to accomplish this much work in the 24 hour period that we had...was the sleep deprivation worth it? I guess we'll have to find out. Nonetheless, I'm pretty satisfied with my first hackathon.

What's next for Traffic Visualizer (Desktop App)

Big things.

Built With

Share this project:

Updates