# Join attribute by location giving bigger results QGIS

I have created a grid over South Africa, each cell being 10 km x 10 km. In addition, I have a raster layer that has been polygonized, each polygon containing a population count. The total of these population polygons equate to 53 million inhabitants

Because my computer can't handle the analysis of all the population polygons (1,5 million) I've decided to create this coarser grid, to group population estimates.

Therefore, I've joined the grid with the population polygons ("Join attributes by location"), so that each grid cell can now contain a total population, made of several pop estimates. However, when I use the tool "statistics by categories", the total sum of population inside the grid equates to 63 million... I don't understand why there is a difference in population estimates. The sum of all the grid cells should equate to 53 million inhabitants.

• Does the origin of your coarse grid align with the higher resolution grid? Is the coarse grid size an exact multiple of the fine? If not, then you have partial overlap on the join, where the population is allocated multiple times. – Vince Feb 13 at 14:16
• @Vince, I'm not sure I understand the difference, sorry... – Tim56 Feb 13 at 14:20
• You can see this play out by allocating uniform population in a clone of the real dataset, then plotting the resultant aggregation. – Vince Feb 13 at 14:22
• Then the cost of the failure to align the grids is a 20% increase in population due to overlaps on resampling. You could prorate the allocation by using Union, but then you'd be working with a 2-3 million row feature class. – Vince Feb 13 at 14:38
• Not necessarily. Just an example. But it has to be a multiple of 10km, and it has to align. I work with tessellated grids on a daily basis, with up to nine levels of nesting (using your 10km example, I have 2.5,5,10,20,40,80,160,320,640 km squares all nested for multiscale modelling, summary, and display, so choosing a multiple of two is attractive, allowing infill if warranted) – Vince Feb 13 at 15:05