I'm very new in QGIS.

The task is to calculate the urban areas that has lack of pharmacies. I have buildings points with apartments count and existing pharmacies points. Then I made two raster heatmaps:

  1. Buildings heatmap weighed by apartments count (blue on the image)
  2. Pharmacies heatmap (red on the image)

enter image description here

I tried raster calculator with formula "apartments/pharmacies". The result looks like thruth (the more greener area, the more lack of pharmacies), but very ragged and exactly in bounds of pharmacies heatmap (not included other buildings areas)

enter image description here

And I cant go further.

What should be my direction?

  • Note that the heatmap analysis you've done has 'egg'-shaped forms. This is because the projection of your project and data do not match. If you want to remove the 'eggs', you should match the projection of your project and the layers.
    – LMB
    Jul 28, 2017 at 8:03
  • apartments/pharmacies this division bounds your result to the pharmacy layer because where there is no building but a pharmacy the division is 0/pharmacyValue = 0 but if there is no pharmacy value the division is buildingValue/0 and that is prohibited
    – Mazu_R
    Jul 28, 2017 at 8:56
  • @Mazu_R i guessed :) I'm trying to find way to fill novalue areas with with some small like 0.0001 values and get two equal rectangles of apartments and pharacies. then that calculation may work.. Jul 28, 2017 at 9:09
  • You may consider location of healths intitutions(hospitals etc.) because being close to health institution is a plus for a pharmacy. In the city I live pharmacies are usually located quite close to health institutions. Aug 1, 2017 at 10:14

1 Answer 1


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:

  1. Get my hands on a roads dataset. Fortunately, QGIS has an addon just for this purpose.
  2. Construct a routable network dataset from the roads.
  3. 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.
  4. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.