I have a shapefile for a country, made up of a shape per province. I want to create a raster layer in the shape of the country and for each pixel in the area covered by province 1 set the value to value1, for the area covered by province 2, set the pixels to value2, etc. I want the pixels to represent 1km/1km resolution.
I've tried various ways to go about this, but the closest I've come is some combination of creating a constant raster layer and cropping it to the whole country boundary, and I've had some trouble getting anywhere with that and suspect it's not the best way to go about it.
I'm using QGIS, but can switch to anything open-source that helps (GDAL, R, etc).