What you are actually trying to do is a kind of Location Allocation analysis. The need for a pharmacy is determined by two things:
- The amount of people living in an area (amount of buildings is proxy)
- The distance (either Euclidean or drive time)
You could use the freeware of Utrecht University; flowmap for this purpose. It is a bit 'clunky' though. Their webiste has excelent tutorials to get you started. The options in QGIS are, by my knowledge, limited. You could try to do something with pgRouting. But I never got that to work properly, so someone else should fill in on those possibilities.
This post can also be helpfull.
The steps that I would take are the following:
- Get my hands on a roads dataset. Fortunately, QGIS has an addon just for this purpose.
- Construct a routable network dataset from the roads.
- For each pharmacy use v.net.iso tool to get a sense of how far people need to travel to the nearest pharmacy. First execute the tool per pharmacy, second interpolate the travel time raster from the network nodes.
- Use the raster calculator to create a raster that contains only the minimum travel time to the nearest pharmacy. The result should tell you what areas have the largest travel time to the nearest pharmacy.