Abdul MoizFractional CTO · Senior EngineerBook a free call

Engineering

How We Built Map-Based Property Search in East Africa Without Google Maps

Google Maps pricing and coverage gaps make it a bad fit for proptech in East Africa. Here is the OpenStreetMap-based stack we used instead, and what broke along the way.

Updated · 4 min read

Fractional CTO · Senior Engineer

Key takeaways

  • You can build map-based property search without Google Maps: MapLibre for the map, self-hosted OpenStreetMap tiles, Nominatim for addresses, PostGIS for area search and H3 for counts.
  • It swaps per-request fees for hosting and upkeep.
  • You can fix gaps in the map data yourself, which matters most where coverage is thin.

The pitch for the feature was simple: let users drag a map, draw a rough search area, and see listings inside it. The complication showed up the moment we priced it out. At the traffic volumes a growing proptech product actually sees, Google Maps' per-load pricing stopped being a rounding error and started being a real line item — and in several of the neighborhoods we cared about most, the map data itself was thin: missing roads, unnamed streets, buildings that didn't exist on the map at all. Paying more for coverage that wasn't there wasn't a trade we were willing to make twice.

Google Maps vs an OpenStreetMap stack
Google Maps PlatformOpenStreetMap stack
Cost modelPay per requestHosting and engineering time
Map dataClosedOpen, and you can correct it
SetupFastSlower
UpkeepHandled for youYours: tiles, data updates, geocoder
Best forLow traffic, or places with strong coverageHigh traffic, or places with thin coverage

The Google Maps alternative we built with OpenStreetMap

We rebuilt the mapping layer on open data instead of a metered API:

  • Tiles and rendering: MapLibre GL for the client, serving vector tiles generated from OpenStreetMap extracts instead of a hosted, per-load provider. Self-hosting tiles turned an unpredictable per-request cost into a flat infrastructure cost.
  • Geocoding: Nominatim, self-hosted against a regional OSM extract, for turning addresses into coordinates. Coverage still had gaps, but they were gaps we could see and patch, not a black box.
  • Spatial search: PostGIS on top of Postgres, indexed with GiST, for "find listings inside this polygon" queries — the actual query behind drag-to-search.
  • Area indexing: H3 hexagonal indexing for aggregating listings into search regions, so "how many listings in this area" didn't mean scanning every row on every map pan.
sql
-- listings inside a user-drawn search polygon
SELECT id, title, price
FROM listings
WHERE ST_Within(
  location,
  ST_GeomFromGeoJSON(:search_polygon)
);

Geocoding without reliable addresses

The map rendering and the spatial query were the easy half. The hard half was that a meaningful share of listings didn't have an address that any geocoder — ours or Google's — could resolve cleanly. Many properties are described relative to a landmark ("second gate past the blue church") rather than a street address, because that's how the neighborhood actually navigates, address plates or not.

Forcing agents to type a formal address produced garbage coordinates, because they'd guess. What worked instead was flipping the input around: let the agent drop a pin directly on the map at the property's real location, and treat that pin as the source of truth. Geocoding ran in the background only to generate a human-readable label for display — never to determine where the listing actually showed up in a search. The map became the primary key for location; the address became decoration.

Handling sparse OpenStreetMap road data

Where OSM road coverage was thin, straight-line "as the crow flies" distance was a more honest default than routing through a road network that might not be mapped yet. We showed straight-line distance with a visual indicator that it was approximate, rather than presenting a driving-distance number computed against incomplete road data that would look precise and be wrong. An honest approximation beat a confident, broken calculation.

What this bought us

Dropping a metered map API removed a cost that scaled with usage in a business where usage growth is the entire point. More importantly, treating OSM data as something we could inspect and patch — instead of a paid black box — meant that coverage gaps became a backlog item instead of a permanent limitation. We still contribute fixes back to OSM in areas we operate, because every correction we make is a correction every other OSM-based product in the region also gets for free.

The lesson that generalized past this one project: in markets that mapping providers treat as an afterthought, the "convenient" managed API is often the one with the worst underlying data. Open, self-hosted, and inspectable can be the more reliable choice, not just the cheaper one.

Making the PostGIS area search fast

The query above is only quick with a spatial index. Without one, every map drag checks every listing:

sql
CREATE INDEX listings_location_idx
ON listings
USING GIST (location);

PostGIS uses the index to discard listings outside the polygon's bounding box, then runs the exact ST_Within test on what is left. It is the same principle as a vector index: look at a small part of the data first, then be precise.

What you take on when you leave Google Maps

Open data is not free of work. Plan for these before you switch:

  • Map updates. Tiles come from an extract that ages. Decide how often to rebuild it.
  • Geocoding limits. The public Nominatim server allows at most one request per second and forbids autocomplete. A product needs its own.
  • Attribution. OpenStreetMap data must be credited on the map.
  • Missing extras. Street-level photos, live traffic and business listings do not come with it.

If your traffic is low and the coverage is good where you operate, a paid API is the cheaper choice. The switch makes sense when usage grows, or when the paid map is wrong where your customers are.

Common questions

Is OpenStreetMap free for commercial use?

Yes. The data is open under the ODbL licence, which requires attribution and has share-alike terms. The public servers run by the OpenStreetMap Foundation have strict usage limits, so host your own or use a provider.

Can I use the public Nominatim server in production?

Only for light use. Its policy allows at most one request per second and forbids autocomplete search. For a real product, host Nominatim yourself or pay a provider.

How do you search listings inside a drawn area?

Store each listing as a PostGIS geometry, add a GiST index, and query with ST_Within against the polygon the user drew. PostGIS uses the index to skip listings outside the area.

Sources and further reading

Abdul MoizFractional CTOSenior Engineer

About the author

I build production-grade AI applications, AI agents and data systems, fix AI-built apps, and help teams as a fractional CTO. I've spent seven years building software people rely on, including a media platform that grew to 2M+ users.

ShareXLinkedIn

Keep reading

Working on something like this?

Tell me about it on a free 30-minute call.