In a food processor combine flour, ground almonds, cold butter, sugar and baking powder and pulse until the mixture resembles fine bread crumbs, add the egg and pulse until just combined. (This could also be done in a bowl with a pastry blender.)
Take the pastry out of the food processor, it will be soft. Pinch off 1/3 of the pastry, wrap it in plastic wrap and put it in the freezer. Wrap the rest in plastic wrap as well and put it in the fridge to chill for 30 minutes.
Combine cream cheese or farmer's cheese, eggs, sugar and vanilla in a large bowl using a hand mixer or a food processor if you want your farmer's cheese to be silky smooth.
When the pastry is done chilling take it out of the fridge and roll it out to fit a rectangular 9x13 inch baking dish on a floured surface, making sure it comes up the sides. Don't worry if it tears, you can patch it up, this pastry is very forgiving.
Then put it back in the fridge to chill for 20 minutes longer.
Preheat the oven to 350F/180C
Take it out of the fridge and fill it with the cheese filling, top with raspberries.
Take the frozen part out of the freezer and grate it using a vegetable grater, then toss the crumbs with 30g/1/4 cup of ground almonds.
Scatter all over the cheese filling. Bake in the preheated oven for 40 minutes until golden.
Cool completely for 3 hours or overnight in the fridge before cutting into bars.