Why I Built CompassBite
A food and beverage specialized compass to find your nearest restaurant, coffee shop, or bar using OpenStreetMap.
Every weekend, my family goes out for breakfast, and every weekend the same problem shows up before we even leave the house. My parents struggle to find a local restaurant that suits everyone, so we open review apps, scroll through noisy listings, see the same sponsored places, and often end up going somewhere we already know. Being the kid in the family, and I got tired of watching that weekly debate, so I decided to build an app called CompassBite.
The idea
The idea is fairly simple. CompassBite finds your current location, looks for nearby food and drink places using OpenStreetMap, and shows restaurants, cafes, and bars on a map. I currently have a basic version running through a sandbox. Currently data caching, filters for opening hours and location type is available. The app is still in development though.
Building it has been harder than I expected. I thought getting the location and showing nearby restaurants would be the easy part, but I had to learn way too much just for this one project, one of which was understanding how to work with Overpass queries. MapLibre brought its own problems too, especially frequent rendering bugs I kept on encountering. You cannot believe the amount of times I threw my phone over the couch in frustration.
General programming forums did not help much because my problems were very specific to OSM, so I found help elsewhere:
- The OpenStreetMap Forum became my primary place to refer to about all things OpenStreetMap.
- A thread on forum.openstreetmap.fr helped me understand server timeouts and alternative Overpass instances.
- GIS Stack Exchange helped with geospatial logic.
- For
MapLibreissues, fortunately OSM's US Slack helped with it.
I *also* got a lot of help from my lovely buddy Codex. Whenever I was stuck on a build error or a bug, it helped me fix the problems, but eventually stumped at the nicher problems that required looking into the forums manually. They taught me how OSM worked, and Codex helped me build the app that talks to it.
CompassBite is still a work in progress - which I hope one day my parents can use it to find breakfast without the weekly struggle! But when I open my local build on a weekend, it can show me a local cafe nearby that we never noticed, and that makes the hard parts so worth it. It was a great learning opportunity that also gave me a deeper understanding of how geospatial data is processed and used to power location-based features.I also look forward to sharing more updates as the app develops, and hopefully open source the software for all Android users! (or publish it to the Play Store).A little bit more on OSM, if you'd like to read more:
A general overview of OSM
OpenStreetMap stores "the planet" (the full global dataset) in a PostgreSQL relational database. It relies heavily on PostGIS, an extension that adds support for geographic objects, allowing SQL queries to calculate distances, map areas, and run spatial coordinates. Initially I thought it (OSM) would just fetch from Google's existing infrastructure, but oh boy was I wrong.
To get data smoothly in and out of the database, the backend uses tools like osm2pgsql to convert standard map data into PostGIS format, and Osmium, a fast C++ "Swiss Army knife" framework for processing raw mapping logs and tracking file updates.
To turn raw coordinates into a visual map, OSM uses a rendering toolkit called Mapnik. It converts geographic data points into images, which tile servers then chop into small square pieces so web browsers and apps can load local areas instantly.
Map searches are powered by Nominatim, which translates text addresses into map coordinates. For developers looking to extract specific information from the map, the Overpass API acts as a fast data filtering engine that pulls custom location datasets without taxing the main database.