# Calculating percentage of certain point type over rest inside grid using QGIS

I have a layer of polygons which represent types of uses for a city, let's name it `USES_POLYGONS`. Think of a street: every building will have N number of polygons and each polygon will have a colour depending on its use (Restaurants, Clothing, Supermarket... a `Type` field).

I also have this same layer, same attributes, but as centroid and randomized point layers: `USES_POINTS`.

Along with the previous ones, I have a simple grid layer on top of my zone.

The goal is to colour the grid with a gradient scale depending on the uses of the polygons or the points inside each style. For example, let's say I want to measure the proportion of Restaurants over the rest of uses from 'Type', so the end result would be the grid coloured using any colour scale to depict intensity, being the most intense those tiles in which Restaurants have the biggest value over the rest.

Let's say there are 3 tiles:

Tile 1 has 2 polygons/points, 1 Restaurant and 1 Clothing;
Tile 2 has 3 polygons/points, 3 Restaurants
Tile 3 has 5 polygons/points, 1 Clothing, 1 Supermarket, 3 Empty Business.

Tile 2 will be the most intense coloured (100% of polygons/points are Restaurants); Tile 3 will be the least intense coloured (0% of polygons/points are Restaurants), and Tile 1 will have an in-between colour intensity (50% of Restaurants).

Any approach to do this?

My tries so far have led me to get how many points of each individual use are in the tiles, so I get the colour gradient depending on how many points of a single use are inside a tile, not depending on the rest of uses, and what I want to know is the relation between uses inside each tile: % of Restaurants over the rest of uses inside a tile; % of Clothing stores over Retail, Supermarkets and Residences inside a tile; % of Franchises over Non-Franchises inside a tile...)

Here are a couple images:

1. Image depicting intensity of uses for the type Restaurant alone

2. Map depicting the Grid layer and the USES_POLYGONS layer

• Did you try the "Overlap analysis" tool ? Feb 18, 2022 at 10:45
• Please do not include chit chat like greetings and statements of appreciation within your posts.
– PolyGeo
Feb 18, 2022 at 10:50