Two territories that look equal on the map rarely are in the field.
Sales patches get redrawn every time the book grows, and the shape that is fastest to draw — an administrative boundary or a hand-drawn radius — is the one least related to what a rep can actually cover.
Four reps, one city, two very different maps.
The grey outlines are Bangkok's districts — the shape most territory maps get drawn on. The coloured areas are what each rep can actually reach by road in the time budget. Move the budget and watch how little the two have to do with each other.
What breaks
Territories get redrawn as the book grows, and every method that is fast to redraw — an administrative line, a radius, a polygon eyeballed on a screen — describes area, not coverage. The three failures below are what that gap costs once the rebalancing starts.
An amphoe or khet boundary is the shape everyone already has, but it says nothing about drive time: a tambon across a canal, an expressway with no nearby exit, or a one-way soi system can put two addresses in the same district an hour apart, while an address in the neighbouring district is ten minutes away.
Two patches of similar area on a map can differ several times over in how much a rep can actually reach in a working day, because road density and congestion are not uniform across Bangkok. A radius or a hand-drawn polygon encodes neither.
Levels are joined on the PCODE rather than the label a person types: the official romanisation of วัฒนา is “Vadhana”, so a territory system that joins districts by English name silently drops one district and still looks like it worked.
What it costs
Sales ops already knows the headcount and the weekly call target. The variable worth measuring is how much of each rep's day the territory itself burns on the road.
reps on the roster × accounts each rep is expected to cover in a working week × share of the working day spent driving rather than selling
Put your own numbers in the calculatorThe endpoints you would use
GET/v1/geocodeTurn the account book — a spreadsheet of customer addresses — into coordinates before anything can be assigned at all.
GET/v1/admin-areas/reverseConfirm which province, district and subdistrict each account actually sits in, so the territory report ties back to the boundaries the business already reports on.
POST/v1/matrixEvery rep against every account in one call, so assignment is by drive time rather than by which patch the address happened to fall in.
GET/v1/isochroneThe territory as the area a rep can genuinely cover in a working span, as a polygon you can test an address against.
A request you can run
Geocode one account address, then matrix every rep against a batch of accounts. Both against the live API.
# 1. The account book is a spreadsheet of addresses. Nothing can be
# assigned until each one is a coordinate — with the province in the
# query, because amphoe names repeat across provinces.
curl -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
"https://api.mapscale.io/v1/geocode?q=%E0%B8%96.%E0%B8%9E%E0%B8%A3%E0%B8%B0%E0%B8%A3%E0%B8%B2%E0%B8%A1%204%20%E0%B8%9A%E0%B8%B2%E0%B8%87%E0%B8%81%E0%B8%B0%E0%B8%9B%E0%B8%B4%20%E0%B8%81%E0%B8%A3%E0%B8%B8%E0%B8%87%E0%B9%80%E0%B8%97%E0%B8%9E&lang=th&limit=1"
# 2. Every rep against every account in one call. Assign on the durations
# this returns, not on which patch the address happened to fall in.
curl -X POST -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sources":[[100.5537,13.8020],[100.5602,13.7373],[100.5100,13.7263]],"targets":[[100.5790,13.7240],[100.6045,13.6680],[100.4570,13.7205]],"profile":"driving"}' \
"https://api.mapscale.io/v1/matrix"What we can actually claim
Territory polygons come from the same Valhalla 3.5.1 engine and Thailand-wide OpenStreetMap road data as the rest of this site, not a hand-drawn shape. Administrative boundaries are RTSD / UNOCHA COD-AB, published on HDX under CC BY-IGO, vendored as static files and simplified for display — read the coverage notes for where that road layer is thin rather than take a blanket claim.
Bring us your data.
A 30-minute review against your own addresses — not a demo dataset. You will see the failure rate before you see a price.