How public health teams map residents per pharmacy, district by district
A district's ratio of residents to pharmacies shows where getting medicines takes longest. How to work it out, where population data exists, and how to keep it current.
Part of the guide Workflow automation
To map residents per pharmacy, a public health team counts the people living within the same distance of each district's centre, counts the pharmacies within that same distance, and divides one by the other. Districts with many residents for each pharmacy are where people walk or drive furthest for a prescription, and where a late-night rota, a mobile service or a licence for a new pharmacy would help most. The figure is only as good as its population data, which xMap has for some countries and not others, so the first step is to check that your country is covered.
This is written for health department analysts, pharmacy regulators, community health planners and the researchers who advise them. It covers the ratio itself, why equal circles beat district boundaries for a first look, a reading of two cities with real counts of pharmacies, and an AI employee that refreshes the map each quarter.
Why a ratio and not a count
A count of pharmacies on its own favours the centre of a city, where shops cluster and few people sleep. A busy commercial district can hold a dozen pharmacies and very few residents; a residential suburb of the same size can hold two pharmacies for many times the people. Dividing residents by pharmacies turns both into the same question: how many people share each counter.
The ratio has a second use. Repeated each quarter, it shows when a district's only pharmacy closes or a new one opens, which a yearly survey misses for months.
Where the population numbers come from, and where they do not
The Demographics block reads xMap's population grid: residents per hexagon of about 0.1 square kilometres, with men, women and nine age groups. It covers about a hundred countries. Canada, France, India, Thailand, Egypt and Australia are among them. The United Kingdom and the United States are not, so a team in London or Chicago cannot work out this ratio inside xMap Flows today and would need to bring its own census table into My data.
Reading two cities
xMap's places database lists 519 pharmacies within 10 km of the centre of Toronto and 346 within 10 km of the centre of Sydney (November 2026). Canada and Australia both have population figures in the grid, so a team in either city can run the full method. In Toronto, of the 438 pharmacies nearest the centre, 119 belong to a chain; in Sydney, 132 of the 346 do.
A city-wide count tells you little about any one neighbourhood. Its value is as a check: if your district totals add up to far fewer pharmacies than the city circle holds, a district boundary or a category choice is leaving some out.
The method, step by step
Districts have odd shapes, and a pharmacy just over a boundary still serves the people on the other side. For a first look, equal circles around each district's centre are fairer and simpler to explain. A 1 km circle is about a 12-minute walk; use 2 km for suburbs where most people drive.
- Make a table in My data with one row per district: its name and the latitude and longitude of its centre. A CSV upload is enough.
- Bring the table into a flow with the My data block.
- Add Demographics on Each incoming place, Within 1 km, giving Totals for each area. Each district gains its population and the share of children and of people aged 60 and over.
- Add Nearby places with the type Pharmacy, on Each incoming place, Within 1 km, passing on each incoming place with counts. Each district gains how many pharmacies are inside its circle and how far the nearest one is.
- Add a Calculated field that divides population by the pharmacy count, and another that flags districts with no pharmacy in the circle at all.
- Add Sort and limit so the districts with the most residents per pharmacy come first.
- Send the table with Email and draw it with Show on a map.
Run it once, look at the top ten districts on the map, and then schedule it every three months. Older residents use pharmacies more, so a second sort by the share aged 60 and over is often more telling than the raw ratio.
Things that skew the picture
- Hospital and clinic pharmacies. Some serve only patients. If your district lists many, check them by name before counting them as open to the public.
- Closed places. Nearby places leaves out places marked closed unless you switch that off. A pharmacy that closed last month may still appear until the database's next refresh.
- Opening hours. A ratio counts counters, not the hours they are open. Two pharmacies that both close at six serve the evening as poorly as none.
- Commuters. Residents are where people sleep. Districts full of offices have few residents and many daytime visitors; for those, the Mobility Footfall block shows how busy an area is, measured in people-hours of presence.
What the team receives
Each quarter the AI employee emails a table of districts with residents, pharmacies within the circle, residents per pharmacy, the share of older residents and the distance to the nearest pharmacy, plus a map coloured by the ratio. Districts with no pharmacy in reach stand at the top. When a district's count changes since the last quarter, an xMap LLM block can add a one-line note saying so, which saves an analyst from comparing two spreadsheets by eye.
Questions
Can I use my own district boundaries instead of circles?
Yes. Draw the districts as shapes in an Area of interest and Demographics counts only the hexagons inside each one. Counting pharmacies by shape needs the places found to be grouped by area, which is a little more work than circles.
Why does a district show zero residents?
Either it is outside the countries the population grid covers, or the circle falls on water or empty land. The step says when no population data was found.
Is the pharmacy count the same as licensed pharmacies?
No. It is what xMap's places database lists as pharmacies. Compare it with your licence register once and note the difference before you rely on it.
How often should it run?
Every three months is enough for planning. A monthly run is useful if your team is watching for closures in districts that already have only one pharmacy.