# Drawing delivery zones with KML

By [Anubhav Choubey](https://anubhavchoubey.com/) · Backend & Systems · 2026-11-03 · 2 min read

> A KML-based tool for marking the map grids a service covers, with geolocation checks and webhooks on every location update, built with the logistics team.

```stats
KML zones · geolocation checks · webhooks on updates · built with logistics
```

## The problem

Deliveries only work where the service can actually reach. Knowing where that is, and keeping it accurate as the service area changes, is harder than it sounds. The logistics team needed to mark exactly which areas were being served, change them when things changed, and have every system that cared find out straight away.

## Zones as KML

The tool was built around **KML**, the standard format for shapes on a map. The team marked the **grids** where the service was available, and each one was saved as KML.

Using a standard format meant the zones weren't locked inside one app. The same file opens in any common map tool, so zones could be checked visually and shared without converting anything.

```callout tip
Store map data in a standard format like KML. Your own tool can draw it, but so can every other map tool, which makes checking and debugging much easier.
```

## Geolocation does the checking

With the zones in place, the question "is this location served?" became a **geolocation** check: take a location and see whether it falls inside one of the marked grids.

```text
logistics team ──▶ map tool ──▶ KML grids
                                    │
location ──▶ geolocation check ◀────┘ ──▶ served / not served
                    │
                    └──▶ webhooks on location updates
```

## A clean interface

The people using this were the logistics team, not engineers. So the interface was kept simple: see the map, mark or change a grid, save. Nobody had to edit a file or know what KML was.

## Webhooks on every update

Zones and locations change, and the systems that depend on them can't wait for someone to tell them. The tool sent **webhooks** whenever a location was updated, so other systems heard about the change straight away instead of checking for it. That's what kept delivery zones accurate in real time.

## Takeaway

Put the map in the hands of the people who know the ground, store it in a format every tool understands, and push changes out as they happen. A geofence is only accurate if updating it is easy and everyone hears about the update.
