AppStars

Threesixty Analytics Platform, 2021–2022

A geo-analytics platform for utilities, from census boundaries to vector tiles.

The Threesixty Analytics Platform (TAP) was a geo-analytics platform for utilities and asset-heavy businesses. We built its foundations: Australian Bureau of Statistics boundaries loaded into PostgreSQL and PostGIS, published as Mapbox vector tilesets, and shown on a React map behind apps for assets, customers, fleet and network operations.

Product
Threesixty Analytics Platform (TAP)
Industry
Energy & utilities
Services
Web & SaaS platforms, geospatial data
Platforms
ASP.NET Core, PostgreSQL and PostGIS, Mapbox, React, Docker
Our role
We designed the architecture and built the server, the data pipeline and the web client.

The challenge

Utilities and asset-heavy businesses think in places. Which premises sit in which area? Where are the assets and the crews? How does the network cross suburbs, council areas and electorates? That data usually lives in separate systems, and a simple "where" question often needs a GIS specialist and a spreadsheet.

The public data to answer many of those questions exists. The Australian Bureau of Statistics (ABS) publishes boundaries at many levels, down to mesh blocks, its smallest areas. But the files are large, their geometry isn't always valid, and drawing them in a browser at every zoom level is slow if you serve raw shapes.

TAP needed a foundation every module could share: one spatial database, one way to publish map layers, and one map the whole business could use.

Our approach

We started with the foundation, not the screens. The server follows a clean, layered architecture: a common layer for entities, repository interfaces, GeoJSON and configuration; an application layer for the domain entities, value objects and services; an infrastructure layer for the SQL repositories, the Mapbox service and the blob importer; then a REST API and a seeder on top. Business rules don't depend on the database or the map vendor, so either can change without a rewrite.

Docker Compose runs the API, the seeder and the database together, so the whole stack starts with one command and is ready to hand over. Later modules (email and SMS alerts, CSV export, scheduled jobs and a graph database for network topology) were scaffolded as clear placeholders, so they had a home before anyone wrote them.

What we built

Nine levels of boundaries in PostGIS

A seeder loads ABS GeoJSON from blob storage into PostgreSQL with PostGIS: states, Greater Capital City Statistical Areas, the SA4 to SA1 levels, local government areas, state electoral divisions and mesh blocks for each state. Every level gets SP-GiST spatial indexes, and check-and-repair scripts make sure each geometry is valid and queryable before anything relies on it.

Point-in-polygon lookups

Given a premise's coordinates, one indexed ST_Within query finds the mesh block it sits in, and from there every level above it. Matching customers or assets to areas, a job that often waits on a GIS desk, becomes a single fast database call.

The speed comes from how spatial indexes work. The index holds a simple box around each shape, so the database first discards every boundary whose box doesn't contain the point, which is almost all of them, and only then runs the exact, expensive polygon test on the few that are left. Valid geometry matters here: a self-intersecting polygon can make that exact test give the wrong answer, which is why the repair scripts run before the data is trusted.

An automated vector-tile pipeline

The API publishes map layers to the Mapbox Tiling Service itself: it uploads the tileset source, writes the recipe and publishes the tileset. Zoom ranges are chosen with cost in mind, because tile processing is billed by zoom level and area. Vector tiles are cut and simplified for each zoom, so the browser draws national boundaries quickly instead of downloading raw geometry.

One map for the whole business

The React web client uses Mapbox GL JS to show the vector layers over 3D terrain, with a Turf.js distance-measuring tool and a resizable side panel. Its home screen brings together apps for Assets, Customers, Fleet, NetOps, Data Insights and GeoAnalytics, all sharing the same map and data.

Small choices that keep it fast

Keys are sequential COMB GUIDs, which stay unique across systems but insert in order, so database indexes don't fragment as the data grows. Configuration is loaded from environment files, so the same containers run on a laptop and in the cloud.

Architecture

  1. ABS GeoJSONBoundary files in blob storage
  2. SeederValidates and loads nine levels into PostGIS
  3. PostGISSpatial indexes and point-in-polygon queries
  4. Mapbox Tiling ServiceVector tilesets published by the API
  5. React mapMapbox GL JS and Turf.js tools, shared by every app

Each layer of the server can change without touching the others.

Results

Under the hood

Foundations first: data, layers and one shared map.

What we’d do now

Geospatial tooling has moved on since 2021, and so have our opinions.

  • Consider owning the tiles. Single-file tile archives such as PMTiles can now be served straight from cloud storage. For boundary layers that change once every few years, that can replace a per-use tiling service and remove a vendor from the path.
  • Earn the graph database. Network topology is a graph, but many topology questions, such as "what is downstream of this switch?", are answered well by recursive queries in PostgreSQL. We'd add a separate graph store only when the queries prove they need it.
  • Aggregate on a grid as well as boundaries. Administrative boundaries change and vary wildly in size. A hexagonal grid such as H3 gives even, comparable cells for heat maps and trends, with boundaries kept for reporting.
  • Test spatial queries with known places. A small fixture set of points with known answers (this premise is in this mesh block, this council and this electorate) catches broken geometry and projection mistakes before users do.
  • Put identity and access in from day one. Location data about customers and assets is sensitive. Role-based access belongs in the foundation, not in a later module.

Why it matters now

Location sits underneath a lot of our energy and utilities work, from network visibility to demand forecasting by customer segment. TAP is the plainest example of the foundation that work needs: clean spatial data, indexed for the questions people actually ask, published as map layers anyone in the business can open.

It's also a lesson in building platforms. Get the layers, the data pipeline and the deployment right first, and leave honest seams for the modules that come later. That's how we approach web and SaaS platforms and data platforms today.

Questions

What is a mesh block?

The smallest area the Australian Bureau of Statistics publishes. Matching each premise to its mesh block lets you roll data up to suburbs, council areas and electorates.

Why publish vector tiles instead of raw shapes?

Vector tiles are cut and simplified for each zoom level, so a browser draws large boundary sets quickly instead of downloading raw geometry.

Why a layered architecture for a map platform?

It keeps business rules apart from the database and the map vendor, so modules can be added and providers changed without a rewrite.

Can you build a geospatial platform for our assets?

Yes. Spatial databases, map layers and data pipelines are part of our web, SaaS and data platform work.

Related

The services behind this work, and more stories like it.

Services

Case studies

Bring us the hard problem.

A 45-minute discovery call with the engineer who'll build it.